Codex 401 “Incorrect API Key” Error: Is It the September 25 Outage or Your Setup? (2026)
Short answer: If Codex threw a 401 “Incorrect API key” error around 10:58–11:54 PM UTC on September 25, 2026, that was OpenAI’s own outage — the fix at the time was logging in with an API key instead of ChatGPT auth. If you’re seeing the same error today, it’s almost certainly a stale credential in your local ~/.codex/auth.json file, not a repeat outage, and the fix is a re-login, not a wait.
Two different problems produce the exact same error message, which is exactly why this one keeps confusing people. OpenAI had a real, confirmed outage. But the 401 “Incorrect API key provided” error has also been showing up independently, on its own, for weeks — tied to nothing but a bad local credential. Telling the two apart takes about thirty seconds once you know where to look.
Jump to a Section
- What Actually Happened on September 25, 2026?
- Is Your 401 Error the Outage or Your Own Setup?
- How Do You Fix a Local 401 “Incorrect API Key” Error?
- What Actually Makes a Stored Key Go Bad in the First Place?
- What Do You Do If OpenAI’s Systems Are Actually Down?
- Where People Waste Time on This Error
- How Do You Avoid Getting Stuck Next Time?
- Tips
- Warnings
- FAQ
- Sources
What Actually Happened on September 25, 2026?
OpenAI’s own status page logged an incident titled “Issues with Codex” running from 10:58 PM to 11:54 PM UTC on September 25, 2026 — a confirmed 56-minute outage. Codex Web, the Codex API, the CLI, and the VS Code extension were all affected at once, which is why it hit so many workflows simultaneously rather than one specific client.
When I checked the incident record directly, OpenAI’s own mitigation note during the outage was specific: “Login via API key will unblock access at this time” — meaning ChatGPT-based sign-in was the broken path, while API-key authentication kept working throughout.
Is Your 401 Error the Outage or Your Own Setup?
Check the date and the scope first. The September 25 outage window is closed — OpenAI’s status page confirms all impacted services fully recovered by 11:54 PM UTC that night. If you’re seeing a 401 error after that window, or if it’s affecting only your machine while everything else works, it’s a local credential issue, not a repeat of the incident.
A second tell: an outage-level 401 hits everyone at once and shows up on OpenAI’s public status page. A local one is isolated to your device and tends to follow you across restarts until you clear the stored credential — that pattern alone is usually enough to tell them apart.
| Signal | OpenAI-Side Outage | Local Credential Issue |
|---|---|---|
| Scope | Affects many users at once | Isolated to one device or account |
| status.openai.com | Shows an active incident | Shows all services operational |
| Persistence | Resolves once OpenAI mitigates | Persists across restarts until you fix the credential |
| Fix | Switch login method (API key) temporarily | Clear and re-issue the stored credential |

How Do You Fix a Local 401 “Incorrect API Key” Error?
- Check what credential is actually stored. Run
cat ~/.codex/auth.jsonto see the key Codex is reading — this is usually where the mismatch lives. - Look for a stale, revoked, or cross-account key. A key that belongs to a different account or organization, or one that’s been deactivated, produces this exact 401 even though it “looks” valid in your config.
- Log out before you touch anything else. Run
codex logoutto clear the stored credential rather than editing the file by hand first. - Re-authenticate with a fresh key. Run
printenv OPENAI_API_KEY | codex login --with-api-keyto log in cleanly with a key you know is current. - Watch for trailing newlines, not spaces. A trailing space in a pasted key is harmless; a trailing newline in the stored value is a common, easy-to-miss cause of this error.
When I compared the GitHub issue reports against the fix steps above, the pattern was consistent across Windows and CLI users alike — the credential file was the actual point of failure in nearly every case, not the network or the account itself.
What Actually Makes a Stored Key Go Bad in the First Place?
Four scenarios account for most of the reports tracked around this issue:
- The key was revoked or deleted on OpenAI’s side, but Codex still has the old value cached locally.
- The key belongs to a different account or organization than the one you’re currently signed into — this is common if you’ve switched between a personal and a work account.
- The key never worked — a copy-paste error at setup time that included an extra character or dropped one, and nothing ever flagged it until the request actually hit the backend.
- A trailing newline got saved into the config instead of a clean string, which reads as a different key to the backend even though it displays identically in a terminal.
None of these are OpenAI-side problems — they’re all local state that a clean logout and re-login clears in under a minute.
What Do You Do If OpenAI’s Systems Are Actually Down?
If the error is genuinely outage-related — meaning it started suddenly, affects multiple people, and lines up with OpenAI’s own status page — switching your login method is the one workaround that’s actually been confirmed to work. During the September 25 incident, logging in via API key kept working while ChatGPT-based auth was broken, so that’s the first thing to try rather than restarting repeatedly.
Outside of that, there’s no local fix for a server-side outage. Check status.openai.com directly rather than trusting third-party trackers, which can lag behind or misreport scope.
Where People Waste Time on This Error
The biggest time sink is treating every 401 as an outage and just waiting it out.
Most 401s reported in the weeks around this incident weren’t the outage at all — they were the same stale-credential problem showing up independently, and a five-minute status-page check would have ruled that out immediately.
The second trap: hunting for a typo in the pasted API key when the real issue is a trailing newline character, which looks identical to a correctly pasted key in most terminals.
This part trips up a lot of people who assume “the key looks right” means the stored value is actually right.
How Do You Avoid Getting Stuck Next Time?
Keep a second authentication method ready before you need it, not after. If you normally sign in with ChatGPT auth, know how to switch to an API key login in advance — that’s the exact workaround that worked during this outage, and figuring it out cold during an incident costs more time than testing it once in advance.
Bookmark status.openai.com directly instead of relying on search results or social media chatter, which tend to lag the official incident timeline by several minutes.
Tips
- Run
cat ~/.codex/auth.jsonbefore doing anything else when you see this error — it tells you in seconds whether the credential itself is the problem. - Keep an API key login path tested and ready as a fallback for ChatGPT-based auth, since that’s the specific method that stayed working during the September 25 outage.
- Check status.openai.com’s incident history directly if you’re unsure whether an error is widespread or local to your machine.
Warnings
- Don’t edit
auth.jsonby hand as your first move — logging out and back in withcodex login --with-api-keyis cleaner and avoids leaving a half-edited config file. - A trailing newline in a pasted API key is invisible in most terminal displays; re-paste the key manually rather than assuming a visual check is enough.
FAQ
Did OpenAI say what caused the September 25 outage?
OpenAI’s public status page confirmed the incident and its 56-minute timeline but did not publish a detailed root-cause explanation beyond noting the mitigation path of logging in via API key.
Will restarting my computer fix a local 401 error?
Sometimes, because a restart can clear a stuck local session state, but it’s not a reliable fix. Checking and replacing the stored credential in ~/.codex/auth.json addresses the actual cause more directly.
Does this affect regular ChatGPT, or just Codex?
The September 25 outage and the ongoing local 401 issue are both specific to Codex (Web, API, CLI, and the VS Code extension) — reports from that day describe regular ChatGPT chat continuing to function normally.
Sources
- OpenAI Status — Issues with Codex (September 25, 2026 Incident)
- ofox.ai — Codex CLI 401 Unauthorized: Tested Causes and Fixes
- GitHub — openai/codex Issue #48274: 401 API Error
🔗 Related guides
Fact-checked based on OpenAI’s official status page and public GitHub issue reports as of September 29, 2026. If you’re still seeing this error, check status.openai.com directly for the current incident status before assuming either cause applies.
