API Rate Limit Calculator

Model token-bucket rate limits: requests per window, refill rate, burst capacity, and time to exhaust

Frequently Asked Questions

How does a token-bucket rate limiter work?

A bucket holds up to "burst" tokens and refills at a steady "refill" rate (tokens per second). Each request consumes one token; if the bucket is empty the request is throttled until a token is added.

How many requests are allowed per window?

Sustained throughput equals the refill rate × window length, plus the initial burst capacity. A bucket refilling at 10/s with a 100-token burst allows up to 100 + 10 × window-seconds requests over that window.

How fast can a full bucket be exhausted?

If requests arrive faster than refill, the burst drains in burst ÷ (arrival rate − refill rate) seconds. A 100-token bucket refilling at 10/s, hit at 60/s, empties in 100 ÷ (60 − 10) = 2 s.

How is a token bucket different from a fixed window?

A fixed window resets a counter every interval, allowing bursts at the boundary (double the limit across two adjacent windows). A token bucket smooths traffic by enforcing an average rate while still permitting a controlled burst.

Important Disclaimer: Estimates for informational purposes only.

This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.