openai/codex

"Sign in With ChatGPT" functionality needs to be robust against all account types

Closed this issue ยท 169 comments

The bulk of the work to support this feature was implemented in these PRs:

That said, I know there are cases where users may or may not have credits, differences between Pro and Plus, etc., and we need to be sure that all edge cases are addressed and that users see appropriate messaging.

to save ~/.codex/auth.json

npx @brantes/codex-get-auth-conf 

codex-get-auth-conf

Image

This is what I currently get with codex login. A very confused LLM trying to figure out what I mean by "login" ๐Ÿ˜†
Just mentioning it in case it helps. It works great with the API key in the env.

I attempted to log in with a Plus account. I am able to use gpt-4.1, but not the default model codex-mini-latest, or the o-series models, due to the organization needing to be verified. Perhaps of note is that I've previously logged in to platform.openai.com with this account (but have not purchased credits). In the browser, the login flow completes successfully, although on the "Codex CLI wants access to your API organization" page [1], the "New organization" option [2] reports "invalid organization id" [3]; the existing default org works. Screenshots below.

: 10:11:28 ~ ; type codex
codex is /opt/homebrew/bin/codex
: 10:11:30 ~ ; codex login     
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_XXXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&scope=openid+profile+email+offline_access&code_challenge=XXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXX&code_challenge_method=S256&id_token_add_organizations=true&state=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in
: 10:12:13 ~ ; codex --version
codex-cli 0.2.0

Entering a prompt into Codex then results with this error:

ERROR: unexpected status 400 Bad Request: {"error": {"message": "Your organization must be verified to generate reasoning summaries. Please go to: https://platform.openai.com/settings/organization/general and click on Verify Organization. If you just verified, it can take up to 15 minutes for access to propagate." "type": "invalid_request_error", "param": "reasoning.summary", "code": "unsupported_value" }}

I have not completed the "Verify Organization" workflow as that requires purchasing credits, which I would not like to do at this time.

Using codex -m gpt-4.1 DOES work.

Image Image Image

I attempted to log in with a Plus account. I am able to use gpt-4.1, but not the default model codex-mini-latest, or the o-series models, due to the organization needing to be verified. Perhaps of note is that I've previously logged in to platform.openai.com with this account (but have not purchased credits). In the browser, the login flow completes successfully, although on the "Codex CLI wants access to your API organization" page [1], the "New organization" option [2] reports "invalid organization id" [3]; the existing default org works. Screenshots below.

: 10:11:28 ~ ; type codex
codex is /opt/homebrew/bin/codex
: 10:11:30 ~ ; codex login     
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_XXXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&scope=openid+profile+email+offline_access&code_challenge=XXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXX&code_challenge_method=S256&id_token_add_organizations=true&state=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in
: 10:12:13 ~ ; codex --version
codex-cli 0.2.0

Entering a prompt into Codex then results with this error:

ERROR: unexpected status 400 Bad Request: {"error": {"message": "Your organization must be verified to generate reasoning summaries. Please go to: https://platform.openai.com/settings/organization/general and click on Verify Organization. If you just verified, it can take up to 15 minutes for access to propagate." "type": "invalid_request_error", "param": "reasoning.summary", "code": "unsupported_value" }}

I have not completed the "Verify Organization" workflow as that requires purchasing credits, which I would not like to do at this time.

Using codex -m gpt-4.1 DOES work.

Image Image Image

Same here, doesn't work for me

I get this when I try to login to ChatGPT

Route Error (500 ): "The operation is insecure."

I only see requests to datadog being blocked by uBlock Origin.
Using Firefox 140.0.2

FWIW This flow does not degrade gracefully with a company-provided ChatGPT account that does not have access to platform.openai.com.

Codex works on the hosted Web UI (as expected) but without API access, codex-cli cannot work. The login fails with a "Authentication Error - No eligible ChatGPT account found." error on the web auth flow. This requires a Ctrl-C in the terminal.

(for the avoidance of doubt - I don't expect the login flow or codex-cli to work without access to the API, but it could potentially handle the error more gracefully).

I logged in using my ChatGPT account (I am a plus subscriber) and I get the following error.

Credit redemption request failed: 400 Bad Request
The model "codex-mini-latest" does not appear in the list of models available to your account. Double-check the spelling (use
  openai models list
to see the full list) or choose another model with the --model flag.

I tried to use the --model option to use GPT-4.1 but it showed that I do not have enough quota.

I believe I should have access to Codex as a ChatGPT Plus customer right?

I'm also Plus subscriber and getting error
"ERROR: unexpected status 400 Bad Request: {"error": {"message": "Your organization must be verified to generate reasoning summaries. Please go to: https://platform.openai.com/settings/organization/general and click on Verify Organization. If you just verified, it can take up to 15 minutes for access to propagate." "type": "invalid_request_error", "param": "reasoning.summary", "code": "unsupported_value" }}" while trying to use codex in interactive mode with codex-mini-latest enabled. Are plus users limited to GPT-4.1 or something? ๐Ÿค”

Now I get this instead...

Route Error (409 ): {
  "error": {
    "message": "Invalid client. Please start over.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_state"
  }
}

Seems to be on another datadog.client initiated request against the auth endpoint https://auth.openai.com/api/accounts/authorize/continue

When I logging, the result is:

Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in

And after:

Image

Is not CODEX CLI included in the Team subscription license? Because after the login, seems that it generates an API key and start to count the cost per token in the platform.

Image

i ran that over an ssh connection. Therefore the redirection to the localhost part can never work. I know this is an edge case but if we can allow hand copy the redirect link to the console the process can then move on to the next part.

I also tried curl the redirect link on a separate terminal.

the main thread i got

d@1e018257db70:~/.codex$ codex login
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&scope=openid+profile+email+offline_access&code_challenge=XEFlBejjSmvmkM0bG1K_stCfnITiA3WRdivnH_QRKwo&code_challenge_method=S256&id_token_add_organizations=true&state=e3bbecc0ed7353991648446fa0be9da09e54ff9fe70ae4c1f8b1058ef3cf8714
Error logging in: login_with_chatgpt subprocess failed: 
d@1e018257db70:~/.codex$

the 2nd thread:

d@1e018257db70:~$ curl http://localhost:1455/auth/callback?code=ac_VRjn8dya2yvWS7XszsT0q_2SWKJO-oDiVyY9t-Rj4R0.OPr7Cv_sCWoF6lP5d8pNJWcmE7Q3lMEaoTddVsoTCoE&scope=openid+profile+email+offline_access&state=e3bbecc0ed7353991648446fa0be9da09e54ff9fe70ae4c1f8b1058ef3cf8714
[1] 10436
[2] 10437
d@1e018257db70:~$ <!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 400</p>
        <p>Message: State parameter mismatch.</p>
        <p>Error code explanation: 400 - Bad request syntax or unsupported method.</p>
    </body>
</html>

[1]-  Done                    curl http://localhost:1455/auth/callback?code=ac_VRjn8dya2yvWS7XszsT0q_2SWKJO-oDiVyY9t-Rj4R0.OPr7Cv_sCWoF6lP5d8pNJWcmE7Q3lMEaoTddVsoTCoE
[2]+  Done                    scope=openid+profile+email+offline_access

Have the same issue as @javichu148

Image

and after

Image

This some logs

Image

mac system
I have plus subscription

It seems that this is a very recent problem?
#1481

Same issue as @laricko, plus subscription using macOS

Image Image

Same here, on ubuntu.

Same issue as well on Windows 11 with WSL and a ChatGPT plus user, I am able to login via the OAuth flow and then am presented with

Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in

Then the same experience as some individuals in this thread

Image

Same issue as @lemessdavi, plus subscription using macOS

I have a "Team" account and tried to login. After I login succesfully, in the terminal I see:

Only users with Plus or Pro subscriptions can redeem free API credits.
Successfully logged in

which is quite confusing ๐Ÿซค

Do I have access to Codex CLI or not?

Plus user. Mac 15.5 (24F74). Login with Apple. After logging in and clicking continue on the "Codex CLI wants access to your API organization" page, I'm redirected to: http://localhost:1455/auth/callback?code=[redacted]&scope=openid+profile+email+offline_access&state=[redacted]

And the below error:

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

Plus user. Mac 15.5 (24F74). Login with Apple. After logging in and clicking continue on the "Codex CLI wants access to your API organization" page, I'm redirected to: http://localhost:1455/auth/callback?code=[redacted]&scope=openid+profile+email+offline_access&state=[redacted]

And the below error:

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

Was actually able to fix this by running Install\ Certificates.command from python directory.

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

MacOS 26.0 Beta

This worked for me:

pip3 install --upgrade certifi
export SSL_CERT_FILE="$(python3 -c 'import certifi; print(certifi.where())')"

Plus user. Mac 15.5 (24F74). Login with Apple. After logging in and clicking continue on the "Codex CLI wants access to your API organization" page, I'm redirected to: http://localhost:1455/auth/callback?code=[redacted]&scope=openid+profile+email+offline_access&state=[redacted]

And the below error:

Error response

Error code: 500
Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.
Error code explanation: 500 - Server got itself in trouble.

Was actually able to fix this by running Install\ Certificates.command from python directory.

Despite 'successfully' installing, it looks like I'm unable to actually successfully use it. Similar issues to some above.

Image

I still get this error also after installing the certificates.

Error response
Error code: 500
Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1020)>.
Error code explanation: 500 - Server got itself in trouble.

