CLI authentication fails with 401 Unauthorized after retry limit

Resolved 💬 3 comments Opened Oct 21, 2025 by SystemSculpt Closed Oct 21, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Issue

The Codex CLI fails to authenticate, repeatedly returning 401 Unauthorized errors before exceeding the retry limit.

Error Output

■ exceeded retry limit, last status: 401 Unauthorized, request id: 99210d09997d307d-SEA
■ exceeded retry limit, last status: 401 Unauthorized, request id: 992103f58e774224-SEA

Behavior

  • CLI attempts to connect/authenticate
  • Each attempt fails with 401 Unauthorized
  • After 5 retry attempts, the CLI exits
  • Request IDs consistently end with SEA region identifier

Expected

CLI should successfully authenticate and execute commands.

Extra Notes

  • I came across this using my typical internet, I even hopped onto a VPN to see if it was somehow that being the problem, nope, same thing/errors.

Request IDs from failed attempts: 99210d09997d307d-SEA, 992103f58e774224-SEA

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5345
  • #4554
  • #4367
  • #3908
  • #5046

Powered by Codex Action

SystemSculpt · 10 months ago

This fix worked:
"Please do codex logout followed by codex login, we are investing in making this more robust in the future."

neurall · 10 months ago

delete OPENAI_API_BASE in env ;) I had hunch it would be the cause. Worked for me