Skip to content

The codex cli giving: 401 unauthorized #12764

Closed

Description

@isha-paliwal3

Getting:

unexpected status 401 Unauthorized: {"detail":"Unauthorized"},

stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

codex-cli 0.104.0
cf-ray: 9d365d4acc6514b5-SIN,
request id: 3c42618e-4712-4634-8959-f73fa73737ca

Activity

  1. added
    bug
    CLI
    auth
    on Feb 25, 2026
  2. etraut-openai commented on Feb 25, 2026

    @etraut-openai
    Contributor

    Where are you located? Are you accessing from a supported country?

  3. isha-paliwal3 commented on Feb 25, 2026

    @isha-paliwal3
    Author

    I am accessing from India, it was working fine until yesterday, even now its logged in successfully but its unabble to get response from https://chatgpt.com/backend-api/codex/responses

    it has happened to me earlier as well but somehow it worked on its own but the issue reappeared now

  4. isha-paliwal3 commented on Feb 25, 2026

    @isha-paliwal3
    Author

    @etraut-openai I have chatgpt Plus subscription

    Which model were you using?
    gpt-5.2 medium

    What platform is your computer?
    Windows

  5. etraut-openai commented on Feb 25, 2026

    @etraut-openai
    Contributor

    Try logging out and logging back in to see if that resolves it.

    If not, please repro the problem and then use the /feedback slash command to upload your logs and session details, then post the thread ID here so I can reference the uploaded details.

  6. isha-paliwal3 commented on Feb 25, 2026

    @isha-paliwal3
    Author

    @etraut-openai here is the thread ID 019c968f-a41c-7ef3-a193-c32530d246a2

  7. kj809 commented on Feb 26, 2026

    @kj809

    I have exactly the same issue - my thread ID is 019c9740-2f19-7af0-993e-706e58f9d6b6

    Based in the UK however

  8. etraut-openai commented on Feb 26, 2026

    @etraut-openai
    Contributor

    @isha-paliwal3, I'm looking at your logs, and it appears that you've configured Codex to use https://ai-linton8487ai296041917917.openai.azure.com/openai/v1/responses as the endpoint. Are you using an Azure-hosted model?

    @kj809, I'm seeing the same thing in your logs.

    If you're using an Azure-hosted endpoint and you're seeing "401 Unauthroized" errors, you should contact the folks in Azure and work with them on a fix.

  9. super148666 commented on Feb 26, 2026

    @super148666

    I have same issue.
    request id: b6c97496-0371-4140-ba4a-43852c628904
    Based in Perth, Australia
    Was working fine two days ago.

  10. super148666 commented on Feb 26, 2026

    @super148666

    OK, it works on my mbp, which has codex 5.3 available. However, on the machine that fails, I can only see 5.2 instead. Reinstalling extension makes no change.

  11. etraut-openai commented on Feb 26, 2026

    @etraut-openai
    Contributor

    @super148666, I wasn't able to look at your logs. If you used /feedback to upload, it apparently failed. Are you also using Azure-hosted models? If so, please report this issue to the Azure folks.

  12. super148666 commented on Feb 26, 2026

    @super148666

    I just uploaded the feedback. Thread ID: 019c9844-047b-7622-b1c0-56d9ffc81e67

  13. rafaserna commented on Feb 26, 2026

    @rafaserna

    Same problem here. Feedback send ID: 019c9901-1445-77b3-af5d-be8bdaa4c039

  14. 84 remaining items

  15. jdivins commented on Mar 28, 2026

    @jdivins

    Bucket B, and I have installed Firewall Cisco Umbrella.
    So I am going to ask to IT team to unlock this.
    @ssportal what action has your IT team done on the configuration?

    Thank you.

  16. chrisslanphear commented on Apr 2, 2026

    @chrisslanphear

    EDIT AS OF 04022026 @ 2:59PM PST:
    Feedback ID: 019d4f65-788c-7d10-aad3-cecf6d28a5b8 Stopped working again and provided the 401 error via vs code extension on windows. @etraut-openai @ccy-oai

    As of 4/2/2026 - this issue seems to be resolved on my side. No changes were made on anything but it is working as expected once again.

    Guessing the items mentioned earlier about cli updates have finally made their way through to the vs code extension.

  17. ccy-oai commented on Apr 3, 2026

    @ccy-oai
    Contributor

    EDIT AS OF 04022026 @ 2:59PM PST: Feedback ID: 019d4f65-788c-7d10-aad3-cecf6d28a5b8 Stopped working again and provided the 401 error via vs code extension on windows. @etraut-openai @ccy-oai

    As of 4/2/2026 - this issue seems to be resolved on my side. No changes were made on anything but it is working as expected once again.

    Guessing the items mentioned earlier about cli updates have finally made their way through to the vs code extension.

    @chrisslanphear, I checked your April 2 reports more closely.

    Around 18:07 UTC, the same account/client setup was working from a 135.x.x.x IP. Later, around 21:56 UTC, the same setup was hitting repeated 401s from a 146.x.x.x IP, and those later requests reached our backend without your ChatGPT auth attached.

    So at this point I suspect the later network/IP more than the extension itself. If you can, please try the same machine on a different network and let us know what you see.

  18. jdivins commented on Apr 4, 2026

    @jdivins

    I have still the problem, can we have some kind of compensation, I have been working with codex enabling and disabling wifi since I discovered it and it's a really bad experience. @

    During next week I hope I can check it with the IT team.

  19. chrisslanphear commented on Apr 7, 2026

    @chrisslanphear

    EDIT AS OF 04022026 @ 2:59PM PST: Feedback ID: 019d4f65-788c-7d10-aad3-cecf6d28a5b8 Stopped working again and provided the 401 error via vs code extension on windows. @etraut-openai @ccy-oai
    As of 4/2/2026 - this issue seems to be resolved on my side. No changes were made on anything but it is working as expected once again.
    Guessing the items mentioned earlier about cli updates have finally made their way through to the vs code extension.

    @chrisslanphear, I checked your April 2 reports more closely.

    Around 18:07 UTC, the same account/client setup was working from a 135.x.x.x IP. Later, around 21:56 UTC, the same setup was hitting repeated 401s from a 146.x.x.x IP, and those later requests reached our backend without your ChatGPT auth attached.

    So at this point I suspect the later network/IP more than the extension itself. If you can, please try the same machine on a different network and let us know what you see.

    We have detrmined on our end that this is fully related to the Cisco Umbrella issue mentioned earlier in this thread. The specifics are as follows:

    Reconnecting details
    "unexpected status 302 Found: <title>302 Moved Temporarily</title>

    302 Moved Temporarily


    Umbrella Cloud Security Gateway , url: wss://chatgpt.com/backend-api/codex/responses"

    Then we get the 401 status.

    "unexpected status 401 Unauthorized: We got your request, but your ChatGPT login did not make it to this service., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: 9e8c1f990b76ad1b-EWR, request id: 9b12512f-1962-42e0-bf0a-db412429c230"

    @ccy-oai - do you know if Open AI is working wiht Cisco on this at all?
    See https://community.cisco.com/t5/umbrella-discussions/chatgpt-codex-apps-on-mac-broken-after-tls-decryption-started/m-p/5372780

  20. ccy-oai commented on Apr 10, 2026

    @ccy-oai
    Contributor

    @chrisslanphear Cisco is aware. Let me check what they have available for us on the 401 issue here.

  21. chrisslanphear commented on Apr 15, 2026

    @chrisslanphear

    @chrisslanphear Cisco is aware. Let me check what they have available for us on the 401 issue here.

    @ccy-oai Any updates on this? Still getting the following

    unexpected status 401 Unauthorized: We got your request, but your ChatGPT login did not make it to this service., url: https://chatgpt.com/backend-api/codex/responses, cf-ray: 9e839c890c11a0fb-EWR, request id: 694f535d-2e5a-4bd9-8158-375f66789b65

  22. ccy-oai commented on Apr 17, 2026

    @ccy-oai
    Contributor

    @chrisslanphear Cisco is aware of the issue, but I did not get a response with any specific Cisco-side guidance or public help page to point Codex users to.

    That leaves us to this guidance for anyone hitting this specific server error:

    We got your request, but your ChatGPT login did not make it to this service.

    That means the request reached OpenAI, but the expected ChatGPT auth did not arrive with it. In the cases we’ve investigated, for this issue, that points to something on the user’s network path, such as Cisco Umbrella / Secure Access / TLS inspection / proxy policy, interfering with Codex traffic.

    I'm closing the issue with recommendation: take the error text and URL to your network admins. They should review the network security / proxy / TLS inspection configuration for ChatGPT and Codex traffic, and escalate to Cisco Support if needed. If I do get public guidance from Cisco I will append it here.

  23. self-assigned this
    on Apr 17, 2026
  24. jdivins commented on Apr 23, 2026

    @jdivins

    Please I would like some detailed information about what url port or network information to send to my it team, can you help me on that?

  25. chrisslanphear commented on Apr 24, 2026

    @chrisslanphear

    Please I would like some detailed information about what url port or network information to send to my it team, can you help me on that?

    @jdivins Yes! @ccy-oai it would be helpful if you could provide specifics on what IT teams need to adjust to get this working because I have not received anything useful elsewhere (openAI or Cisco).

  26. ccy-oai commented on Apr 24, 2026

    @ccy-oai
    Contributor

    Please I would like some detailed information about what url port or network information to send to my it team, can you help me on that?

    @jdivins Yes! @ccy-oai it would be helpful if you could provide specifics on what IT teams need to adjust to get this working because I have not received anything useful elsewhere (openAI or Cisco).

    @jdivins @chrisslanphear

    Think of it this way:

    OpenAI server <- Internet <- [security/proxy system run by your network admin, possibly Cisco Umbrella] <- your computer

    This is standard HTTPS over port 443 to:

    • https://chatgpt.com/backend-api/codex/responses
    • https://chatgpt.com/backend-api/codex/models

    What appears to be happening in affected cases is that the system in the middle is intercepting or forwarding the HTTPS request, without letting the ChatGPT Authorization header reach OpenAI intact.

    So the ask for IT is:

    • identify what systems could be between the client device and OpenAI that intercept or forward this traffic e.g. HTTP inspection
    • verify whether it is inspecting or rewriting requests to those endpoints
    • if it is, make sure it does not alter, strip, or malform the Authorization header
  27. matkozak commented on Apr 28, 2026

    @matkozak

    This confirms what I am seeing.

    Codex CLI cannot connect to chatgpt.com/backend-api/... endpoints when running behind Cisco Umbrella and every API call fails with 401 Unauthorized:

    Turn error: unexpected status 401 Unauthorized: We got your request, 
    but your ChatGPT login did not make it to this service., 
    url: https://chatgpt.com/backend-api/codex/responses
    

    The logs also show:

    startup websocket prewarm setup failed: unexpected status 302 Found: <html>
    

    ... since Umbrella intercepts requests to chatgpt.com and returns a 302 redirect through its inspection gateway:

    HTTP/1.1 302 Moved Temporarily
    Server: Cisco Umbrella
    Set-Cookie: X-OpenDNS-Session=...; Path=/; Expires=...
    Location: https://chatgpt.com.x.<session>.id.opendns.com/s/chatgpt.com/backend-api/codex/models

    The issue is specific to ChatGPT auth mode. api.openai.com is not inspected by Umbrella on the same network.

    Crucially, chatgpt.com is inspected, but allowed. chatgpt.com works normally in a browser on the same network / machine.

    Browsers handle this transparently (follow redirect, accept cookie, get proxied through). The Codex binary does not, resulting in the 302/401 errors above. I understand "talk to IT" is the most straightforward solution but I hope there is also a more scalable one which would allow Codex to behave like the browser client.

    Workarounds tried:

    • Tethering to a mobile phone (bypassing corporate network) works
    • DNS-level workarounds (configuring alternate DNS servers, split DNS) do not work because the corporate network intercepts all outbound DNS traffic regardless of the target server.
    • Likely affects other corporate proxy/TLS inspection products (Zscaler, etc.) that flag chatgpt.com.

    Some standard info:

    • version: 0.125.0
    • subscription: Plus
    • platform: Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 (Ubuntu 24.04 on WSL2)
    • terminal: Windows Terminal
  28. molujia commented on Aug 22, 2026

    @molujia

    https://www.youtube.com/watch?v=_09B_hso_kY

    I fixed my problem anyhow. And I recorded how I solved it to help the others. Hope this may help.

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

Metadata

Metadata

Assignees

Labels

agentauthbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions