Not every 429 is a rate limit
Step 1 · The pattern
Retry the 429 after a short wait
The app calls a model API. Now and then it gets 429 Too Many Requests with a retry-after header: a per-minute limit. The backend waits as told and tries again, and the user gets an answer a moment later. (All numbers are illustrative.)
- a request
- answered
In short
Not every 429 is a rate limit: how it works and how it breaks
HTTP 429 means 'too many requests', and most client code treats it one way: wait and retry. Model providers use it for different conditions. A per-minute rate limit comes with a retry-after header, and waiting works. A ramp limit appears after a sharp rise in usage, even while you are under your limits; the fix is to grow traffic more slowly. A monthly spend cap also returns 429, with no retry-after, and nothing changes until next month or until someone raises the cap: every retry, the SDK's included, fails. A client that retries every 429 the same way turns a billing problem into a flood of doomed calls, with users on a spinner and nobody paged. Read the error code: back off on rate limits, slow the ramp on ramp limits, and on a spend cap fail fast and alert a person.
What this simulation simplifies
- Retries are shown as a fixed two copies per request; real SDKs and app code vary.
- Error codes and header names differ between providers; check your provider's documentation.
How this comes up in interviews
"How should a service that calls an LLM provider handle 429 responses?"
Then they ask
- What does the provider tell you in the response?
- Who retries: the SDK or your code?
- What happens when you hit a spend cap?
A strong answer covers
- Different 429s: rate limit, ramp limit, spend cap; read the error code.
- Honour retry-after, add jitter, cap total retries per request.
- One layer owns retries; turn off the others.
- Spend caps: fail fast, clear message, alert a person.
- Graph 429s by code; alert on caps and ramp limits.
Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.
On one page: the track cheat sheet.
Sources: Anthropic API docs: Rate limits (error codes, ramp limits, spend limits) ↗ · Microsoft Learn: Azure OpenAI quota management ↗ · Report a problem
Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.