Skip to content
ENExplore Calculators

API Rate Limit Calculator

Test a token-bucket rate limit against real client demand: rejected requests, burst drain time and the per-client allowance.

About API Rate Limit Calculator

A token bucket refills at the sustained rate and holds up to the burst size, so over any window it admits the refill plus whatever was banked. Once offered load exceeds the refill rate the bucket empties at the difference between the two, which is how long a spike is tolerated before rejections start. A single shared limit lets one misbehaving client consume the whole allowance and 429 everyone else, which is why the fair-share figure matters more than the global number.

Formula

API Rate Limit

a token bucket admits rate × window + burst requests per window; rejections = offered − admitted; burst drain = burst ÷ (offered rate − sustained rate).

burstSize
Tokens the bucket holds, letting a short spike exceed the sustained rate
perClientLimit
Sustained rate divided evenly across all clients

Worked example

With the default values below, API Rate Limit Calculator returns Requests Rejected of 48.3%. Change any input above and every figure here is recalculated in your browser.

Inputs used

Sustained rate limitaccepts 0.1–10,000,000 rps
500 rps
Burst bucket sizeaccepts 0–10,000,000 requests
1,000 requests
Clients sharing the limitaccepts 1–10,000,000 clients
200 clients
Peak rate per clientaccepts 0.01–100,000 rps
5 rps
Measurement windowaccepts 1–86,400 s
60 s

Results

Requests Rejected
48.3%
Offered Request Rate
1,000.0 rps
Requests Rejected per Window
29,000
Time to Exhaust the Burst Bucket
2.00 s
Fair-Share Limit per Client
2.50 rps
Assessment
Limit is far below demand — raise the rate or apply per-client buckets

Step by step

  1. 1Values used
  2. 2API Rate Limit
  3. 3Requests Rejected= 48.3
  4. 4Offered Request Rate= 1,000.0 rps
  5. 5Requests Rejected per Window= 29,000
  6. 6Time to Exhaust the Burst Bucket= 2.00 s
  7. 7Fair-Share Limit per Client= 2.50 rps
  8. 8Assessment= Limit is far below demand — raise the rate or apply per-client buckets

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is API Rate Limit calculated?

a token bucket admits rate × window + burst requests per window; rejections = offered − admitted; burst drain = burst ÷ (offered rate − sustained rate). A token bucket refills at the sustained rate and holds up to the burst size, so over any window it admits the refill plus whatever was banked. Once offered load exceeds the refill rate the bucket empties at the difference between the two, which is how long a spike is tolerated before rejections start.

Why does API Rate Limit matter?

A single shared limit lets one misbehaving client consume the whole allowance and 429 everyone else, which is why the fair-share figure matters more than the global number.

What values do I need to enter?

This calculator takes 5 inputs: Sustained rate limit, Burst bucket size, Clients sharing the limit, Peak rate per client, Measurement window. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

API Rate Limit Calculator – Calculate Requests Rejected