Skip to content

Unable to use codex at all – neither via API keys nor via web login #3409

Closed as not planned

Description

@rr-

What version of Codex is running?

codex-cli 0.31.0

Which model were you using?

codex-mini-latest

What platform is your computer?

Linux 6.15.9-arch1-1 x86_64 unknown

What steps can reproduce the bug?

WEB LOGIN

  1. Run codex
  2. Sign in with ChatGPT
  3. (See the link opened in the browser, OR click it manually, both lead to the same outcome)
  4. Log in with Google
  5. Redirects go brrr
  6. Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token). The CLI continues to wait for a confirmation which never arrives.
Image

API LOGIN

  1. Set OPENAI_API_KEY either to OPENAI_API_KEY=sk-proj-… or OPENAI_API_KEY=sk-mym…
  2. Launch codex
  3. Use preferred_auth_method="apikey" in config.toml OR confirm that yes I want to use pay as I go payment method associated with API keys
  4. Prompt "test"
  5. Wait around 30 s
  6. ⚠️ stream error: error sending request for url (https://api.openai.com/v1/responses); retrying 1/5 in 188ms…

What is the expected behavior?

I can use Codex

What do you see instead?

Currently I'm not able to use Codex in any way

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    on Sep 10, 2025
  2. rr- commented on Sep 10, 2025

    @rr-
    Author

    ISP issue on my part. Changing my DNS to 8.8.8.8 fixed the issue. Found this out with the help of tcpdump.

  3. Harry-maximum commented on Sep 26, 2025

    @Harry-maximum

    lol the same, has nothing to do with this OAuth shit

  4. kevit-ashish-chandpa commented on Oct 9, 2025

    @kevit-ashish-chandpa

    ISP issue on my part. Changing my DNS to 8.8.8.8 fixed the issue. Found this out with the help of tcpdump.

    Thanks @rr- ,
    It’s working as expected for me. If you’re facing issues, please ensure that port 443 is open on your system.

  5. steveepreston commented on Nov 30, 2025

    @steveepreston

    Issue still exists and not resolved by setting DNS or opening 443 port

    Update: Resolved by turning off the WSL mode

  6. pickmao commented on Feb 23, 2026

    @pickmao

    maybe your system env is wrong.

  7. Harry-maximum commented on Feb 24, 2026

    @Harry-maximum

    maybe your system env is wrong.

    I solved the problem, because of some reasons in China, we cannot use the full Internet, after I open the TUN mode of my clash Verge, codex login succeeded and works fine, thanks for that

  8. andreykaone commented on Jun 5, 2026

    @andreykaone

    Also have this issue. I use Happ app, and selecting TUN mode in a client helps me resolve this one

    Image
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