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
{{ message }}
Repository navigation
Remote compaction fails with 401 'Incorrect API key' (sk-svcacct) for ChatGPT-authenticated users #48232
CLIIssues related to the Codex CLIauthIssues related to authentication and accountsbugSomething isn't workingcontextIssues related to context management (including compaction)
Remote compaction fails with a 401. The rejected key is an OpenAI service-account key (sk-svcacct-…), but that key isn't configured anywhere on the client. The session shows "Compaction interrupted" followed by "Reconnecting 2/…".
Error running remote compact task: unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***…fvMA. You can find your API key at https://platform.openai.com/account/api-keys., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: a40d8b075ce54801-SJC, request id: f7192488-dccb-430c-a65f-d5884bb4228c
Why this looks server-side
The client is logged in with ChatGPT (auth_mode: chatgpt in ~/.codex/auth.json, and OPENAI_API_KEY there is null).
OPENAI_API_KEY is not set in the environment.
No custom model_provider or env_key is set in config.toml.
A second user on a different machine and account hit the same error at the same time.
So the sk-svcacct key seems to belong to the backend's remote-compaction path, and it's being rejected.
Environment
codex-cli 0.157.0
macOS (Darwin 25.4.0)
Auth: ChatGPT login
Steps to reproduce
Use a ChatGPT-authenticated Codex session until auto-compaction triggers.
Expected
Compaction succeeds, or at least doesn't fail with an unrelated service-account key.
IDs for tracing
request id: f7192488-dccb-430c-a65f-d5884bb4228c
cf-ray: a40d8b075ce54801-SJC
Reacted by noxaaa, Marcelo Díaz, delta, Allen Clark Copeland, Jr., Nick Trierweiler, Sam Bateman, drewtnguyen, Paul Pamment, David, AyajiLin and 32 more
Seeing the same issue here, and in my case it is not limited to remote compaction or resuming an existing thread, 2 sessions interrupted, and completely new Codex sessions fail as well.
The sequence is:
Reconnecting 1/5...
stream disconnected before completion: websocket closed by server before response.completed
Notably, the rejected sk-svcac...fvMA credential appears to be the same one reported by other users, despite requests going through different Cloudflare locations.
Fresh sessions fail immediately, so this looks broader than a stale/resumed-thread authentication state.
Reacted by Allen Clark Copeland, Jr., Jianwen_LYU and Cole Godfrey
I can reproduce this on Windows, and in my case it is also not limited to an existing/resumed thread.
Environment / checks:
Windows 11 x64
Codex CLI: 0.149.0-alpha.4.1
codex login status => Logged in using ChatGPT
OPENAI_API_KEY and CODEX_API_KEY are not set at Process/User/Machine scope
Codex is routed through a local bridge at http://127.0.0.1:17841/v1
Bridge health check http://127.0.0.1:17841/healthz returns HTTP 200
A completely fresh Codex chat fails
Switching to a ChatGPT Web model also fails
Current error:
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***fvMA
url: http://127.0.0.1:17841/v1/responses
cf-ray: a40d9ba48c526cea-ICN
request id: 9ac3ba09-4607-4bbf-8d28-55cbd2d1ad7a
The masked credential suffix fvMA matches the credential reported by other users in this issue. Since fresh sessions fail immediately and local ChatGPT/API-key environment variables are absent, this appears broader than compaction/resume state and is consistent with the other reports here.
This was reported from a Windows user using ChatGPT/Codex. The error surfaced specifically during a remote compact task. The rejected credential appears to be the same service-account-style key family described in this issue, rather than a user-supplied key.
Additional trace IDs for backend investigation:
request id: 6543c6cb-0c22-4940-b81f-c2847005fa00
cf-ray: a40d94f5fd011ee0-LAX
Exact Codex client version was not captured at the time of the failure.
At the same time, ChatGPT web in Work mode fails with "Error in message stream" after ~1m of thinking. ChatGPT login (Pro), OPENAI_API_KEY unset, and codex logout + codex login didn't help.
Same error here, and it is not limited to compaction: it also fails on the
first message of a brand-new thread.
Codex on macOS, signed in with ChatGPT (auth_mode "chatgpt")
No OPENAI_API_KEY anywhere: not in the shell environment, not in launchctl,
not in any shell startup file, not in ~/.codex/auth.json; no provider or
auth overrides in ~/.codex/config.toml
CLIIssues related to the Codex CLIauthIssues related to authentication and accountsbugSomething isn't workingcontextIssues related to context management (including compaction)
Activity
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
rafaself commentedon Sep 25, 2026
Same as related in #48230
MrrKirill commentedon Sep 25, 2026
same
AlexanderMorou commentedon Sep 25, 2026
Same here. Windows 10 through WSL 2. Debian image.
mo-mew commentedon Sep 25, 2026
Seeing the same issue here, and in my case it is not limited to remote compaction or resuming an existing thread, 2 sessions interrupted, and completely new Codex sessions fail as well.
The sequence is:
and then
Notably, the rejected
sk-svcac...fvMAcredential appears to be the same one reported by other users, despite requests going through different Cloudflare locations.Fresh sessions fail immediately, so this looks broader than a stale/resumed-thread authentication state.
andkondev commentedon Sep 25, 2026
Same here:
shinch2844-ops commentedon Sep 25, 2026
I can reproduce this on Windows, and in my case it is also not limited to an existing/resumed thread.
Environment / checks:
0.149.0-alpha.4.1codex login status=>Logged in using ChatGPTOPENAI_API_KEYandCODEX_API_KEYare not set at Process/User/Machine scopehttp://127.0.0.1:17841/v1http://127.0.0.1:17841/healthzreturns HTTP 200Current error:
The masked credential suffix
fvMAmatches the credential reported by other users in this issue. Since fresh sessions fail immediately and local ChatGPT/API-key environment variables are absent, this appears broader than compaction/resume state and is consistent with the other reports here.Xipong commentedon Sep 25, 2026
same
ZhouWeihua2008 commentedon Sep 25, 2026
Another occurrence of the same issue.
Observed error (API key redacted):
This was reported from a Windows user using ChatGPT/Codex. The error surfaced specifically during a remote compact task. The rejected credential appears to be the same service-account-style key family described in this issue, rather than a user-supplied key.
Additional trace IDs for backend investigation:
6543c6cb-0c22-4940-b81f-c2847005fa00a40d94f5fd011ee0-LAXExact Codex client version was not captured at the time of the failure.
Anthony-Access commentedon Sep 25, 2026
same on codex cli last
samuraicobra commentedon Sep 25, 2026
7 remaining items
LukasNel commentedon Sep 25, 2026
same issue
svre-mc commentedon Sep 25, 2026
same
etraut-openai commentedon Sep 25, 2026
Thanks for reporting. We're aware of the problem. Investigation is underway.
DemFlax commentedon Sep 25, 2026
Same issue here. ChatGPT login, no API key configured.
Error: unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***…fvMA
url: https://chatgpt.com/backend-api/codex/responses
cf-ray: a40dae24df4dcfca-MAD
request id: 48881aa0-5e37-4a33-af6c-0d80be15ad6d
OS: Windows 11
Region: Madrid, Spain
yuyangzhang-young commentedon Sep 25, 2026
Same here
Codex CLI 0.157.0 (standalone installer), WSL2 Ubuntu on Windows
Request IDs:
FantaSeaAI commentedon Sep 25, 2026
Same here.
Request id: 9ccbb34e-fe45-4aca-b137-5cd4598603d9
self9dmin commentedon Sep 25, 2026
Same issue here, started today. Same rejected key suffix (fvMA).
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***…fvMA
url: https://chatgpt.com/backend-api/codex/responses
request id: c84c711c-0b86-47f0-86d8-93878c972213
Signed in with ChatGPT, no API key configured on my side.
jegirard commentedon Sep 25, 2026
Yep me too
LUIGIVAMPER commentedon Sep 25, 2026
Same error here (key also ends in
fvMA) on a fresh session (sending it a "hello" as initial message) in the Codex extension for Cursor.unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***********************************************************************************************************************************************************fvMA. You can find your API key at https://platform.openai.com/account/api-keys., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: a40db5b9cc259a2e-ORD, request id: ec37939c-9769-4e08-a133-d91c283fbc2d
At the same time, ChatGPT web in Work mode fails with "Error in message stream" after ~1m of thinking. ChatGPT login (Pro),
OPENAI_API_KEYunset, andcodex logout+codex logindidn't help.ctechfl1 commentedon Sep 25, 2026
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***********************************************************************************************************************************************************fvMA. You can find your API key at https://platform.openai.com/account/api-keys., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: a40dc24269c833e0-MIA, request id: 203b7417-7fd7-4eeb-a58b-37940cc270ac
mrinalmishra commentedon Sep 25, 2026
Same error here, and it is not limited to compaction: it also fails on the
first message of a brand-new thread.
not in any shell startup file, not in ~/.codex/auth.json; no provider or
auth overrides in ~/.codex/config.toml
at https://chatgpt.com/backend-api/codex/responses
Request IDs (25 Sep 2026):
first message of a new thread
christianahjemiyo commentedon Sep 25, 2026
same here.
SirGinshi commentedon Sep 25, 2026
Same error here
Codex on Windows 11, signed in with ChatGPT, no API KEY
Relogin doesnt helps
unexpected status 401 Unauthorized: Incorrect API key provided: sk-svcac***********************************************************************************************************************************************************fvMA. You can find your API key at https://platform.openai.com/account/api-keys., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: a40dcbe9ab38bb44-FRA, request id: a3191e25-e002-4e93-8de2-9b003d98fa87
jegirard commentedon Sep 25, 2026
likely this: https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39