Skip to content

Codex Desktop and CLI returning 401 Unauthorized on /backend-api/codex/responses while browser Codex works #13838

Closed as duplicate

Description

@Ace0110-M

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop 26.305.950 (863) 、Codex CLI v0.110.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

macOS (Apple Silicon)

What issue are you seeing?

Codex Desktop and Codex CLI consistently return:

unexpected status 401 Unauthorized
{"detail":"Unauthorized"}
url: https://chatgpt.com/backend-api/codex/responses

This happens when submitting a prompt or when running codex whoami.

Browser-based Codex works normally with the same ChatGPT account.

The issue reproduces across multiple networks and after reinstalling Codex Desktop and CLI.

What steps can reproduce the bug?

  1. Launch Codex Desktop or run codex in CLI
  2. Wait for the interface to load
  3. Submit any prompt (for example: "test")
  4. The request immediately fails with:

unexpected status 401 Unauthorized
https://chatgpt.com/backend-api/codex/responses

Additional detail:
The error does not occur at startup.
Codex launches normally, but the 401 error appears immediately after submitting a prompt.

The same behavior occurs with:

codex whoami

What is the expected behavior?

Codex Desktop and Codex CLI should authenticate successfully with the ChatGPT account and process prompts normally, the same way Codex works in the browser.

Additional information

Environment:
macOS
Codex Desktop version: 26.305.950 (863)

Subscription:
ChatGPT Plus

OpenAI Support confirmed that the account is fully entitled to both Codex App and Codex CLI.

The issue occurs:

• in Codex Desktop
• in Codex CLI
• with codex whoami

but NOT in browser-based Codex.

Recent request IDs:

request_id: d285496c-ed1b-4905-98fc-c089e37a0d2c
cf-ray: 9d830132be1681ce-SIN

request_id: a515f629-6505-49f7-a8cc-b690e705e7f9
cf-ray: 9d83021a3d5812b0-SIN

request_id: fca35f7-1aab-4671-a1bd-a96b997063fa
cf-ray: 9d87dff7db8fd80-SIN

request_id: d4309b0d-9b00-462d-a7a7-6ed9990ea89a
cf-ray: 9d87d3da3c433e65-SIN

Troubleshooting already attempted:

• reinstall Codex Desktop
• reinstall Codex CLI
• logout/login
• multiple networks
• clearing ~/.codex

The issue persists.

Image

Activity

  1. added
    app
    on Mar 7, 2026
  2. added
    bug
    CLI
    auth
    on Mar 7, 2026
  3. github-actions commented on Mar 7, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. nfederman-alt commented on Sep 25, 2026

    @nfederman-alt

    same problem today 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: a40dc187ee861530-EZE, request id: d8e287a7-0159-429f-9817-0a5e089b9569

  5. JanLunge commented on Sep 25, 2026

    @JanLunge

    same for me "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: a40dd1ba9d5b62fe-HAM, request id: 9461b48c-7e50-4f71-aad2-7438d5550817"
    on codex in cli and desktop app, web seems to still work...

  6. amr-elsehemy commented on Sep 25, 2026

    @amr-elsehemy

    Same.

  7. salehelsayed commented on Sep 25, 2026

    @salehelsayed

    same here

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

    CLIappauthbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions