Anthropic APIRunbook 0/4 done
rate_limit_error

Anthropic API Error rate_limit_error: Rate limit exceeded (429)

Warning↻ Retryable · exponential backoffHTTP 429 Too Many RequestsAI Provider
TL;DR · 10-second read

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?

What you see · exact log / response
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
  1. 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.

  2. 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.

  3. Medium

    Low usage tier

    New organizations start on lower limits that rise with spend.

Fix

Honour retry-after

✕ Broken · TypeScript
for (const doc of docs) await client.messages.create(build(doc));
✓ Fixed · TypeScript
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

Reproduce locally · bash
$ 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 -c

Run 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