---
title: "Claude Code: API Error: Rate limit reached (429 fix)"
canonical: https://relayswitch.io/fix/claude-code-rate-limit-reached
generated: 2026-11-02T10:50:34.168Z
source: https://api.relayswitch.io/v1/catalog
base_url: https://api.relayswitch.io/v1
---

Fix

# Claude Code "API Error: Rate limit reached": the 429 and the fix

A 429 from the Claude API, printed by Claude Code. Below: what Anthropic’s docs say it is, the one header that tells you how long to wait, and a key where the limits are yours.

[Get a key](https://app.relayswitch.io/console)[The switch](#switch)

The error

## What the client prints

text

1`API Error: Rate limit reached`

2

3`# The body behind that line, in the Claude API's error shape:`

4`{`

5 `"type": "error",`

6 `"error": {`

7 `"type": "rate_limit_error",`

8 `"message": "..."`

9 `},`

10 `"request_id": "req_..."`

11`}`

## What it means

Anthropic's [API errors page](https://platform.claude.com/docs/en/api/errors) (read 2026-10-31) defines 429 `rate_limit_error` as: your organization has hit a rate limit, reached its usage tier's monthly spend cap, or reached a spend limit on the Claude Code workspace.

The [rate limits page](https://platform.claude.com/docs/en/api/rate-limits) (same date) measures limits per model class in requests per minute, input tokens per minute and output tokens per minute, per organization, with a token bucket: a 60-requests-a-minute limit can be enforced as one request a second, so a burst trips it. Claude Code sends the conversation and file context on every turn, so a long session meets the input-token limit first. Cached reads do not count toward it on most models.

One 429 is not a rate limit at all: the tier spend cap. The same page says that response carries no `retry-after` and keeps failing until 00:00 UTC on the first of the next month, with `error.details.error_code` set to `enforced_spend_limit_reached`.

## The retry rule

When the response has a `retry-after` header, wait that many seconds before retrying (Anthropic's rate limits page, 2026-10-31). Earlier retries fail. Claude Code and the official SDK retry transient errors with exponential backoff and honour the header when it is present.

No `retry-after` and a message about the monthly usage threshold means the spend cap: stop retrying, the clock is the calendar.

A limit you hit every afternoon is a budget problem, not a backoff problem. The fix below moves the session to a key with its own limits.

The structural fix

## A key that fails over, with limits you set

A retry loop treats the symptom. On this key the next route is tried before the error reaches you, every limit is per key, and a failed request costs nothing. From the OpenAPI document, read 2026-10-31.

Failover before you see it

A route that fails with a 5xx or a 429 is retried on the next route for the same model. x-uplink-attempts on the answer counts the tries; the price is the model’s own either way.

Your own fallback list

models: \[...\] names up to 5 models tried in order once every route of the one before has failed before a byte was sent. Each bills at its own price when it answers.

Failed requests are not charged

A 429, 502 or 503 from this API charges nothing and carries retry-after: back off that long before trying again.

Limits per key, set by you

rpm from 1 to 100,000, tpm from 1 to 50,000,000 and concurrency from 1 to 10,000 on each key. Default: 600 requests a minute per key, 50 in flight per account.

A budget per key

budget\_usd plus a daily, weekly or monthly spend limit. The key stops at its own line with a 402; the rest of the balance is untouched.

One request id

x-uplink-request-id on every answer, errors included. Quote it and we find the call.

Live

## Claude route, right now

From `GET https://api.relayswitch.io/v1/status`, the public feed behind [/status](https://relayswitch.io/status), generated 2026-11-02T10:04:52.985Z.

| Service | State | Last check | Latency | Checks today | Failures today |
| --- | --- | --- | --- | --- | --- |
| Claude | Operational | Nov 2, 2026, 9:07 AM UTC | 7373 ms | 10 | 0 |

Every hour the gateway counts the past hour’s real requests to this route: answered or failed. A request answered after a retry counts as answered.

The daily real-model check: 305 of 339 models answered as before, generated 2026-11-02T10:04:52.980Z. Every verdict is on [/proof](https://relayswitch.io/proof).

Live prices

## The ids this page is about, per million tokens

The Claude ids Claude Code can run on this key, in the Anthropic Messages format it expects.

| Model | Input | Output | Developer list in / out |
| --- | --- | --- | --- |
| [Claude Opus 5.5](https://relayswitch.io/models/claude-opus-5-5)claude-opus-5-5 | $2.80 | $10.00 | $4.00 / $20.00 |
| [Claude Sonnet 5.5](https://relayswitch.io/models/claude-sonnet-5-5)claude-sonnet-5-5 | $1.20 | $3.00 | $2.00 / $10.00 |
| [Claude Haiku 5.5](https://relayswitch.io/models/claude-haiku-5-5)claude-haiku-5-5 | $0.06 | $0.15 | $0.10 / $0.50 |

Read from the catalog at render. A request that fails over bills at the price of the model that answered.

The switch

## Two variables and Claude Code runs here

bash

1`export ANTHROPIC_BASE_URL="https://api.relayswitch.io/v1"`

2`export ANTHROPIC_AUTH_TOKEN="sk-relay-..."`

3`claude`

Claude Code's [environment variables reference](https://code.claude.com/docs/en/env-vars) (read 2026-10-31) lists `ANTHROPIC_BASE_URL` as the way to route requests through a proxy or gateway and `ANTHROPIC_AUTH_TOKEN` as the value of the Authorization header. Nothing else changes: same tool, same model ids, same Messages format.

The [Claude Code setup guide](https://relayswitch.io/guides/claude-code) has the settings.json form, a key for Claude Code alone with a budget, and the check that the request landed.

Related

-   [Claude Code setup guide](https://relayswitch.io/guides/claude-code)
-   [Claude Code free tier](https://relayswitch.io/claude-code-free-tier)
-   [Claude API pricing hub](https://relayswitch.io/pricing/claude)
-   [Key budgets and limits](https://relayswitch.io/features/key-budgets)
-   [Routing and fallbacks](https://relayswitch.io/features/routing)
-   [Live status](https://relayswitch.io/status)

Other errors

-   [OpenRouter 429: Provider returned error](https://relayswitch.io/fix/openrouter-429-provider-returned-error)
-   [Gemini API 429 RESOURCE\_EXHAUSTED](https://relayswitch.io/fix/gemini-api-429-resource-exhausted)
-   [Anthropic 529 overloaded\_error](https://relayswitch.io/fix/anthropic-529-overloaded)
-   [OpenRouter: No endpoints found](https://relayswitch.io/fix/openrouter-no-endpoints-found)
-   [All fix guides](https://relayswitch.io/fix)

FAQs

## Questions

From what people ask about this error.

Open the console

A key in under a minute

[Get a key](https://app.relayswitch.io/console)

Or email [hello@relayswitch.io](mailto:hello@relayswitch.io)

### 

### 

### 

### 

## A key that does not stop at one host

Failover at the same price, limits and a budget per key, failed requests not charged. Card or crypto, no KYC, no subscription.

[Live status](https://relayswitch.io/status)[Get a key](https://app.relayswitch.io/console)

