Rate limiting algorithms and 429 headers
Standard RateLimit headers, Retry-After, and 429 responses under ADP-013.
Comparing limiter algorithms
Select storage footprint and burst handling per route class.
| Algorithm | State per key | Boundary burst risk | Typical workload |
|---|---|---|---|
| Token bucket | 2 fields (tokens, timestamp) | Controlled burst capacity | Webhooks, CLI sync, SDK retries |
| Sliding window counter | 2 minute buckets | Minimal boundary spike | Per-tenant REST quotas |
| Fixed window counter | 1 counter | 2x spike at window boundary | Edge DDoS protection |
| Concurrency semaphore | Active in-flight counter | Zero timed queue backlog | Heavy exports and LLM calls |
Standard HTTP 429 response with RFC 9457 payload
HTTP/1.1 429 Too Many Requests Content-Type: application/problem+json Retry-After: 12 RateLimit-Limit: 120 RateLimit-Remaining: 0 RateLimit-Reset: 12
Validate 429 coverage automatically
Check whether every endpoint declares a 429 response or quota headers in the Stripe-style preset.