I am getting a screen full of these w/0.7.0:

โ”‚event                                                                                                                                                โ”‚
โ”‚BackgroundEvent(BackgroundEventEvent { message: "stream error: stream disconnected before completion: stream closed before response.completed;       โ”‚
โ”‚retrying 1/10 in 208msโ€ฆ" })                                                                                                                          โ”‚
โ”‚                                                                                                                                                     โ”‚
โ”‚event                                                                                                                                                โ”‚
โ”‚BackgroundEvent(BackgroundEventEvent { message: "stream error: stream disconnected before completion: stream closed before response.completed;       โ”‚
โ”‚retrying 2/10 in 248msโ€ฆ" })                                                                                                                          โ”‚
โ”‚                                                                                                                                                     โ”‚
โ”‚event                                                                                                                                                โ”‚
โ”‚BackgroundEvent(BackgroundEventEvent { message: "stream error: stream disconnected before completion: stream closed before response.completed;       โ”‚
โ”‚retrying 3/10 in 339msโ€ฆ" })                                                                                                                          โ”‚
โ”‚                                      

I have a paid Pro account.

Getting "Operation timed out" with a plus account:

Image

Iโ€™m encountering this error after completing the authorization and granting the app access to my API key. I have a team subscription and installed the CLI using brew

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

codex login, page opens, login with google, input 2fa code, click into final step with defaults, and get these errors

  • installed with homebrew
  • Pro membership
  • viable API key

Terminal Output:

โ””โ”€[$]> codex login
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&scope=openid+profile+email+offline_access&code_challenge=Y5aLjGmeIONHScp7kiYQWnQfLK033DJvpxRap81miRI&code_challenge_method=S256&id_token_add_organizations=true&state=c32bd82f4f8e16b94c30ed03c8175b42f922ba2255f84d51e09fa9ed689c0cd8
Error logging in: login_with_chatgpt subprocess failed:

Error on webpage:

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

Plus User, trying to log in from an Ubuntu server that I am ssh'ed into.

When i do codex login, it generates a URL that I then put into my dev pcs browser (not the server). Then I go through the authentication process.

After logging in it seems to want me to link with my API account, but I want to use the Plus account not my API key. Regardless, if I move forward with the API account, it errors out. If I try a new account I get this

Image

If I try my existing account I get this

Image

Goal is to login from my server (since thats where I will be running codex) and to use my Plus account not my API key.

Pro Account
API Usage Tier 1 (with positive balance)
Codex 0.7.0 installed with brew on MacOS 15.5

codex login opens browser and I successfully log in:

Image

The CLI says otherwise:

Image

Attempting any chat within the TUI:

Image

API key is getting generated in my API account:

Image

same for me

Plus subscriber. But Codex still wants to use additional paid API calls.

I have this same issue. Organization verified and with balance. It fails if I try to do use the login.

Image

So if you have a Pro account, is the CLI suppose to use that instead of an API organization/project and balance?

Iโ€™ve had no luck just using my Pro account. I get redirect to pick my organization and project on new sign-ins.

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

It's trying to hit a localhost url
http://localhost:1455/auth/callback

Yep, plus user, can't log in via codex login, gets to a "Codex CLI wants access to your API organization" page, click Continue, get localhost response

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

I'm using Google OAuth to authenticate, my subscription is via Google Play

It would be nice to get some guidance on whether Teams accounts are eligible or not.

Route Error (400 ): {
  "error": {
    "message": "No eligible ChatGPT workspaces found.",
    "type": "invalid_request_error",
    "param": null,
    "code": "chatgpt_account_missing"
  }
}

Even though I am a Plus user when I authenticate with codex login my request are charged through API

Image

Even though I am a Plus user when I authenticate with codex login my request are charged through API

Image

If you have OPENAI_API_KEY in your environment variable, codex CLI might use that. Remove that or unset it.

OPENAI_API_KEY

Which environment variables you are referring to I don't have any in terminal environmental variables or in he repository. Codex cli is intalled via brew. When I enter credentials I see Codex CLI wants access to your API organization screen.

Image

I am also a Teams-User. The Readme says

If you have a paid OpenAI account, run the following to start the login process:

but logging in returns an authentication error

"message": "No eligible ChatGPT workspaces found."

codex login is starting a local login server on a headless server without a browser.

curl http://localhost:1455/auth/callback?code=.. gives:

Error logging in: login_with_chatgpt subprocess failed:

    Error response
    Error code: 400
    Message: State parameter mismatch.
    Error code explanation: 400 - Bad request syntax or unsupported method.

There should be a prompt to paste a token.

Is this P0 being worked on? Is this an internal only effort, or are public contributions allowed?

This flow is broken. Running codex login doesn't use my ChatGPT Plus Account. It seems to connect to my API account and that too doesn't work and shows this error message.

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>.

Error code explanation: 500 - Server got itself in trouble.

Does it used to work and broke recently? If yes, I can take a look and see what's going wrong.

Replying to my previous message, after running /Applications/Python 3.x/Install Certificates.command, the SSL error is gone. Now it says that I need to wait 7 days to redeem credits. So just need to wait for 7 more days to use codex CLI.

Sorry, your subscription must be active for more than 7 days to redeem credits.
Successfully logged in

This flow is broken. Running codex login doesn't use my ChatGPT Plus Account. It seems to connect to my API account and that too doesn't work and shows this error message.

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>.

Error code explanation: 500 - Server got itself in trouble.

Does it used to work and broke recently? If yes, I can take a look and see what's going wrong.

When trying to login with CLI as a Plus user I get below error, what could be the issue? Codex works well without any problem from Web

โš  Insufficient quota: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs:
https://platform.openai.com/docs/guides/error-codes/api-errors. Manage or purchase credits at https://platform.openai.com/account/billing.

Yep, plus user, can't log in via codex login, gets to a "Codex CLI wants access to your API organization" page, click Continue, get localhost response

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

I'm using Google OAuth to authenticate, my subscription is via Google Play

Okay! For me this was a Mac specific Python 3 issue where Python wasn't finding the certificate authority (CA) bundle. If you're using Homebrew Python, then:

brew update && brew upgrade && brew reinstall python

That builds Python against the latest OpenSSL and links to the correct CA certs.

Other Python installs (e.g. from python.org, pyenv) will need different fixes, but the underlying issue is likely the same: Python can't find valid certificates so HTTPS fails


Am I right in thinking the Python version is being rebuilt in Rust, so this particular issue will go away?

And now it wants me to verify my "organisation" on a personal account, using biometrics processed by a third party. No thank you. I think I am going to wait for a while, tihs is a cool concept, and I look forward to trying it out, but it's not at the UX feedback stage for ChatGPT users yet

I was faced with this issue

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1010)>.

Error code explanation: 500 - Server got itself in trouble.

I ran /Applications/Python 3.<yourโ€‘version>/Install\ Certificates.command on my terminal and it solved my issue :)

I am a Plus subscriber and I get

Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in

What could be the reason? Thank you in advance

Plus user accessing a cloud Ubuntu server via SSH on Windows. Plus user, so running :codex login: and I get a link, Open it in my Windows browser, authenticate, and it tries to send the token to localhost.. What we have here...is a failure to communicate.

Others return the token in the browser and you paste it into the CLI, and away you go. I'm just sitting going nowhere with a "xdg-open: no method available for opening " message.

@jimCresswell I'm in the same situation. I shouldn't have to verify my organization by providing a government ID with photo to a third-party especially since I'm just looking to try this out right now. I wanted to comment so you know you're not alone in that feeling. I've found and am monitoring several other related issues on the repo here that having growing comments sharing they're running into this issue. With that I think this is just a snag in the auth flow and logic right now so my guess is it will get sorted out as the tool progresses and matures.

This is bizarre. As a small business owner I have to upload my ID to Persona instead of just providing certificate of registration/company details. I guess no codex for us then :/

Hi all, thanks for continuing to post examples on this thread. Admittedly, things like auth and billing are sensitive pieces of the system, so we have to get them right and they can only reasonably get done by folks working on our side. I am not at liberty to share specifics, but this has been flagged as a hi-pri issue for Codex CLI internally and there are folks working it.

I'm excited to share more when I can. In the meantime, if you are an API user, for sure using a valid OPENAI_API_KEY environment variable to authenticate is the most reliable option. For those of you using that solution, FYI, you can store the value in $CODEX_HOME/.env or $(pwd)/.env now:

#1653

codex login is starting a local login server on a headless server without a browser.

curl http://localhost:1455/auth/callback?code=.. gives:

Error logging in: login_with_chatgpt subprocess failed:

    Error response
    Error code: 400
    Message: State parameter mismatch.
    Error code explanation: 400 - Bad request syntax or unsupported method.

There should be a prompt to paste a token.

@bolinfest

Is there a version/workaround that is working on a headless server? This is a CLI tool that requires a desktop/browser environment. Could you provide the steps if there are any?

@jimCresswell I'm in the same situation. I shouldn't have to verify my organization by providing a government ID with photo to a third-party especially since I'm just looking to try this out right now. I wanted to comment so you know you're not alone in that feeling. I've found and am monitoring several other related issues on the repo here that having growing comments sharing they're running into this issue. With that I think this is just a snag in the auth flow and logic right now so my guess is it will get sorted out as the tool progresses and matures.

@clarkio thank you for the solidarity!

Hi all, thanks for continuing to post examples on this thread. Admittedly, things like auth and billing are sensitive pieces of the system, so we have to get them right and they can only reasonably get done by folks working on our side. I am not at liberty to share specifics, but this has been flagged as a hi-pri issue for Codex CLI internally and there are folks working it.

I'm excited to share more when I can. In the meantime, if you are an API user, for sure using a valid OPENAI_API_KEY environment variable to authenticate is the most reliable option. For those of you using that solution, FYI, you can store the value in $CODEX_HOME/.env or $(pwd)/.env now:

#1653

Thanks for the update @bolinfest !

I managed to login by port forwarding SSH. Now as Plus user I am getting:

BackgroundEvent(BackgroundEventEvent { message: "stream error: stream disconnected โ”‚ โ”‚before completion: You exceeded your current quota, please check your plan and โ”‚ โ”‚billing details. For more information on this error, read the docs: โ”‚ โ”‚https://platform.openai.com/docs/guides/error-codes/api-errors.; retrying 1/10 in โ”‚ โ”‚203msโ€ฆ" })

with o3
โ”‚BackgroundEvent(BackgroundEventEvent { message: "stream error: stream disconnectedโ–ˆโ”‚ โ”‚before completion: Your organization must be verified to use the model o3. โ–ˆโ”‚ โ”‚Please go to: https://platform.openai.com/settings/organization/general and click โ–ˆโ”‚ โ”‚on Verify Organization. If you just verified, it can take up to 15 minutes for โ–ˆโ”‚ โ”‚access to propagate.; retrying 1/10 in 207msโ€ฆ" })

Image sorry guys. you have so many bugs, that it's nonsense to dig deeper.

When Logging in with plus account:

โฏ Sign in with ChatGPT
  Paste an API key (or set as OPENAI_API_KEY)
TypeError: fetch failed
    at node:internal/deps/undici/undici:13510:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async vbe (file:///******/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:795:5693)
    at async Server.<anonymous> (file://******/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:989:854) {
  [cause]: Error: unable to get local issuer certificate
      at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
      at TLSSocket.emit (node:events:518:28)
      at T0.emit (file:///C:/******/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:332:3119)
      at TLSSocket._finishInit (node:_tls_wrap:1078:8)
      at ssl.onhandshakedone (node:_tls_wrap:864:12) {
    code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
  }
}

When I try to login I get this error:

Route Error (400 ): {
  "error": {
    "message": "No eligible ChatGPT workspaces found.",
    "type": "invalid_request_error",
    "param": null,
    "code": "chatgpt_account_missing"
  }
}

The error I encountered when following the instruction in README.MD:

codex login
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_...
Credit redemption request failed: HTTP Error 400: Bad Request
Successfully logged in

When I'm checking the login status:

โžœ  ~ codex login status
error: unexpected argument 'status' found

Usage: codex-aarch64-apple-darwin login [OPTIONS]

For more information, try '--help'.

version:

โžœ  ~ codex --version   
codex-cli 0.10.0

When i try using the login command i just get a prompt for an api key:

**codex login status

Missing OpenAI API key.

Set the environment variable OPENAI_API_KEY and re-run this command.**

I get this error on my Pro account:

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>.

with codex login after logging in:
first
Image
then when continue:
Image

quite bothersom as a new plus memeber. i'm poor so $20 is already too much for me but i bit the bullet. Now running into this nonsense. blegh!

hope it's fixed soon.

Unfortunately login feature just encapsulates API key creation using your ChatGPT account. This becomes obvious if you look at the description of #1212

  • The codex multitool now has a login subcommand, so you can run codex login, which should write CODEX_HOME/auth.json if you complete the flow successfully. The TUI will now read the OPENAI_API_KEY from auth.json.
  • The TUI should refresh the token if it has expired and the necessary information is in auth.json.
  • There is a LoginScreen in the TUI that tells you to run codex login if both (1) your model provider expects to use OPENAI_API_KEY as its env var, and (2) OPENAI_API_KEY is not set.

But current version of README.MD states that rather unclearly for some reason.

Trying to codex login with my ChatGPT credentials results in the website asking me to link to an API-level organization.

I was hoping to avoid that and use my ChatGPT subscription instead, similar to how Claude can be signed into using a "normal" Claude subscription. Is that not possible with Codex? With Claude, using a normal subscription is much more economical than using an API key. Was hoping the same might be true here.

Oh, also: I'm trying to do codex login on a headless dev box, and the auth flow tries to redirect to localhost:1455 which obviously doesn't work. Is this also not possible?

Looks like I'm going be sticking with Claude for a while longer yet. Was hoping to compare it to GPT-5.

Oh, also: I'm trying to do codex login on a headless dev box, and the auth flow tries to redirect to localhost:1455 which obviously doesn't work. Is this also not possible?

Looks like I'm going be sticking with Claude for a while longer yet. Was hoping to compare it to GPT-5.

You can auth on your laptop, then copy the auth to your server.
(i.e scp /.codex/auth.json youruser@192.1.2.3:/.codex/auth.json)

@aivajoe please try 0.16.0 or later: today was a big release

I hear you on the problems with using it on a headless box. We're moving a bunch of things around in the docs right now, but the current workaround is to copy/scp ~/.codex/auth.json from your local machine (assuming you successfully got through the login flow locally) to the headless box where you want to use the CLI.

I logged in via my pro account but I can still see that API credits were being deducted from my API account. FYI this is my first time installing codex on the machine I am working on. I am using windows 11

getting this

Image

@siddhantparadox For now, you need to explicitly unset OPENAI_API_KEY when running codex, so consider OPENAI_API_KEY= codex

Route Error (400 ): {
"error": {
"message": "No eligible ChatGPT workspaces found.",
"type": "invalid_request_error",
"param": null,
"code": "chatgpt_account_missing"
}
}

Should login by chatGPT account for teams, work? I see contradictory information.

  1. "Who can use the new sign-in flow?
    Free, Plus, and Pro ChatGPT accounts.
    Enterprise, Edu, and Team workspaces are excluded for now." -> https://help.openai.com/en/articles/11381614-codex-cli-and-sign-in-with-chatgpt

but

  1. "After you run codex select Sign in with ChatGPT. You'll need a Plus, Pro, or Team ChatGPT account, and will get access to our latest models, including gpt-5, at no extra cost to your plan." -> https://github.com/openai/codex

Which is then?

Oh, also: I'm trying to do codex login on a headless dev box, and the auth flow tries to redirect to localhost:1455 which obviously doesn't work. Is this also not possible?

Looks like I'm going be sticking with Claude for a while longer yet. Was hoping to compare it to GPT-5.

Having the same issue smh -_-

UPDATE: same error still occurring on v0.19.0 as well.


codex v0.16.0, attempting to authorize a Team account, also seeing the "No eligible ChatGPT workspaces found" 400 error:

Route Error (400 ): {
  "error": {
    "message": "No eligible ChatGPT workspaces found.",
    "type": "invalid_request_error",
    "param": null,
    "code": "chatgpt_account_missing"
  }
}

Tryin to log in with Team Account but error:

Image

Same here with a team account. Oh boy, the impatience when something gets released but doesn't work directly. ๐Ÿ˜‚

MacOS 15.6

Error response

Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>.

Error code explanation: 500 - Server got itself in trouble.

In Firefox, Chrome, and Safari.

@aivajoe please try 0.16.0 or later: today was a big release

I hear you on the problems with using it on a headless box. We're moving a bunch of things around in the docs right now, but the current workaround is to copy/scp ~/.codex/auth.json from your local machine (assuming you successfully got through the login flow locally) to the headless box where you want to use the CLI.

Thank you @bolinfest, this worked for me!

Image

I get this one after writing "codex login" on codex 0.16.0 and proceeding to login on auth.openai.com with my Google account

@siddhantparadox For now, you need to explicitly unset OPENAI_API_KEY when running codex, so consider OPENAI_API_KEY= codex

Can you elaborate on how to do it? I'm having the same problems with the plus account type, it's saying I have an insufficient quota. I have max spending set to 0, and I should be able to use it with a plus account right?

Image

I run codex login and it gives me this:

The model "codex-mini-latest" does not appear in the list of models available to your account. Double-check the spelling (use
  openai models list
to see the full list) or choose another model with the --model flag.

I run codex --help and it says that I should actually be using --login instead of login:

Image

I run codex --login I get:

Image

no api key is in env

i do codex login - it goes to openai , sign in , accept.

back in terminal it says logged in but looks like codex crashed.

launch codex again, looks like working

but i enter any simple prompt, like hi. and it says

๐Ÿ– stream disconnected before completion: stream closed before response.completed

tried login several times, not working

chatgpt plus user

using my google account which is a team admin account - tried with different browsers, hard reload etc - can log in normally to the admin panel but not working with codex get this :

Image

and also managed to get this :

Image

Things are getting quite weird on my end.
The login was successful, when I am under user's home directory, its working fine, but when I go into any specific project directory, it keeps complaining "Incorrect API key provided"

Image

Edit: I have never created such api key so I am really confused as to whats going on here

New installation with npm install -g @openai/codex.
Tried codex login using my ChatGPT Plus account, but encountered the following error message on terminal after successful login in browser:

Error logging in: login_with_chatgpt subprocess failed:

Both MacOS and Ubuntu have the same issue.

Login plus user and: system
โš  Insufficient quota: You exceeded your current quota, please check your plan and billing details. For more
information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors. Manage or
purchase credits at https://platform.openai.com/account/billing.

Hi I tried with gpt plan.
codex -m gpt-4.1
and I am getting

Image

it seems this only work with gpt-5

I was able to authenticate a team account via codex login, but then it selects the free plan, and not my team workspace...

Same issue with dvaldivia

Have logged in using the team plan and i get the following message.

Image

Is the CLI included in team plan? If so how does the billing for the same work?

I'm getting

No eligible ChatGPT workspaces found.

Hi,

I am having an issue., When I installed Codex I get this:

Image

I am running on Windows 11 Pro

Using codex --login and selecting Sign in with ChatGPT gives the following error on our ChatGPT Teams plan with SSO via Entra ID:

Image

Codex Version: 0.19.0

I also have a team account through my employer and getting this error while trying to login:

Route Error (400 ): {
  "error": {
    "message": "No eligible ChatGPT workspaces found.",
    "type": "invalid_request_error",
    "param": null,
    "code": "chatgpt_account_missing"
  }
}

I also have a team account through my employer and getting this error while trying to login:

Route Error (400 ): {
  "error": {
    "message": "No eligible ChatGPT workspaces found.",
    "type": "invalid_request_error",
    "param": null,
    "code": "chatgpt_account_missing"
  }
}

I should mention that I have MFA enabled and can login to regular ChatGPT on Chrome just fine with the team account but the login fails with the above error when trying to login to codex CLI.

I have ChatGPT Pro and I also cannot login (neither codex normal flow and codex login worked), I use MFA.

โžœ  ~ codex login
Starting local login server on http://localhost:1455
. If your browser did not open, navigate to this URL to authenticate:

https://auth.openai.com/oauth/authorize?response_type=code&client_id=xx&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&scope=openid+profile+email+offline_access&code_challenge=xx&code_challenge_method=S256&id_token_add_organizations=true&codex_cli_simplified_flow=true&state=xx
Error logging in: login_with_chatgpt subprocess failed:

browser:

Error response
Error code: 500

Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.

Error code explanation: 500 - Server got itself in trouble.

Tried re-install with cache flush and it didn't help.

Team user here
Route Error (400 ): {
"error": {
"message": "No eligible ChatGPT workspaces found.",
"type": "invalid_request_error",
"param": null,
"code": "chatgpt_account_missing"
}
}

is this somthing i need to ask my company to create?

It basically routes to OpenAI when want to use chat and it can't find the team orgs there... not sure if this intentional or not but for certain is broken.