# 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](https://platform.claude.com/docs/en/api/rate-limits) 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](/answers/failure-modes/what-causes-a-retry-storm-in-an-agent).

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

---

Published: 2026-11-24

Sources:
- Claude API docs: Rate limits: https://platform.claude.com/docs/en/api/rate-limits (fetched 2026-11-24)

Source: https://tessary.ai/answers/agent-error-messages/why-does-my-agent-get-rate-limit-error-429-in-a-retry-loop
More on Agent error messages: https://tessary.ai/answers/agent-error-messages
From Tessary, agent reliability for AI agents in production: https://tessary.ai
