You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting. We're aware of the problem. Investigation is underway.
Reacted by Joel Baranick, caixukun-jinitaimei, LK-Webservices e.K., vishalm3416, Aladin Alaily, David Voskanyan, Marek, Sri Anumakonda, rahidz, Gardner Bickford and 20 more
Confirmed recovered from Jakarta (cf-ray -CGK) at 23:54 UTC — codex exec succeeded in 15 s (npm 0.157.0, ChatGPT Pro auth). Before mitigation the same command failed with the identical sk-svcac…fvMA 401 across desktop 0.158.0-alpha.2 and npm 0.157.0, models gpt-6-astra and gpt-5.5, clean env; codex doctor showed stored API key false / ChatGPT tokens true and the client log showed auth_recovery_outcome="recovery_succeeded" followed by the 401, so the rejection was upstream. Request IDs: 7d965c23-a9f4-48f9-89ad-07aa2523c1e7, cf4a35d6-6afb-46ed-978b-72411ae6ff1d, b8127fdb-0599-472d-b95e-eed33b8fcdb3.
Deep dive from an instrumented client: where the key actually lives, what the websocket path does, and a client-side refresh storm nobody has mentioned yet
I pulled this apart from a Linux client (codex-cli 0.157.0, ChatGPT login, Pro plan) using Codex's own logs_*.sqlite telemetry, the session rollouts, a memory scan of the live processes, and direct HTTP + websocket probes against chatgpt.com/backend-api/codex/responses. Everything below is reproducible; the probe scripts are at the bottom.
TL;DR
Client refresh storm (new, actionable, filed separately as ChatGPT auth: every retry attempt runs a full reload+refresh auth recovery, so one failed turn triggers 6 oauth/token refreshes and 18 /responses calls #48303). Because the backend forwarded a 401 instead of a 5xx, every failed turn on this client produced 18 /responses requests and 6 successful auth.openai.com/oauth/token refreshes, each rotating the refresh token. One user typing "hello" three times = 36 token refreshes in 6.5 minutes, none of which could ever succeed because the failing credential was never the user's. I found this while counting requests to work out where the key lived. Details and the exact code path in section 4.
Websocket path hides the failure completely (new). Same request over websocket: the server sends codex.rate_limits with allowed: true, then codex.response.metadata with freshly minted turn state, then a bare close 1011 with no error event. The client cannot tell it from a network blip, so everyone saw "Reconnecting 1/5 … 5/5" before the HTTP fallback finally showed the real error. Section 3.
The status code choice is what armed the client. The 401 body is the platform API's error object forwarded verbatim (code: invalid_api_key, "find your API key at platform.openai.com", nonsense for a ChatGPT-auth user). The client treats 401 as "refresh and retry". Mapping an upstream auth failure to 502/503 with a sanitized body would have prevented the storm and would stop leaking the internal key's prefix, last 4 chars and exact length to every user. Section 5.
Where the key lives, for the record. The sk-svcacct…fvMA key is OpenAI's own service-to-service credential inside the Codex backend. It never exists on the client (memory scan of all four live processes: masked copies only). Same 167-char key, same suffix, reported simultaneously from ORD, SJC, SEA, LAX, FRA, MAD. The 401 response itself carries x-codex-plan-type, usage headers and a fresh x-codex-turn-state, so the user's JWT was accepted before the upstream call failed. Section 1.
1. Who holds the key
Kept short since the root cause is already known on your side. It is here because section 4 depends on it.
Client telemetry on every failing /responses call:
No sk- key exists on this machine: not in auth.json (OPENAI_API_KEY: null), env, config, dotfiles, or the environment of the running codex processes. A memory scan of all four live Codex processes (app-server daemon, pid loop, code-mode host, TUI) found 129 copies of the masked string sk-svcac***…fvMA (71 in the daemon, 58 in the TUI: parsed 401 bodies sitting on the heap) and zero unmasked copies. The only other hit is the static sk-svcacct- prefix table in the binary's rodata (codex-rs/network-proxy/src/credential_broker/providers/openai.rs), which is a classifier, not a key.
Direct probe with my own ChatGPT token (curl, same headers Codex sends) returns:
HTTP/2 401
x-codex-plan-type: pro
x-codex-primary-used-percent: <unchanged before/after outage>
x-codex-turn-state: gAAAAAB… (Fernet; embedded timestamp == response Date header)
x-oai-request-id: 39c52de5-22c2-4371-abbc-e35d0d9a14ac
x-openai-proxy-wasm: v0.1
cf-ray: a40dc7276a631aeb-ORD
{"error":{"message":"Incorrect API key provided: sk-svcac***…fvMA. You can find your API key at https://platform.openai.com/account/api-keys.","type":"invalid_request_error","param":null,"code":"invalid_api_key"}}
Those x-codex-* headers can only be populated after the backend has authenticated my JWT and looked up my account. So the order inside that single 401 is: user auth OK → plan/quota resolved → turn state minted → backend's upstream call rejected → upstream error body forwarded with the upstream status code. The client's bearer is a JWT and the error names an sk- key; the client can tell those apart, which is what the fix in section 4 relies on.
Side note: the weekly-usage percentage did not move across ~150 failed requests on this client, so failed turns were not charged.
2. Timeline from this client (UTC)
22:46:09 last successful /responses (ChatGPT auth), mid-turn
22:46:13.078 first 401, cf-ray a40d905a5cae071e-ORD, request id c56787f3-9403-4b24-937d-24ef88df9bf1
22:46:32 websocket retries exhausted → "falling back to HTTP" (same 401 there)
22:52:47 last 401 before I stopped typing
23:23:40 and 23:31:07 direct probes: still 401
23:35:44 websocket probe: still failing (details below)
status.openai.com incident 01M3DCNWMW57HYK8FJ5FBFPA39: opened 22:58 (Identified, "internal issue"), 23:19 "Login via API key will unblock access", 23:34 "root cause identified, moving towards mitigation", 23:45 "mitigation applied, monitoring recovery"
23:37:55–23:38:38 one more turn from this client, still before mitigation: 401 again, with 2 more oauth/token refreshes inside 40 s (section 4)
23:51:50 etraut-openai in this thread: "mitigated, recovery rolling out through clusters"
23:57:51 this client recovered: a codex exec turn completed normally, the first successful /responses since 22:46:09. Status page shows Resolved.
The first public report's ray (a40d8b07…-SJC) predates my first failure by roughly 3–4 minutes by ray-ID arithmetic, so onset was global around 22:42–22:46Z.
3. What the websocket path actually does
@bmruszaj noted above (23:20Z) that the websocket transport masks the 401 and only the HTTPS fallback exposes it. Here is what the server actually sends before it closes. Raw websocket session with the same token, sending a normal response.create:
So over websocket the backend explicitly says allowed: true, hands out turn state, and then closes with a bare 1011 and no error event. The client maps Message::Close to ApiError::Stream("websocket closed by server before response.completed") (codex-rs/codex-api/src/endpoint/responses_websocket.rs), which is classified as retryable. That is why everyone sees "Reconnecting 2/5 … 5/5" before the HTTP fallback finally shows the real error. HTTP over-shares (leaks the upstream body); websocket under-shares (no error at all). Both hide the actual condition, which is "backend's upstream credential is invalid".
4. The refresh storm (found while tracking this down; filed separately as #48303)
This is not the outage. It is what the client did in response to the outage, and I only noticed because I was counting requests to work out where the key lived. It has its own issue (#48303) so it survives this one being closed; the short version is here because the numbers are from the same logs.
Per failed user turn on this client, from logs_*.sqlite:
Turn
HTTP /responses → 401
websocket connects
oauth/token refreshes (all 200)
turn in flight at onset
18
6
6
"ok what happened"
18
0
6
"uhh hello"
18
0
6
"…"
18
0
6
each of 2 subagent turns
18
1–3
6
36 successful token refreshes between 22:46:13 and 22:52:45 from one idle user, every one followed by another 401 (auth_recovery_followup_success="false" auth_recovery_followup_status="401" × 36). auth.json was rewritten at 22:52:45 with a rotated refresh token.
Why exactly 18 and 6:
codex-rs/core/src/responses_retry.rs: on error, retry up to max_retries (5) with backoff, then try_switch_fallback_transport, reset retries to 0, and retry 5 more times on HTTP. 6 attempts per transport.
codex-rs/core/src/client.rsstream_responses_api / stream_responses_websocket: each attempt constructs a freshauth_manager.unauthorized_recovery(). On a 401 that passes provider.is_recoverable_auth_error, handle_unauthorized walks the managed state machine Reload → RefreshToken → Done (codex-rs/login/src/auth/manager.rs), retrying the request after each step. That is 3 HTTP requests and 1 real token refresh per attempt.
Once recovery is exhausted, the original UnexpectedStatus(401) escapes, and codex-rs/protocol/src/error.rsretry_delay() lists UnexpectedStatus(_) as retryable → next attempt → fresh recovery → another refresh.
6 attempts × (1 + reload-retry + refresh-retry) = 18 requests, 6 refreshes, per turn, per client. Across the whole install base during a backend outage, that is a self-inflicted load spike on auth.openai.com plus a refresh-token rotation on every affected account, with zero chance of success because the failing credential was never the user's.
5. Suggested fixes
Backend:
Map an upstream invalid_api_key (or any upstream 401/403) to 502/503 with a sanitized body. Never forward the upstream error text: it leaks the internal key's prefix, last 4 chars and exact length, and points ChatGPT users at the API-platform key page.
Over websocket, emit an error event (the client already parses type: "error" frames) before closing, instead of a bare 1011.
Client:
Treat a 401 whose body has code: invalid_api_key while auth_mode=Chatgpt as non-recoverable: the user's bearer is a JWT, so that error cannot be about their credential.
Hold oneUnauthorizedRecovery per turn (or per client session) rather than per attempt, so a token refresh runs at most once per turn.
After recovery is exhausted, make the 401 terminal (RetryLimit/fatal) rather than a backoff-retryable UnexpectedStatus.
Consider treating websocket close 1011 with no prior error event as "switch to HTTP now" rather than 5 reconnects.
same issue...
Title:
Codex Desktop returns 401 Unauthorized / Incorrect API key after ChatGPT desktop update
Summary:
Codex in the ChatGPT Windows desktop application stopped working immediately after I used "Check for Updates" and installed the available ChatGPT desktop update.
Prior to the update, Codex was working normally.
After the update, every Codex request fails with:
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac********...
Codex then attempts to reconnect several times and continues returning the same 401 error.
Expected Result:
Codex should authenticate using the existing ChatGPT account/session and process the request normally, as it did prior to the desktop application update.
Frequency:
100% reproducible since the desktop update.
The issue occurs with both existing Codex conversations and subsequent attempts to send new messages.
Impact:
Codex Desktop is completely unusable. No Codex requests can be completed because every request fails authentication.
Troubleshooting Already Performed:
Completely signed out of the ChatGPT desktop application.
Closed and reopened the application.
Signed back into the same ChatGPT account.
Retested Codex.
Result: Same 401 Unauthorized error.
Performed a Windows application reset:
Windows Settings > Apps > Installed apps > ChatGPT > Advanced options > Reset
Relaunched ChatGPT.
Signed back into the account.
Retested Codex.
Result: Same 401 Unauthorized error.
I also tested whether the standalone Codex CLI was involved by running:
codex login status
PowerShell returned:
codex: The term 'codex' is not recognized as a name of a cmdlet, function, script file, or executable program.
This confirms I am not using a locally installed Codex CLI for these requests. The failure is occurring within the ChatGPT Windows desktop application's Codex functionality.
Important Observation:
I did not manually configure or change an OpenAI API key before this problem occurred.
The 401 error references an "sk-svcac..." credential and directs me to the OpenAI API key page, despite my using Codex through the authenticated ChatGPT desktop application rather than manually configuring an API key.
The problem began immediately after updating the ChatGPT desktop application.
Example Error Details:
HTTP status:
401 Unauthorized
An earlier occurrence also produced:
cf-ray: a40dc485ce407803-SJC
request id: 1442f75c-4b93-48d1-b37f-f9d34657c308
Additional Notes:
The failure persists across application restarts.
Signing out and signing back in does not refresh/fix the credential being used by Codex.
Resetting the Windows application does not fix the credential.
The error continues to reference the same type of sk-svcac credential.
Normal ChatGPT functionality remains accessible; the failure is specifically occurring when Codex attempts to call /backend-api/codex/responses.
Because the issue began immediately following the desktop application update, this appears potentially related to authentication/session handling in the updated Windows desktop client.
Update: working again for me — Windows / ChatGPT Pro
Following up on my earlier report: Codex is now working again in my Windows desktop environment with my ChatGPT account. The previously blocked task resumed, and the repeated 401 Unauthorized — Incorrect API key provided error is no longer preventing me from continuing.
I have not established the root cause or which change restored access. This confirms recovery for my account/environment, not that the issue is resolved for every affected user.
Additional Windows desktop corroboration with local timing and network evidence.
Environment
Surface Pro 8, Windows 11
Codex desktop AppX package currently reports 26.924.1866.0
ChatGPT account sign-in; no user-supplied API key involved
Observed across two independent long-running chats
Three consecutive turns failed with the same 401 Unauthorized / Incorrect API key response from https://chatgpt.com/backend-api/codex/responses:
2026-09-25 23:03:15 UTC (first affected chat), after approximately 9m40s
request id: d6a6eccf-0d81-47d5-844d-6765e1ec2cba
cf-ray: a40db6b3cf757d81-SOF
2026-09-25 23:13:28 UTC (same chat), after approximately 9m50s
2026-09-25 23:24:13 UTC (a separate Codex chat), after approximately 9m28s
request id: 2ac32735-6bf5-483f-8309-c165b434ddbc
cf-ray: a40dd54dcaf65275-SOF
The UI displayed Reconnecting before eventually surfacing the HTTP 401. Both chats later resumed normally and retained their history without changing any user API key.
Correlation with the official outage
OpenAI incident opened: 22:58:48 UTC
Status update reporting elevated errors: 23:03:04 UTC
First local 401 above: 23:03:15 UTC, only 11 seconds after that update
Windows WLAN-AutoConfig, NCSI, NetworkProfile, DHCP and System logs show no Wi-Fi disconnect at 23:03, 23:13 or 23:24 UTC. The tablet had normal Wi-Fi traffic. A separate one-second Wi-Fi security re-authentication occurred at 23:31:25–23:31:26 UTC, after all three failures, so it cannot explain them.
This corroborates a backend/service-credential outage rather than a user API-key or local-network problem. It also demonstrates the UX problem on Windows: websocket reconnect attempts look like a local connectivity failure, followed by a misleading API-key instruction for ChatGPT-authenticated users.
This may help determine whether the same authentication issue also affects the VS Code IDE extension and whether usage-limit recovery/session resumption is relevant.
Activity
gdwnldsKSC commentedon Sep 25, 2026
Probably an outage. Just hit it myself.
github-actions commentedon Sep 25, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
lifeinink commentedon Sep 25, 2026
I'm also hitting this issue. My npm release is current.
nadeemkhoury commentedon Sep 25, 2026
same here
sagabravo commentedon Sep 25, 2026
same problem here
etraut-openai commentedon Sep 25, 2026
Thanks for reporting. We're aware of the problem. Investigation is underway.
gdwnldsKSC commentedon Sep 25, 2026
https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39
Status just lit up.
131 remaining items
karitet commentedon Sep 25, 2026
Independent reproduction on two separate macOS machines on 26 Sep 2026, shortly after 01:00 CEST.
Observed failure
Checks on one affected macOS machine
I also checked for relevant environment variables with:
No
OPENAI_*orCODEX_*variables were returned.The same 401 /
sk-svcac...failure occurs independently on a second macOS machine, which makes a machine-specific configuration issue less likely.OpenAI's status page currently confirms an Issues with Codex outage affecting Codex services:
https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39
No full credential, OAuth token, hostname, internal machine name, account ID, or local path is included here.
SweetLuvianto commentedon Sep 25, 2026
Confirmed recovered from Jakarta (cf-ray
-CGK) at 23:54 UTC —codex execsucceeded in 15 s (npm 0.157.0, ChatGPT Pro auth). Before mitigation the same command failed with the identicalsk-svcac…fvMA401 across desktop 0.158.0-alpha.2 and npm 0.157.0, models gpt-6-astra and gpt-5.5, clean env;codex doctorshowedstored API key false / ChatGPT tokens trueand the client log showedauth_recovery_outcome="recovery_succeeded"followed by the 401, so the rejection was upstream. Request IDs:7d965c23-a9f4-48f9-89ad-07aa2523c1e7,cf4a35d6-6afb-46ed-978b-72411ae6ff1d,b8127fdb-0599-472d-b95e-eed33b8fcdb3.Incorrect API key(sk-svcac...) while signed in with ChatGPT #48298 as a duplicate of this issueul0gic commentedon Sep 26, 2026
Deep dive from an instrumented client: where the key actually lives, what the websocket path does, and a client-side refresh storm nobody has mentioned yet
I pulled this apart from a Linux client (codex-cli 0.157.0, ChatGPT login, Pro plan) using Codex's own
logs_*.sqlitetelemetry, the session rollouts, a memory scan of the live processes, and direct HTTP + websocket probes againstchatgpt.com/backend-api/codex/responses. Everything below is reproducible; the probe scripts are at the bottom.TL;DR
/responsesrequests and 6 successfulauth.openai.com/oauth/tokenrefreshes, each rotating the refresh token. One user typing "hello" three times = 36 token refreshes in 6.5 minutes, none of which could ever succeed because the failing credential was never the user's. I found this while counting requests to work out where the key lived. Details and the exact code path in section 4.codex.rate_limitswithallowed: true, thencodex.response.metadatawith freshly minted turn state, then a bare close 1011 with noerrorevent. The client cannot tell it from a network blip, so everyone saw "Reconnecting 1/5 … 5/5" before the HTTP fallback finally showed the real error. Section 3.code: invalid_api_key, "find your API key at platform.openai.com", nonsense for a ChatGPT-auth user). The client treats 401 as "refresh and retry". Mapping an upstream auth failure to 502/503 with a sanitized body would have prevented the storm and would stop leaking the internal key's prefix, last 4 chars and exact length to every user. Section 5.sk-svcacct…fvMAkey is OpenAI's own service-to-service credential inside the Codex backend. It never exists on the client (memory scan of all four live processes: masked copies only). Same 167-char key, same suffix, reported simultaneously from ORD, SJC, SEA, LAX, FRA, MAD. The 401 response itself carriesx-codex-plan-type, usage headers and a freshx-codex-turn-state, so the user's JWT was accepted before the upstream call failed. Section 1.1. Who holds the key
Kept short since the root cause is already known on your side. It is here because section 4 depends on it.
Client telemetry on every failing
/responsescall:No
sk-key exists on this machine: not inauth.json(OPENAI_API_KEY: null), env, config, dotfiles, or the environment of the runningcodexprocesses. A memory scan of all four live Codex processes (app-server daemon, pid loop, code-mode host, TUI) found 129 copies of the masked stringsk-svcac***…fvMA(71 in the daemon, 58 in the TUI: parsed 401 bodies sitting on the heap) and zero unmasked copies. The only other hit is the staticsk-svcacct-prefix table in the binary's rodata (codex-rs/network-proxy/src/credential_broker/providers/openai.rs), which is a classifier, not a key.Direct probe with my own ChatGPT token (curl, same headers Codex sends) returns:
Those
x-codex-*headers can only be populated after the backend has authenticated my JWT and looked up my account. So the order inside that single 401 is: user auth OK → plan/quota resolved → turn state minted → backend's upstream call rejected → upstream error body forwarded with the upstream status code. The client's bearer is a JWT and the error names ansk-key; the client can tell those apart, which is what the fix in section 4 relies on.Side note: the weekly-usage percentage did not move across ~150 failed requests on this client, so failed turns were not charged.
2. Timeline from this client (UTC)
/responses(ChatGPT auth), mid-turncf-ray a40d905a5cae071e-ORD, request idc56787f3-9403-4b24-937d-24ef88df9bf101M3DCNWMW57HYK8FJ5FBFPA39: opened 22:58 (Identified, "internal issue"), 23:19 "Login via API key will unblock access", 23:34 "root cause identified, moving towards mitigation", 23:45 "mitigation applied, monitoring recovery"oauth/tokenrefreshes inside 40 s (section 4)codex execturn completed normally, the first successful/responsessince 22:46:09. Status page shows Resolved.The first public report's ray (
a40d8b07…-SJC) predates my first failure by roughly 3–4 minutes by ray-ID arithmetic, so onset was global around 22:42–22:46Z.3. What the websocket path actually does
@bmruszaj noted above (23:20Z) that the websocket transport masks the 401 and only the HTTPS fallback exposes it. Here is what the server actually sends before it closes. Raw websocket session with the same token, sending a normal
response.create:So over websocket the backend explicitly says
allowed: true, hands out turn state, and then closes with a bare 1011 and noerrorevent. The client mapsMessage::ClosetoApiError::Stream("websocket closed by server before response.completed")(codex-rs/codex-api/src/endpoint/responses_websocket.rs), which is classified as retryable. That is why everyone sees "Reconnecting 2/5 … 5/5" before the HTTP fallback finally shows the real error. HTTP over-shares (leaks the upstream body); websocket under-shares (no error at all). Both hide the actual condition, which is "backend's upstream credential is invalid".4. The refresh storm (found while tracking this down; filed separately as #48303)
This is not the outage. It is what the client did in response to the outage, and I only noticed because I was counting requests to work out where the key lived. It has its own issue (#48303) so it survives this one being closed; the short version is here because the numbers are from the same logs.
Per failed user turn on this client, from
logs_*.sqlite:/responses→ 401oauth/tokenrefreshes (all 200)36 successful token refreshes between 22:46:13 and 22:52:45 from one idle user, every one followed by another 401 (
auth_recovery_followup_success="false" auth_recovery_followup_status="401"× 36).auth.jsonwas rewritten at 22:52:45 with a rotated refresh token.Why exactly 18 and 6:
codex-rs/core/src/responses_retry.rs: on error, retry up tomax_retries(5) with backoff, thentry_switch_fallback_transport, reset retries to 0, and retry 5 more times on HTTP. 6 attempts per transport.codex-rs/core/src/client.rsstream_responses_api/stream_responses_websocket: each attempt constructs a freshauth_manager.unauthorized_recovery(). On a 401 that passesprovider.is_recoverable_auth_error,handle_unauthorizedwalks the managed state machineReload → RefreshToken → Done(codex-rs/login/src/auth/manager.rs), retrying the request after each step. That is 3 HTTP requests and 1 real token refresh per attempt.UnexpectedStatus(401)escapes, andcodex-rs/protocol/src/error.rsretry_delay()listsUnexpectedStatus(_)as retryable → next attempt → fresh recovery → another refresh.6 attempts × (1 + reload-retry + refresh-retry) = 18 requests, 6 refreshes, per turn, per client. Across the whole install base during a backend outage, that is a self-inflicted load spike on
auth.openai.complus a refresh-token rotation on every affected account, with zero chance of success because the failing credential was never the user's.5. Suggested fixes
Backend:
invalid_api_key(or any upstream 401/403) to 502/503 with a sanitized body. Never forward the upstream error text: it leaks the internal key's prefix, last 4 chars and exact length, and points ChatGPT users at the API-platform key page.errorevent (the client already parsestype: "error"frames) before closing, instead of a bare 1011.Client:
code: invalid_api_keywhileauth_mode=Chatgptas non-recoverable: the user's bearer is a JWT, so that error cannot be about their credential.UnauthorizedRecoveryper turn (or per client session) rather than per attempt, so a token refresh runs at most once per turn.RetryLimit/fatal) rather than a backoff-retryableUnexpectedStatus.errorevent as "switch to HTTP now" rather than 5 reconnects.Repro (websocket probe)
Environment: codex-cli 0.157.0, Debian (Linux 6.12), ChatGPT login (Pro), no API key configured anywhere,
[agents] enabled = true.tennysonmilesperhour commentedon Sep 26, 2026
Same issue here, same key suffix (sk-svcac…fvMA).
Error: unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac…fvMA
URL: https://chatgpt.com/backend-api/codex/responses
Started: 2026-09-25 22:41:30 UTC, every request since
Request IDs:
43688cb1-926e-4366-aff9-5230664ed9a3 (first failure)
6a440474-4518-4ffd-a93b-150fc02a2390
d87a66cd-66ef-4953-84cb-a75c83073207
Jadabo3 commentedon Sep 26, 2026
same issue...
Title:
Codex Desktop returns 401 Unauthorized / Incorrect API key after ChatGPT desktop update
Summary:
Codex in the ChatGPT Windows desktop application stopped working immediately after I used "Check for Updates" and installed the available ChatGPT desktop update.
Prior to the update, Codex was working normally.
After the update, every Codex request fails with:
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac********...
The failing request is being sent to:
https://chatgpt.com/backend-api/codex/responses
Codex then repeatedly attempts to reconnect (for example, "Reconnecting 1/5" through "Reconnecting 5/5") and ultimately remains unusable.
Environment:
Steps to Reproduce:
Actual Result:
Codex fails to process the request and displays:
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac********...
You can find your API key at https://platform.openai.com/account/api-keys
url: https://chatgpt.com/backend-api/codex/responses
Codex then attempts to reconnect several times and continues returning the same 401 error.
Expected Result:
Codex should authenticate using the existing ChatGPT account/session and process the request normally, as it did prior to the desktop application update.
Frequency:
100% reproducible since the desktop update.
The issue occurs with both existing Codex conversations and subsequent attempts to send new messages.
Impact:
Codex Desktop is completely unusable. No Codex requests can be completed because every request fails authentication.
Troubleshooting Already Performed:
Completely signed out of the ChatGPT desktop application.
Closed and reopened the application.
Signed back into the same ChatGPT account.
Retested Codex.
Result: Same 401 Unauthorized error.
Performed a Windows application reset:
Windows Settings > Apps > Installed apps > ChatGPT > Advanced options > Reset
Relaunched ChatGPT.
Signed back into the account.
Retested Codex.
Result: Same 401 Unauthorized error.
I also tested whether the standalone Codex CLI was involved by running:
codex login status
PowerShell returned:
codex: The term 'codex' is not recognized as a name of a cmdlet, function, script file, or executable program.
This confirms I am not using a locally installed Codex CLI for these requests. The failure is occurring within the ChatGPT Windows desktop application's Codex functionality.
Important Observation:
I did not manually configure or change an OpenAI API key before this problem occurred.
The 401 error references an "sk-svcac..." credential and directs me to the OpenAI API key page, despite my using Codex through the authenticated ChatGPT desktop application rather than manually configuring an API key.
The problem began immediately after updating the ChatGPT desktop application.
Example Error Details:
HTTP status:
401 Unauthorized
Endpoint:
https://chatgpt.com/backend-api/codex/responses
Error:
Incorrect API key provided: sk-svcac********...
Latest captured request information:
cf-ray: a40ddc015fb48f74-SJC
request id: 4c43b244-ba96-45b4-b320-f1ceb73010a1
An earlier occurrence also produced:
cf-ray: a40dc485ce407803-SJC
request id: 1442f75c-4b93-48d1-b37f-f9d34657c308
Additional Notes:
Screenshots are available showing:
matheusfmlinhares commentedon Sep 26, 2026
I can reproduce this issue on Linux/WSL with Codex CLI 0.157.0.
Additional A/B evidence that may help isolate the regression:
codex login status->Logged in using ChatGPTOPENAI_API_KEY-> unsetCODEX_API_KEY-> unsetOPENAI_ACCESS_TOKEN-> unsetcodex doctor --json->overallStatus: okauth.credentials->okauth_mode="Chatgpt"andrecovery_exhaustedCodex CLI 0.157.0:
sk-svcac...credentialControl test against the same endpoint using the ChatGPT access token from
auth.json:Most importantly, using the already-installed Codex CLI 0.156.1 in the same environment, with the same ChatGPT authentication:
I did not change the
currentsymlink or reinstall Codex for this A/B test.This suggests a regression or behavioral difference in 0.157.0 rather than an invalid ChatGPT OAuth token.
tschachim commentedon Sep 26, 2026
FIXED for me...
kvillers1 commentedon Sep 26, 2026
same
Rabai94 commentedon Sep 26, 2026
Update: working again for me — Windows / ChatGPT Pro
Following up on my earlier report: Codex is now working again in my Windows desktop environment with my ChatGPT account. The previously blocked task resumed, and the repeated
401 Unauthorized — Incorrect API key providederror is no longer preventing me from continuing.I have not established the root cause or which change restored access. This confirms recovery for my account/environment, not that the issue is resolved for every affected user.
Thank you.
edwardswhiskeyblues-alt commentedon Sep 26, 2026
Additional Windows desktop corroboration with local timing and network evidence.
Environment
26.924.1866.0Observed across two independent long-running chats
Three consecutive turns failed with the same
401 Unauthorized / Incorrect API keyresponse fromhttps://chatgpt.com/backend-api/codex/responses:request id:
d6a6eccf-0d81-47d5-844d-6765e1ec2cbacf-ray:
a40db6b3cf757d81-SOFrequest id:
2ac32735-6bf5-483f-8309-c165b434ddbccf-ray:
a40dd54dcaf65275-SOFThe UI displayed
Reconnectingbefore eventually surfacing the HTTP 401. Both chats later resumed normally and retained their history without changing any user API key.Correlation with the official outage
Official incident: https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39
Local-network exclusion
Windows WLAN-AutoConfig, NCSI, NetworkProfile, DHCP and System logs show no Wi-Fi disconnect at 23:03, 23:13 or 23:24 UTC. The tablet had normal Wi-Fi traffic. A separate one-second Wi-Fi security re-authentication occurred at 23:31:25–23:31:26 UTC, after all three failures, so it cannot explain them.
This corroborates a backend/service-credential outage rather than a user API-key or local-network problem. It also demonstrates the UX problem on Windows: websocket reconnect attempts look like a local connectivity failure, followed by a misleading API-key instruction for ChatGPT-authenticated users.
docs: correct the upstream auth issue draft
jocoal693-cpu commentedon Sep 26, 2026
I encountered the same 401 authentication issue in the VS Code Codex extension.
Environment:
Sequence:
401 Unauthorized: Incorrect API key provided: sk-svcac…fvMA
I also tried the built-in /feedback command, but it returned:
"Couldn't verify feedback permissions. Please try again"
I opened #48570 with the full details.
This may help determine whether the same authentication issue also affects the VS Code IDE extension and whether usage-limit recovery/session resumption is relevant.
HineshMandalia commentedon Sep 28, 2026
Also affected on Raspberry Pi OS 13 (aarch64), Codex CLI 0.158.0.
codex login statusreports:Logged in using ChatGPT
codex doctor --jsonshows:No OPENAI_API_KEY / CODEX_API_KEY / CODEX_ACCESS_TOKEN / OPENAI_BASE_URL environment variables are set.
Still getting:
401 Unauthorized: Incorrect API key provided: sk-svcac...