Fix Codex CLI "exceeded retry limit, last status: 429"
When Codex CLI stops with "exceeded retry limit, last status: 429", tell a plan usage limit from an API rate limit, then wait and tune retries.
exceeded retry limit, last status: 429 Too Many Requests, request id: ...The server said "too many requests", and Codex resent the request until it ran out of retries. Unlike a 401 (Fix Codex CLI 401), your credentials are usually fine. What matters is which limit you hit.
[1] Check the version and how you are logged in. The kind of limit depends on the login type.
$ codex --versioncodex-cli 0.162.1$ codex login statusLogged in using ChatGPTWith an API key, the status line reads Logged in using an API key - *** (see the 401 article).
[2] Read the text printed before the 429. It is the fastest clue. Output posted in issue openai/codex#9135:
You've exceeded the rate limit, please slow down and try again after 60.616292 seconds.exceeded retry limit, last status: 429 Too Many Requests, request id: ...A "try again after N seconds" hint means a short-term rate limit. If you only see 429 repeating with no hint, go to steps 3 and 4 and check the limits yourself.
[3] On a ChatGPT login, check plan usage. Per the official pricing page, Plus and standard Business plans have a per-five-hour allowance, weekly limits may also apply, and local messages and cloud chats draw from the same allowance. Pro plans are described as having "no five-hour limit". Read your remaining amount and reset time on the usage dashboard, as the page advises. Plus and Pro users can buy extra credits instead of upgrading.
[4] On an API key, check the key's (project's) limits. The docs say Codex usage is billed at API rates and available models follow what your key can access. An API 429 is not only a rate limit. Besides rate limits (Rate limit reached for requests, slow_down "Your request rate increased too quickly."), the official error table lists exhausted prepaid credits (credit_balance_exhausted) and organization or project spend limits (organization_spend_limit_exceeded, project_spend_limit_exceeded) as 429. Waiting does not clear those; add credits or raise the limit. For a rate limit, response headers show what is left.
| Header | Meaning (official docs) |
|---|---|
Retry-After | minimum seconds to wait before retrying |
x-ratelimit-remaining-requests | requests left before the limit |
x-ratelimit-remaining-tokens | tokens left before the limit |
x-ratelimit-reset-requests / x-ratelimit-reset-tokens | time until that limit resets |
The docs also say not to retry quota, billing, or other errors that need action from you. Check your project's limits and billing state on the OpenAI platform dashboard.
[5] For a rate limit or the five-hour allowance, wait, and do not hammer retries. The docs note that failed requests count toward the per-minute limit, so resending continuously will not work. Wait at least the Retry-After or on-screen time. With no hint, run again at growing intervals (exponential backoff).
[6] Cut the request volume. Close other sessions or agents that share the same allowance and split large tasks. If you can switch models, try a lighter one with codex -m <model>. The docs consulted do not say how limits differ per model, so test the effect yourself.
[7] If you use a custom provider, review the retry settings. The config reference lists retry keys under model_providers.<id> in config.toml. It also says the built-in provider IDs (openai, ollama, lmstudio) are reserved and cannot be overridden, so this step does not apply to a ChatGPT login or the default OpenAI provider.
[model_providers.<id>]request_max_retries = 4 # HTTP request retries (documented default 4)stream_max_retries = 5 # retries after SSE stream interruptions (documented default 5)stream_idle_timeout_ms = 300000 # SSE idle timeout in ms (documented default 300000)<id> is the name of the provider table you defined. More retries do not raise the limit, so fix the cause in steps 1 to 4 first.
[8] The cause may be a service incident. Issue openai/codex#26034 was filed with the same wording. A maintainer called it an "active incident", later reported it "mitigated", and the issue was closed. If your limits and key look fine but others hit it at the same time, check the issue tracker and the OpenAI status page, then wait.
For authentication errors (401), see Fix Codex CLI 401.