Anthropic API Error rate_limit_error: Rate limit exceeded (429)
Your organization exceeded its requests-per-minute or tokens-per-minute limit for this model. Wait for the retry-after header, then cut token usage with prompt caching or smaller prompts.
Identify: does your log match?
anthropic.RateLimitError: Error code: 429 - {"type": "error", "error": {"type": "rate_limit_error", "message": "This request would exceed your organization's rate limit of 30,000 input tokens per minute."}, "request_id": "req_011CUQ7x2kGd8sWb1mHf4ZqA"}
retry-after: 12- High
Input tokens per minute (ITPM)
Large prompts (long documents, big tool definitions) use up the per-minute input token budget long before the request count limit.
- Medium
Bursty concurrency
A batch job sends many requests in the same second; limits are enforced continuously, so short bursts trip them even when the minute average is fine.
- Medium
Low usage tier
New organizations start on lower limits that rise with spend.
Fix
Honour retry-after
for (const doc of docs) await client.messages.create(build(doc));
import Anthropic from "@anthropic-ai/sdk"; for (const doc of docs) { try { await client.messages.create(build(doc)); } catch (e) { if (!(e instanceof Anthropic.RateLimitError)) throw e; const wait = Number(e.headers?.["retry-after"] ?? 10); await new Promise(r => setTimeout(r, wait * 1000)); } }
retry-after says exactly when capacity frees up. Waiting less just produces another 429.
Verify: reproduce it on purpose
$ for i in $(seq 1 80); do curl -s -o /dev/null -w "%{http_code}\n" https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" \
-d '{"model":"claude-haiku-5-5","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}' & done | sort | uniq -cRun it against a dev environment to trigger rate_limit_error on purpose and test your error handler.
Prevent
- Read the anthropic-ratelimit-* response headers and slow down before you hit zero.
- Cap concurrency per model instead of firing all requests at once.
- Move non-urgent work to the Message Batches API.
FAQ
Which limit did I hit?
The message names it (requests, input tokens or output tokens per minute), and the anthropic-ratelimit-* headers show what remains for each.
Why 429 when the dashboard shows low usage?
Limits are enforced over short windows, so a one-second burst can exceed them even if the minute total looks small.
Related errors
Last verified 2026-10-22 · Source: Anthropic API error reference + SDK docs · Official docs ↗ · ~9,900 searches/mo