Skip to content
Calcrivo

API Rate Limit Calculator

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

Inputs

rps
requests
clients
rps
s

Requests Rejected

48.3%

Offered Request Rate

1,000.0rps

Requests Rejected per Window

29,000

Time to Exhaust the Burst Bucket

2.00s

Fair-Share Limit per Client

2.50rps

Assessment

Limit is far below demand — raise the rate or apply per-client buckets

Step by step

  1. Values used

    Sustained rate limit = 500 rps; Burst bucket size = 1,000 requests; Clients sharing the limit = 200 clients; Peak rate per client = 5 rps; Measurement window = 60 s

  2. API Rate Limit

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

  3. Requests Rejected

    = 48.3

  4. Offered Request Rate

    = 1,000.0 rps

  5. Requests Rejected per Window

    = 29,000

  6. Time to Exhaust the Burst Bucket

    = 2.00 s

  7. Fair-Share Limit per Client

    = 2.50 rps

  8. Assessment

    = Limit is far below demand — raise the rate or apply per-client buckets

How it works

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

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.

You might also need