Claude API "Rate limit reached" (429): what it means and how to fix it
Updated 2026-11-19
Model page: Claude Sonnet 5.5 API — pricing, specs and the playground
Anthropic measures rate limits per model class in requests per minute (RPM), input tokens per minute (ITPM) and output tokens per minute (OTPM), using a token bucket that refills continuously rather than resetting on the minute. A 60 RPM limit can be enforced as one request per second, so short bursts can trip a 429 even when your per-minute average looks fine. Only uncached input tokens count towards ITPM, which makes prompt caching a direct way to raise your effective limit.
In Claude Code the message has changed over time. Older versions said "API Error: Rate limit reached"; current ones say "API Error: Request rejected (429)" for your key's rate limit, "Server is temporarily limiting requests (not your usage limit)" for a short throttle on Anthropic's side, and "You've hit your session limit" when a subscription quota runs out.
The kinds of 429, and which ones clear
| Cause | How to tell | What to do |
|---|---|---|
| Over RPM / ITPM / OTPM | The message names the limit; retry-after is present | Wait retry-after seconds, then smooth your request rate |
| Ramp limit after a sudden spike | error.details.error_code is ramp_limit_exceeded | Wait retry-after, then raise traffic by at most one step per minute |
| Monthly tier spend cap | error_code enforced_spend_limit_reached; no retry-after | Retrying fails until 00:00 UTC on the 1st of next month; move to a higher tier |
| A spend limit you set yourself | HTTP 400 invalid_request_error, not 429 (limits on the Claude Code workspace can return 429) | Raise the limit you set in the Console |
| Claude Code subscription quota | "You've hit your session limit · resets ..." | Wait for the reset, or use an API key billed per token |
How to fix it
1. Respect retry-after. When present, it is the number of seconds to wait; earlier retries can fail. The official SDKs already honour it.
2. Read the anthropic-ratelimit headers. Every response reports limit, remaining and reset for requests and tokens, so you can slow down before you hit the wall.
3. Smooth bursts. Spread requests evenly, cap concurrency, and in Claude Code avoid launching many parallel subagents at once.
4. Cache your prompts. Cached input tokens do not count towards ITPM, so a long shared system prompt or codebase context costs far less of your limit when cached.
5. Ramp up gently. Start scheduled or bulk jobs slowly and increase step by step; the Message Batches API is not subject to ramp limits.
6. In Claude Code, run /status. A stray ANTHROPIC_API_KEY in your environment can route requests through a low-tier key instead of your subscription.
Rate limits when you call Claude through APIMODELS
On APIMODELS you do not have an Anthropic organization, so Anthropic's usage tiers and monthly tier spend caps do not apply to you; you pay per token from your balance, and running out of balance returns our own 402 insufficient_credits error instead. Upstream rate limits still exist, and that is where the extra routes help.
On APIMODELS, every current Claude model (Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5) is served through at least two upstream routes. If the first route returns a 429, a 5xx or fails to connect before the response starts, the request is sent to the next route automatically, and you only see the error when every route has failed. Failed requests are not charged. One limit we cannot get around: once a response has started streaming to you, a failure in the middle of it cannot be moved to another route, so it reaches you as a stream error event.
Inicio rápido
cURL
curl https://api.apimodels.app/v1/messages \
-H "x-api-key: $APIMODELS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"stream": true,
"messages": [{"role": "user", "content": "Summarise this error log in three bullet points."}]
}'Python
import anthropic
# Same Anthropic SDK, pointed at APIMODELS. The SDK already retries 408/409/429/5xx
# with exponential backoff (twice by default); raise it for batch jobs.
client = anthropic.Anthropic(
base_url="https://api.apimodels.app",
api_key="sk_...your_apimodels_key...",
max_retries=4,
timeout=600,
)
try:
with client.messages.stream(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Summarise this error log in three bullet points."}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
except anthropic.APIStatusError as e:
# e.status_code: 429 / 500 / 529 ...; the body carries error.type and a request id
print("failed:", e.status_code, e.response.headers.get("request-id"), e.message)Preguntas frecuentes
What does "Rate limit reached" mean on Claude?
It is a 429 rate_limit_error: you exceeded requests, input tokens or output tokens per minute, increased traffic too sharply, or hit a spend cap. Newer Claude Code versions show "API Error: Request rejected (429)" for the same thing. Wait for the retry-after header, then smooth your request rate.
How long do I have to wait after a Claude 429?
Wait the number of seconds in the retry-after header when it is present; earlier retries may fail. If there is no retry-after and the error code is enforced_spend_limit_reached, your tier spend cap is reached and requests keep failing until 00:00 UTC on the first day of next month.
Why do I get a 429 when I am under my rate limit?
Two common reasons. Anthropic enforces limits with a token bucket, so a 60 RPM limit can act like one request per second and short bursts trip it. And after a sharp increase in usage, a ramp limit (ramp_limit_exceeded) can return 429 even under your ITPM and OTPM limits; ramp up step by step.
What does "rate limited" mean in Claude Code?
It means the API key, Bedrock project or Google Cloud project Claude Code is using hit its configured rate limit. Run /status to check which credential is active, since a stray ANTHROPIC_API_KEY can override your subscription, and reduce parallel subagents. "Server is temporarily limiting requests" is a short throttle on Anthropic's side, not your quota.
Do Anthropic usage tiers apply on APIMODELS?
No. You are not an Anthropic organization on APIMODELS, so its usage tiers and monthly tier spend caps do not apply; you pay per token from your balance. Upstream rate limits still exist, but current Claude models run on at least two upstream routes, and a 429 before the answer starts is retried on the next route automatically.
