#Codex Token Issue
1 messages · Page 1 of 1 (latest)
Hi @fossil moth. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The knowledge sources don’t mention your exact error message, so I can’t be certain of the root cause. Here are the concrete, documented steps you can try based on how Codex auth and tokens work:
-
Check whether it’s a broader outage
Visit the OpenAI status page to see if Codex / Responses API are degraded; recent Codex issues have been caused by temporary backend problems rather than local setup. [Codex error rate] -
Force a fresh login cache
Codex CLI and IDEs share the same cached credentials in
~/.codex/auth.jsonor your OS keyring. Corrupted or expired tokens can cause persistent auth errors. [Codex auth]Try:
# 1) Log out fully codex logout # 2) (Optional but often helpful) Remove cached auth file if it exists mv ~/.codex/auth.json ~/.codex/auth.json.bak 2>/dev/null || true # 3) Log in again codex loginThen choose either:
- Sign in with ChatGPT (browser or device code), or
- Sign in with API key (paste a valid key from the OpenAI dashboard). [Codex auth; Auth endpoints]
-
If you’re on a headless/remote setup or browser login fails
Use device code auth, which is the recommended path when the normal browser callback is unreliable: [Login on headless devices]
codex login --device-authThen open the shown URL in a browser, sign in, and enter the one-time code.
-
If your system uses file-based auth and you still see token issues
You can log in successfully on a machine where the flow works, then copy the working ~/.codex/auth.json to the problem machine (treat it like a password). [Login on headless devices]
If you can share the exact error text from Codex CLI, the docs may have something more specific; with the current sources, these are the only clearly documented remediation steps.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@fossil moth Kapa.ai is still learning and improving, please let me know how I did by reacting below.
The screenshots show the errors