PRODUCTION SCENARIO
A batch worker runs parallel requests against Claude Sonnet 5. Under traffic spikes some requests come back HTTP 429 with an
error.type of rate_limit_error and a retry-after header.What should the client do with those requests?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Sleep for the `retry-after` value, then retry with exponential backoff to a ceiling
A 429 carries
retry-after, earlier retries fail, and the documented pattern is to honor it and then back off exponentially to a ceiling. A fixed 250 ms delay retries inside the window the header just reserved. Cutting max_tokens frees nothing, because max_tokens does not factor into the output-token rate limit. A dead-letter queue is the right tool for a poisoned request, but this one is transient and the header already says when it will clear.
Official Source: https://platform.claude.com/docs/en/api/rate-limits ↗