Status 429Rate limits (429)Codex CLIClaude CodeopencodeClineSDK / curl

Fix 429 "rate limit exceeded" and "concurrency limit exceeded"

Error message
API Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"API Key request rate exceeded"}}

Codex shows "exceeded retry limit, last status: 429 Too Many Requests" and Claude Code shows API Error: 429 when CCSub turns a request away: too many requests per minute on one key (60 by default), going over a token rate you set on the key, or too many concurrent requests on the account (10 by default). Less often, an upstream line returns the 429. Here is how to tell which, and the fix for each.

Fix it in 3 steps

  1. 1

    Read which limit you hit

    API Key request rate exceeded means this key sent too many requests in the last minute. API Key token rate exceeded means you set a token rate on the key and went over it. User concurrency limit exceeded means your account has too many requests waiting at the same time. Codex shows only "exceeded retry limit, last status: 429 Too Many Requests", without the message; the Codex section below shows how to tell which limit it was.

  2. 2

    For rate limits, edit the key

    On API Keys in the dashboard, edit the key, turn on custom rate limits, and raise requests per minute. Leave the token rate empty for no limit. You can also give each tool or project its own key, since every key is counted separately.

  3. 3

    For concurrency, send fewer requests at once

    Close some of the Claude Code or Codex sessions running in parallel, and lower the parallelism of subagents and batch scripts. The cap is per account and shared by all keys, so creating more keys won't help. If you genuinely need more, contact support with your use case.

Other forms of the same error

  • {"type":"error","error":{"type":"concurrency_limit_error","message":"User concurrency limit exceeded: too many requests waiting for upstream (limit 10). 账号同时等待上游响应的请求已达上限(10 个,账号下所有 Key 共用),请等手上的请求返回后再试。"}}
  • {"type":"error","error":{"type":"rate_limit_error","message":"API Key token rate exceeded"}}
  • exceeded retry limit, last status: 429 Too Many Requests

Three limits, one status code

CCSub runs three checks before forwarding a request. Failing any of them returns HTTP 429:

  • API Key request rate exceeded — requests per minute for a single key. Default 60. You can change it yourself on the Keys page.
  • API Key token rate exceeded — an optional per-key token rate. Unlimited by default; you only see this if you set one.
  • User concurrency limit exceeded — concurrent requests for your whole account. Default 10. Not user-adjustable.

The first two have error.type = rate_limit_error; the third is concurrency_limit_error.

A 429 can also come back from one of the upstream lines behind CCSub. That case is covered further down.

Codex: "exceeded retry limit, last status: 429 Too Many Requests"

exceeded retry limit, last status: 429 Too Many Requests

This is how Codex shows a 429 from CCSub. The line keeps the status code but drops CCSub's message, so it doesn't say which limit you hit. Work it out from what you were doing:

  • Several Codex windows, or Codex and Claude Code, running on the same account at once: most likely account concurrency. Stopping turns and resending them right away can cause it too. Close the sessions you aren't watching. Every key on the account shares this cap, so a new key won't help.
  • One key shared by several tools or scripts, or a turn with many quick tool calls: most likely the key's requests per minute (60 by default). Every time Codex sends tool output back to the model, it makes a new request. Raise req/min for the key on API Keys, or give Codex a key of its own.
  • Neither, and it clears up by itself within a minute or two: it may have been an upstream line rate limiting (see below). Wait, then send the turn again.

Despite the wording, Codex usually hasn't retried anything. It retries a 429 only when the response has a Retry-After header: it waits as long as the header says, then sends the request again, up to stream_max_retries times (5 by default). CCSub's request-rate, token-rate and account-concurrency 429s have no Retry-After, and neither does a 429 passed back from an upstream line, so Codex shows the line at the first 429. request_max_retries doesn't apply to 429s at all.

The exception is Too many concurrent uploads (see the concurrency section below), which has Retry-After: 2. Codex waits and retries it. While it does, Codex CLI 0.171 and later show Server is busy, reconnecting 1/5; 0.167 and earlier show Reconnecting... 1/5.

When it's fixed, the turn runs to the end without this line, and its requests show up on your Usage page with token counts.

This covers Codex connected to CCSub with model_provider = "ccsub", which sends its requests to /api/v1/responses. It was checked against the Codex CLI source, versions 0.162.1 to 0.172.0; Codex Desktop and the IDE extension may display things differently. If Codex still uses its built-in provider and that provider isn't pointed at CCSub, the 429 isn't from CCSub: fix config.toml first (see Codex 401 Unauthorized).

Too many requests per minute

The counter is a fixed 60-second window that starts with the key's first request. Anything over the limit inside that window gets a 429, and the count resets when the next window starts. A single Claude Code action can fire more than one request — title generation and other background calls ride along with the main conversation — and agentic tools like opencode and Cline make bursts of calls while running tools. Sixty per minute can be tight for heavy sessions.

