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
GET http://localhost:1455/auth/callback?code=redacted&scope=openid profile email offline_access&state=redacted
Status
500
Internal Server Error
VersionHTTP/1.1
Transferred252 B (90 B size)
Referrer Policystrict-origin-when-cross-origin
Request PriorityHighest
DNS ResolutionSystem
What steps can reproduce the bug?
When I started using codex cli, it worked fine for like 2 hours max, then I'd get errors from openapi responses.
The solution for this was to delete "rm -rf ~/.codex" and relogin with the cli.
But now this also does not work. I am not able to log in at all anymore.
I always get the token exchange error no matter what (different linux machines, browsers, terminals etc.) I try.
What is the expected behavior?
Redirect to the CLI with proper auth tokens, not throw 500 error.
Additional information
I tried with
Kitty terminal, Zen browser
Chromium
VSCodium
Ghostty
Disabled UFW
Checked internet connectivity.
Setting DNS to 8.8.8.8
Ensuring no VPN or other IP link is active(besides Ethernet cable)
I figured out what's causing the issue.
If I enable/disable wireguard client, I need to reboot my system before I can use the cli again.
Not sure why this is the case as I'm able to ping the domain
I had the same issue on WSL. What worked for me was opening the console, installing Codex globally, running it once, logging in, and then restarting Windows in VS Code — after that, everything started working fine.
To fix the Token exchange failed error, you must launch VS Code with explicit proxy settings and a crucial bypass list, ensuring external OpenAI traffic goes through the proxy while local authentication callbacks remain direct.
uname -s -o -r -m : Linux 6.14.0-35-generic x86_64 GNU/Linux
LXTerminal 0.40.0
python 3.12.3
nvm 0.40.3
node 24.11.1 (npm 11.6.2)
codex-cli 0.63.0
Not using a proxy or VPN.
I tried rm -rf ~/.codex, ufw allow 1455/tcp, downgrading the node to 18, and reinstalling modules certifi and requests in Python,
but the Codex (login) does not work.
In Codex, when I press the Enter key on the screen above, it is registered twice.
If the screen above appears again, please press the Enter key once more.
When the screen switches to the one below, try logging in at that moment.
It seems that only at this point the web browser correctly receives the login information.
If you're having problems with our normal interactive auth flow for some reason (e.g. a local firewall or other network settings), you can try using the headless device authentication techniques.
To fix the Token exchange failed error, you must launch VS Code with explicit proxy settings and a crucial bypass list, ensuring external OpenAI traffic goes through the proxy while local authentication callbacks remain direct.
I added localhost, ::1 and 127.0.0.1 to the "Http: No Proxy" setting, but the problem still occurs. Disabling the proxy didn't help either. Could you please tell me which addresses you added? @zhao926777
In the devtools i see the error:
A networking error occurred during POST request to https://ab.chatgpt.com/v1/rgstr?k=client-REDACTED&st=javascript-client-react&sv=3.27.0&t=REDACTED&sid=REDACTED&ec=REDACTED Invalid URL protocol: the URL must start with http: or https:.
Activity
github-actions commentedon Oct 17, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
LaurenceGuws commentedon Oct 20, 2025
I figured out what's causing the issue.
If I enable/disable wireguard client, I need to reboot my system before I can use the cli again.
Not sure why this is the case as I'm able to ping the domain
Stefanyshyn commentedon Oct 24, 2025
I had the same issue on WSL. What worked for me was opening the console, installing Codex globally, running it once, logging in, and then restarting Windows in VS Code — after that, everything started working fine.
lixin-zhao18 commentedon Nov 4, 2025
To fix the Token exchange failed error, you must launch VS Code with explicit proxy settings and a crucial bypass list, ensuring external OpenAI traffic goes through the proxy while local authentication callbacks remain direct.
lzq4047 commentedon Nov 19, 2025
Fixed by changing the SOCKS proxy to an HTTP proxy.
steveepreston commentedon Nov 25, 2025
Issue still exists
The error is on Codex/Openai side
td-shi commentedon Nov 25, 2025
I came here with the same problem.
For reference:
uname -s -o -r -m: Linux 6.14.0-35-generic x86_64 GNU/LinuxI tried
rm -rf ~/.codex,ufw allow 1455/tcp, downgrading the node to 18, and reinstalling modules certifi and requests in Python,but the Codex (login) does not work.
cnm-vs commentedon Nov 25, 2025
I have resolved the issue.
In Codex, when I press the Enter key on the screen above, it is registered twice.
If the screen above appears again, please press the Enter key once more.
When the screen switches to the one below, try logging in at that moment.
It seems that only at this point the web browser correctly receives the login information.
xiajiafu888 commentedon Dec 3, 2025
I'm chinese,I have the same issue.I'm ubuntu22.04,please help me.
我遇到同样的问题了,有兄弟解决了吗
steveepreston commentedon Dec 4, 2025
one the reasons in Windows was enabling WSL mode
there is no response from openai
etraut-openai commentedon Jan 13, 2026
Closing old bug.
If you're having problems with our normal interactive auth flow for some reason (e.g. a local firewall or other network settings), you can try using the headless device authentication techniques.
steveepreston commentedon Jan 15, 2026
In the file
C:\Users\{User}\.codex\config.tomlMake sure this is set:
windows_wsl_setup_acknowledged = falseif it's
truethen login will not works.SGmuwa commentedon Feb 9, 2026
I added
localhost,::1and127.0.0.1to the "Http: No Proxy" setting, but the problem still occurs. Disabling the proxy didn't help either. Could you please tell me which addresses you added? @zhao926777In the devtools i see the error:
A networking error occurred during POST request to
https://ab.chatgpt.com/v1/rgstr?k=client-REDACTED&st=javascript-client-react&sv=3.27.0&t=REDACTED&sid=REDACTED&ec=REDACTEDInvalid URL protocol: the URL must start withhttp:orhttps:.xiajiafu888 commentedon Feb 9, 2026
use socks proxy can solve the problem
yanan1116 commentedon Feb 15, 2026
Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)still facing this issue.