Test a token-bucket rate limit against real client demand: rejected requests, burst drain time and the per-client allowance.
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.
API Rate Limit
a token bucket admits rate × window + burst requests per window; rejections = offered − admitted; burst drain = burst ÷ (offered rate − sustained rate).
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.
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.
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.