What to do:

  1. Open API Keys, edit the key, enable custom rate limits, and raise requests per minute (req/min).
  2. Give each tool or project its own key. Limits are per key, so separate keys don't compete with each other, and the usage log becomes easier to read per key.
  3. In your own batch scripts, space requests out or put them in a queue. On a 429, wait a few seconds before retrying instead of resending immediately.

Token rate exceeded

This only happens if you configured a token rate on the key. Note how it's counted: each request adds the max_tokens value it declares, not the tokens it ends up using. Claude Code typically declares tens of thousands of max_tokens per request, so a limit of, say, 150,000 tokens per minute may only allow a few requests. If you don't need a token cap, clear the field.

Account concurrency exceeded

Concurrency counts requests on your account that are waiting for the upstream to start responding (for non-streaming requests, until the full response comes back). All keys on the account share the same cap, so you can't work around it with more keys. Common ways to hit it:

  • Several Claude Code or Codex windows all running tasks at once.
  • Claude Code dispatching many subagents in parallel.
  • Batch or eval scripts hammering the API with high concurrency.

The fix is to lower parallelism: fewer simultaneous sessions, and a concurrency setting below 10 for batch jobs. If your workload really needs more, email support and describe what you're running.

The message shows the cap and then repeats itself in Chinese, for example User concurrency limit exceeded: too many requests waiting for upstream (limit 10).

A second form, User concurrency limit exceeded: too many in-flight requests (limit N), counts streaming requests until the stream ends. A request you stopped in the client still counts while the upstream finishes generating it, so stopping and resending quickly can fill it up. The fix is the same: fewer requests at once.

Too many concurrent uploads, please retry shortly (after a Chinese sentence saying the same) is a separate, short-lived 429. Your account's slots for uploading request bodies at the same time are full; the slots are tightened for a while when the site is busy. It comes with Retry-After: 2, so wait a couple of seconds and send again. Codex does this on its own (see above).

A 429 that mentions an upstream rate limit

If the message isn't one of CCSub's own quoted on this page, the 429 most likely came from an upstream line behind CCSub, not from your key or account.

When an upstream line returns 429, CCSub skips that line for a while and sends the request once more on another line that is free. You only get the 429 when no other line was free or the second one was rate limited too. CCSub then passes back the upstream's error type and message as they were, with any web addresses replaced by [upstream]. Codex shows it as the same exceeded retry limit line, without retrying.

  • Wait about a minute, then send the turn again. In Claude Code you can type "continue".
  • Raising the key's requests per minute or running fewer sessions won't help here: none of CCSub's own limits was hit.
  • If it keeps happening for more than ten minutes, email support@ccsub.net with the time (to the minute), the model ID and the full message.

When it's fixed, the next attempt gets a normal reply. If the message talks about overload rather than a rate limit, see 503 overloaded.

This covers every tool connected to CCSub and all of its chat endpoints, such as /v1/messages (Claude Code), /api/v1/responses (Codex) and /v1/chat/completions. It doesn't cover 429s that carry one of CCSub's own messages; those are explained above.

What it looks like in each tool

  • Claude Code retries first, showing Retrying in Ns · attempt x/10, and only prints API Error: 429 ... once retries are exhausted.
  • Codex CLI shows only exceeded retry limit, last status: 429 Too Many Requests. The Codex section above covers when it retries and how to tell which limit it was.
  • Your own code should branch on error.type: after rate_limit_error, wait for the next minute; after concurrency_limit_error, wait for in-flight requests to return before sending new ones. If the response has a Retry-After header, wait that many seconds before retrying.

FAQ

What are the default limits?

Each key allows 60 requests per minute by default, counted in a fixed 60-second window. Token rate is unlimited unless you set one. Each account can have up to 10 requests waiting on an upstream response at the same time.

Does Claude Code retry 429s automatically?

Yes. Claude Code retries temporary 429s up to 10 times by default and shows Retrying in Ns · attempt x/10 while it does. You only see the error after those retries fail, which means you've been over the limit for a while.

Why do I get "token rate exceeded" after only a few requests?

The token rate adds up the max_tokens declared in each request, not the tokens actually used. Claude Code often declares tens of thousands of max_tokens per request, so a modest token rate runs out after a handful of calls. If you don't need it, leave the token rate empty.

Are 429 responses billed?

No. CCSub checks its own limits before anything is forwarded, and a 429 passed back from an upstream line produced no output, so neither is billed.

Codex says "exceeded retry limit, last status: 429 Too Many Requests". Should I raise request_max_retries?

No. request_max_retries covers 5xx responses and connection errors, never a 429. Codex retries a 429 only when the response has a Retry-After header, and those retries count against stream_max_retries (5 by default). CCSub's request-rate, token-rate and account-concurrency 429s have no Retry-After, so neither setting changes anything for them. If the 429s keep coming, raise the key's requests per minute on API Keys or run fewer sessions at once; if an upstream line is limiting, wait a minute and send again.

Still stuck?

New to CCSub?

Sign up, create an API key in the dashboard, and paste it into Claude Code, Codex CLI or your editor. You pay for what you use.