← Blog

Claude API 429 Error: Rate Limit Fix Guide

2026-11-23 · 5 min read · SubToAPI Team

A 429 error from the Claude API means you've hit a rate limit — either requests-per-minute, tokens-per-minute, or your organization's usage tier cap. It's not a bug, it's Anthropic telling you to slow down or spread your traffic out. The fix depends on whether the limit is hit occasionally under bursts or constantly under normal load.

This guide covers the three real fixes: reading the response correctly, implementing backoff and retries, and restructuring how your app sends requests so it doesn't hit the ceiling in the first place.

Why you're seeing a 429

The Claude API enforces limits per organization and per model, tracked across a few dimensions:

Your usage tier (set by billing history and account age) determines the actual numbers. New accounts start with low limits and these scale up as usage and payment history accumulate. A 429 means you crossed one of these three thresholds in the current minute window, not that something is broken.

Check the response headers — they tell you exactly which limit you hit:

anthropic-ratelimit-requests-remaining: 0
anthropic-ratelimit-tokens-remaining: 1200
retry-after: 12

If requests-remaining is 0, you're sending calls too fast. If tokens-remaining is low, your prompts or expected output are too large for the current window. retry-after tells you how many seconds to wait before trying again — use it instead of guessing.

Fix 1: Respect retry-after and use exponential backoff

The simplest fix is to never retry immediately. Read the header and wait:

async function callClaude(payload, attempt = 0) {
  const res = await fetch('https://api.anthropic.com/v1/messages', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.ANTHROPIC_API_KEY,
      'anthropic-version': '2023-06-01',
      'content-type': 'application/json'
    },
    body: JSON.stringify(payload)
  });

  if (res.status === 429) {
    if (attempt >= 5) throw new Error('Rate limit retries exhausted');
    const retryAfter = Number(res.headers.get('retry-after')) || 2 ** attempt;
    await new Promise(r => setTimeout(r, retryAfter * 1000 + Math.random() * 500));
    return callClaude(payload, attempt + 1);
  }

  if (!res.ok) throw new Error(`API error: ${res.status}`);
  return res.json();
}

Key details:

This handles occasional bursts but won't save you if your sustained traffic exceeds your tier's limit — in that case every retry just hits another 429.

Fix 2: Queue and throttle requests client-side

If you're generating many completions in parallel (batch jobs, bulk summarization, background workers), don't fire them all at once. Use a concurrency-limited queue:

import pLimit from 'p-limit';

const limit = pLimit(3); // max 3 concurrent calls

const results = await Promise.all(
  items.map(item => limit(() => callClaude(buildPayload(item))))
);

Pair this with a token-bucket style rate limiter if you know your RPM ceiling, so you're pacing requests evenly across each minute instead of bursting at the start and stalling at the end.

Fix 3: Reduce token usage per request

If you're hitting the token-per-minute limit rather than the request limit, backoff won't help much — you need to send fewer tokens:

A request that reserves 4096 output tokens but only needs 300 is wasting token budget that counts against your per-minute cap even before generation finishes, depending on how your usage tier accounts for reserved vs. actual output.

Fix 4: Request a tier increase or spread load across keys

If your app is legitimately scaling and backoff plus throttling still isn't enough, the limits themselves need to change. Usage tiers increase automatically with consistent spend and account age, or you can request a manual increase through Anthropic's support channel if you have a clear growth case.

Separately, if you're running multiple products or environments (staging, production, multiple customer-facing tools) under one Anthropic account, splitting traffic across distinct API keys with usage caps per key — rather than one shared key hitting one shared limit — gives you better isolation and makes it obvious which workload is actually causing the 429s.

This is one of the problems SubToAPI solves if you're building on top of Claude for multiple internal tools or customer-facing features: it sits on top of your Claude access and issues separate application API keys (sub_live_...) per app or team, so one runaway script doesn't exhaust the shared budget for everything else. You get usage metadata per key, which makes it much faster to spot which integration is actually responsible for a spike before it turns into a wall of 429s. See the docs or quickstart if you want to try it — there's a free trial at signup.

Putting it together

A solid production setup looks like this:

  1. Backoff with jitter on every 429, respecting retry-after
  2. Client-side concurrency limits so you never burst past your RPM
  3. Token budgeting — trim context, cap max_tokens, use stop sequences
  4. Monitoring — log 429 rates by endpoint/key so you catch creeping usage before it becomes an outage
  5. Key isolation — separate credentials per app or team so limits are diagnosable, not shared chaos

Most 429s are fixable with steps 1–3 alone. If you're still hitting walls after that, the problem usually isn't backoff — it's that your actual steady-state traffic exceeds your tier, and you need either a tier increase or better request shaping upstream.

questions

Does retrying immediately after a 429 ever work? Rarely. If the limit resets within the same second it might succeed, but in practice immediate retries just add more load to an already-throttled window. Always wait at least the retry-after value or use exponential backoff.

Is a 429 the same as hitting a monthly spending cap? No. A 429 is a short-term rate limit tied to requests or tokens per minute. Spending caps and billing limits return different errors (typically related to account status), not 429.

Can increasing max_tokens cause more 429 errors? Yes, indirectly. A higher max_tokens reserves more of your tokens-per-minute budget per request, even if the actual response is shorter, which can push you over the limit faster under concurrent load.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →