%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

API Rate Limit & Token Bucket Calculator

Results update as you type.

Your numbers

Understanding the API rate limit and token bucket calculator — concept and principle

Most APIs limit how fast clients may call them, and the token bucket is the most common way to express that limit: a short burst is allowed, then requests must slow to a steady rate. This calculator tells you the minimum time needed to send a batch of requests under a given refill rate and bucket size, and how many requests the steady rate allows per day. It helps when planning bulk jobs, data migrations and client-side throttling.

Token bucket rate limitA full bucket of 100 tokens lets 100 requests go at once; the other 900 wait for refills at 10 per second, 90 seconds.Token bucket: one burst, then a steady dripholds 100+10 tokens/s1 request = 1 tokenneed 1,000 requests100 now + 900 later100900 ÷ 10/s = 90 sat t = 090 sAt least 90 s for 1,000steady rate: 10 × 86,400 = 864,000 a day
The bucket allows a 100-request burst; after that the refill rate of 10/s sets the pace.

How it is calculated

The bucket is assumed to start full. Refill rate is in requests per second; bucket size is the maximum burst.

The principle

Picture a bucket holding up to B tokens, refilled at r tokens per second. Each request spends one token; if the bucket is empty, the request must wait (or is rejected, typically with HTTP 429 Too Many Requests). Starting full, you can send B requests immediately. Every further request needs a new token, and tokens arrive at rate r, so the remaining N − B requests take (N − B) ÷ r seconds. Over long periods the burst becomes negligible and throughput approaches r. A leaky bucket is a related design that smooths output to a constant rate instead of allowing bursts.

Worked example

  1. Inputs: refill 10 requests/s, bucket 100, 1000 requests to send.
  2. Burst: the first 100 requests go out at once.
  3. Remaining: 1000 − 100 = 900 requests at 10 per second.
  4. Minimum time: 900 ÷ 10 = 90 s.
  5. Daily capacity at the steady rate: 10 × 86,400 = 864,000 requests.
How Minimum time (s) changes with Refill rate (requests/s)How Minimum time changes with Refill rate01002003004002.557.51012.51520Example: 90Refill rate (requests/s)
Each point is the calculator re-run with only “Refill rate (requests/s)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Refill rate (requests/s)Minimum time (s)
2.5360
5180
7.5120
1090
12.572
1560
2045

How to read the result

The minimum time is a floor; network latency and server response time add to it, and you will usually send slightly slower than the limit to avoid errors. If the job must finish faster, the options are a higher quota, fewer requests (batch endpoints, caching, conditional requests) or spreading work across allowed keys where the provider's terms permit it.

Common mistakes

Keep in mind: Providers implement limits differently (fixed windows, sliding windows, token buckets), so read their documentation and response headers rather than relying only on this model.

Frequently asked questions

What should a client do after HTTP 429?

Wait as long as the Retry-After header says if present, otherwise back off exponentially with some random jitter.

Is a token bucket the same as a fixed window?

No. A fixed window resets a counter each period, which can allow double bursts at window edges; a token bucket refills continuously.

Does the burst count toward the daily total?

Yes, but once; the steady-state daily figure assumes the bucket is not idle long enough to refill.

Sources: IETF RFC 6585, Additional HTTP Status Codes (429 Too Many Requests) · IETF RFC 9110, HTTP Semantics (Retry-After) · A. S. Tanenbaum and D. J. Wetherall, Computer Networks, Pearson (traffic shaping: leaky and token bucket)

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →