Fix Rate Limit / Insufficient Quota in Claude Code and Codex CLI
Step-by-step fixes for the "Rate Limit / Insufficient Quota" error when connecting Claude Code or Codex CLI to DeepSeek, OpenRouter, and other providers.
Error output
429 Too Many Requests
{"error":{"message":"Rate limit reached for requests"}}
Common variations
402 Payment Required
{"error":{"message":"Insufficient Balance"}}
anthropic: Request failed with status 529: {"error":{"message":"Overloaded"}}
The exact text varies by agent version and provider. Match the status code and the message above.
Quick diagnosis
The status code tells you which layer is throttling you: 429 = rate limit, 402 = balance, 529 = provider overload.
Claude Code
claude /status Codex CLI
codex exec "hi" Common causes
- The provider limits requests per minute and the limit window has not reset.
- The account balance ran out; some providers surface this as 429 or 402.
- Free-tier request caps are exhausted (OpenRouter free models).
- Long agentic sessions burst many requests in a short window.
Fix by scenario
1 Happens during heavy agentic sessions
- Reduce parallelism: fewer subagents or concurrent requests.
- Switch long-running work to a cheaper/faster model.
- Add small delays between retries instead of hammering the API.
2 Free tier exhausted
- OpenRouter free models cap around 20 req/min and 200 req/day per model.
- Rotating across multiple free models extends the runway.
- Adding $10 in credits raises the daily free limit.
3 Balance-related rejection
- Top up the account; some providers report insufficient balance as 429 or 402.
- Set a budget cap so a runaway session cannot empty the balance.
- Check the usage page for the rejected request before changing config.
Agent-specific fixes
Claude Code
- Fix
- Wait for the limit window, top up the account, or switch to a cheaper model. In long sessions, lower CLAUDE_CODE_SUBAGENT_MODEL to a cheap model for subagent calls.
- Verify
- Retry `claude /status` and a short prompt after the window resets.
Codex CLI
- Fix
- Reduce parallelism (fewer subagents), switch to a faster model, or raise limits by adding credits.
- Verify
- Confirm the rejected request in the provider dashboard, then retry `codex exec "hi"`.
Claude Code vs Codex CLI at a glance
| Claude Code | Codex CLI | |
|---|---|---|
| Status codes | 429 / 402 / 529 | 429 / 402 / 529 |
| Balance check | Provider dashboard | Provider dashboard |
| Cheap model for subagents | CLAUDE_CODE_SUBAGENT_MODEL | model in config.toml |
Prevent it from happening again
- Set budget caps on the provider dashboard.
- Prefer cheaper models for routine tasks and keep frontier models for hard problems.
- Add retry-with-backoff to your workflow instead of instant retries.
Related errors
Related setup guides
Frequently asked questions
What are the OpenRouter free-tier limits?
Free models cap around 20 requests per minute and 200 requests per day per model. Adding $10 in credits raises the daily free limit.
Is 529 a rate limit?
529 means the provider is overloaded, not that your key is limited. Wait and retry; switching models or endpoints often helps.