Why does my agent get "rate_limit_error" (429) in a retry loop?

The agent retries before the limit has room again, or the 429 isn’t an ordinary per-minute limit. Anthropic’s API uses a token bucket, so capacity refills continuously, and the retry-after header says how many seconds to wait. Earlier retries can fail.

Two other 429s don’t clear on a short wait. A sharp rise in usage hits a ramp limit even when you’re under your per-minute limits; hold traffic steady and raise it by at most one step per minute. Reaching the monthly spend cap also returns 429, with no retry-after header, and every retry fails until access resumes. error.details.error_code tells these apart from a plain rate limit.

An agent makes it worse because each turn resends the whole conversation. Uncached input tokens count toward the input limit and tokens read from the prompt cache don’t, so a stable cached prefix lowers the load. Without a retry cap and a delay, the loop becomes a retry storm.

These are Anthropic’s limits and behavior. Other providers set their own.

published

sources

keep reading

More on this.

Try Tessary on Cloud.

free · 10,000 traces a month · 1 GB · 30-day retention · $10 one-time credit for triage and RCA · no credit card