Q&A · Updated
Codex degraded, rate limited or out of quota: what to do
When Codex returns 429, says you hit your usage limit, or slows down, it is usually the subscription usage window or rate limiting, and it recovers when the window resets. To skip the wait, use an API key: put it in the global ~/.codex/auth.json, point base_url in ~/.codex/config.toml at https://api.aicodewith.ai/chatgpt/v1, and pay per token from your balance. There is no public test for "degraded" output, so compare with a fixed model in a fresh session before drawing conclusions.
Symptoms
| Symptom | Likely cause | What to do |
|---|---|---|
| "You've hit your usage limit" | Subscription usage window used up | Wait for the reset, or switch to a pay-as-you-go API key |
429 Too Many Requests | Too many requests in a short time | Retry later, lower concurrency; the relay has rate limits too |
| Shorter, slower or worse answers | Long context, or model / reasoning settings changed | Check model and reasoning effort, compare in a fresh session |
401 Unauthorized | Wrong key, or auth.json still holds an old login | Put the full key from the dashboard in ~/.codex/auth.json |
Official vs relay
| Official subscription | API relay (AICodeWith) | |
|---|---|---|
| Quota | Subscription usage window | Pay per token; balance valid for 12 months, no monthly reset |
| When it runs out | Wait for reset or upgrade | Top up and continue |
| Rate limits | Official rate limits | Rate limited too; retry on 429 |
| Setup | Account login | Global auth.json and config.toml |
Minimal setup: point your global config at AICodeWith
Only the global config changes; project files stay as they are. Other tools: integration guides.
1. Create a key
Sign up, open API Keys in the dashboard and create a key. See how to get an API key.
2. Edit Codex's global config
Put the key straight into the global file
~/.codex/auth.json:~/.codex/auth.json{ "OPENAI_API_KEY": "sk-你的Key" }3. Point Codex at the relay
Add the provider in
~/.codex/config.toml. Codex uses the Responses API, so the path needs/chatgpt/v1; Codex itself requires it:~/.codex/config.tomlmodel_provider = "codex" model = "gpt-5.6-sol" [model_providers.codex] name = "codex" base_url = "https://api.aicodewith.ai/chatgpt/v1" wire_api = "responses" requires_openai_auth = true supports_websockets = false4. Verify
Open a new terminal, run
codexand ask anything. A normal reply means you are connected.
Channel tips
- Pay as you go, no monthly or yearly plan: top up a balance and pay per token used. The balance stays valid for 12 months and does not reset monthly.
- One model can run through several channels with different prices (discounts) and routes. New accounts have the recommended channels on by default.
- If one channel errors or slows down, switch to another channel for the same model in the dashboard. See the pricing page for current prices.
Get connected now
Sign up, create a key and edit your global config as shown above.
FAQ
Does Codex really get dumber?
There is no public standard for that. Fix the model and reasoning effort and compare in a fresh session first.
Will an API key stop all 429 errors?
No. The relay has rate limits as well; very high concurrency also returns 429, so retry later.
Why does base_url need /chatgpt/v1?
Codex uses the Responses API and needs this path. Most other tools take the bare domain.
Does the balance expire?
The balance stays valid for 12 months and does not reset monthly.
Which other tools work?
The same key works with Claude Code, OpenCode, Cline, Cursor and more; see the integration guides.
Updated: