Skip to content

CLI authentication fails with 401 Unauthorized after retry limit #5456

Closed

Description

@SystemSculpt

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

Activity

  1. github-actions commented on Oct 21, 2025

    @github-actions
    Contributor
  2. SystemSculpt commented on Oct 21, 2025

    @SystemSculpt
    Author

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

  3. neurall commented on Oct 25, 2025

    @neurall

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions