OpenAI Codex Error Codes: A Quick Lookup for API, ChatGPT and Codex Messages (2026)
A quick lookup of OpenAI API, ChatGPT and Codex error messages. Each row gives the exact text, the likely cause in one line, where that answer comes from, and a link to the full fix.

This page lists the OpenAI Codex error codes and messages we have full guides for, across the OpenAI API, ChatGPT and Codex. Find the exact text you are seeing, read the likely cause, and open the full article for the fix. The “Basis” column tells you where each answer comes from: “Tested” means the full article shows output we got ourselves, and the other rows rely on OpenAI’s docs, the Codex source code or GitHub issues.
OpenAI API error codes
These errors come back from the API or from the official SDKs. OpenAI keeps the full list of HTTP codes in its error codes guide.
| Error message | Likely cause | Basis | Full guide |
|---|---|---|---|
401 Incorrect API key provided: sk-... | The key is wrong, was deleted, belongs to another organization or project, or an old key is still set in an environment variable. | Tested | Fix 401 Incorrect API key |
Missing bearer authentication in header | The request has no Authorization: Bearer header, so the key never reached OpenAI. | Tested | What we got with each bad key |
APIConnectionError with Illegal header value b'Bearer sk-... ' | The key has a trailing space or line break, and the Python SDK refuses to send it. | Tested | Check the key for hidden characters |
OpenAIError: Missing credentials | The SDK found no key at all, usually because OPENAI_API_KEY is not set in that shell or process. | Tested | Where the key is read from |
403 Country, region, or territory not supported (unsupported_country_region_territory) | The machine sending the request is in a location OpenAI does not support. Changing the key or retrying does not help. | Docs and forum reports | Fix the 403 |
429 Rate limit reached for requests | You sent more requests or tokens per minute than your limit allows. Waiting and retrying with backoff works. | Docs; SDK retries checked with a local mock | OpenAI API 429 explained |
429 with code insufficient_quota (or credit_balance_exhausted) | Your credit is used up or you hit a spend limit. Retrying will not fix it; add credit or raise the limit. | Docs; SDK retries checked with a local mock | Rate limit vs quota |
If a 401 starts right after a key was pushed to GitHub or pasted somewhere public, OpenAI may have disabled it on purpose. OpenAI says it disables keys it finds on the public internet. Follow our leaked API key steps before you create a new one.
ChatGPT errors
| Error message | Likely cause | Basis | Full guide |
|---|---|---|---|
Payment was not approved | The bank or card issuer declined the charge, or the 3D Secure check was not finished. OpenAI says it usually does not get the decline reason, so your bank is the fastest place to ask. | OpenAI help pages | The official fix order |
Codex errors (CLI, app and VS Code)
| Error message | Likely cause | Basis | Full guide |
|---|---|---|---|
Selected model is at capacity. Please try a different model. | OpenAI is short on servers for that model (server_is_overloaded). It is not your quota. Wait a few minutes or switch models. | Codex source and a maintainer’s posts | What “at capacity” means |
You've hit your usage limit | Your ChatGPT plan’s Codex allowance for the current window is used up. Run /status to see when it resets. | Codex source | Codex 429 messages |
Quota exceeded. Check your plan and billing details. | A billing problem: credit is used up or a spend limit was hit. Retrying does not help. | Codex source | Codex 429 messages |
exceeded retry limit, last status: 429 Too Many Requests | A plain rate limit. Codex already retried and gave up. Wait, and run fewer sessions in parallel. | Codex source | Codex 429 messages |
To use Codex with your ChatGPT plan, upgrade to Plus | Your plan does not include Codex. | Codex source | Codex 429 messages |
Codex could not start its user interface | A bug in Codex VS Code extension 26.1021.22027. Rolling back to 26.1007.21434 fixes it for most people. | GitHub issue; we compared the two packages | Roll back the extension |
OpenAI Codex error codes not in this table
If the message mentions Claude, Anthropic or a 529, it is not an OpenAI error. Use our Claude Code errors list instead. When several OpenAI errors appear at once, check status.openai.com before you change any settings.