Skip to content

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

Closed

Description

@bolinfest

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.

Activity

  1. changed the title [-]**Sign in With ChatGPT** functionality needs to be robust against all account types[/-] [+]"Sign in With ChatGPT" functionality needs to be robust against all account types[/+] on Jun 6, 2025
  2. pedrobrantes commented on Jul 3, 2025

    @pedrobrantes

    to save ~/.codex/auth.json

    npx @brantes/codex-get-auth-conf 

    codex-get-auth-conf

  3. oana-ffg commented on Jul 6, 2025

    @oana-ffg
    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.

  4. vtomnet commented on Jul 6, 2025

    @vtomnet

    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
  5. JosTechS commented on Jul 6, 2025

    @JosTechS

    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

  6. Frulfump commented on Jul 7, 2025

    @Frulfump

    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

  7. skenmy commented on Jul 7, 2025

    @skenmy

    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).

  8. juli1 commented on Jul 7, 2025

    @juli1

    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?

  9. sdrymchenko commented on Jul 8, 2025

    @sdrymchenko

    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? 🤔

  10. Frulfump commented on Jul 8, 2025

    @Frulfump

    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

  11. javichu148 commented on Jul 8, 2025

    @javichu148

    When I logging, the result is:

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

    And after:

    Image
  12. niltonvasques commented on Jul 8, 2025

    @niltonvasques

    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
  13. phena109 commented on Jul 9, 2025

    @phena109

    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
    
  14. laricko commented on Jul 9, 2025

    @laricko

    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

  15. 142 remaining items

  16. gabrieuz commented on Aug 28, 2025

    @gabrieuz

    os error 10013

    Image Image
  17. Lurito commented on Aug 28, 2025

    @Lurito
  18. gabrieuz commented on Aug 28, 2025

    @gabrieuz
  19. 0re5ama commented on Aug 29, 2025

    @0re5ama

    I want to log in to two different accounts to use for 2 different code bases for 2 different organizations. I am logged in to one account for a code base. How do I log in to another code base?

    I tried adding a profile say abc and then I did this:
    codex --profile abc login. I got this:

    Token exchange error: error sending request for url (https://auth.openai.com/oauth/token)

    Edit: I logged out of my initial logged in account and looks like I cannot even log back in to either account right now. Using codex online works fine on both.

  20. gpeal commented on Sep 7, 2025

    @gpeal
    Contributor

    I want to log in to two different accounts to use for 2 different code bases for 2 different organizations. I am logged in to one account for a code base. How do I log in to another code base?

    I tried adding a profile say abc and then I did this: codex --profile abc login. I got this:

    Token exchange error: error sending request for url (https://auth.openai.com/oauth/token)

    Edit: I logged out of my initial logged in account and looks like I cannot even log back in to either account right now. Using codex online works fine on both.

    codex logout

  21. jerlendds commented on Sep 8, 2025

    @jerlendds

    I'm also unable to login now with my ChatGPT account and I'm receiving this error:

    Token exchange error: error sending request for url (https://auth.openai.com/oauth/token)

    Previously I was able to successfully use codex but no more, might have to switch back to claude.


    EDIT:

    I have found more error logs by first letting it fail with the first error after signing into OpenAI.com:

    Image

    I then proceeded to click on the link in the codex terminal:

    Image

    opens:

    Image Image
  22. rr- commented on Sep 9, 2025

    @rr-

    I want to log in to two different accounts to use for 2 different code bases for 2 different organizations. I am logged in to one account for a code base. How do I log in to another code base?
    I tried adding a profile say abc and then I did this: codex --profile abc login. I got this:
    Token exchange error: error sending request for url (https://auth.openai.com/oauth/token)
    Edit: I logged out of my initial logged in account and looks like I cannot even log back in to either account right now. Using codex online works fine on both.

    codex logout

    Doesn't help for me, getting the same error as @jerlendds
    What's more I can no longer use my API key so currently there's no way for me to use codex at all.

  23. rzanardi commented on Sep 15, 2025

    @rzanardi

    Same issues as the rest above (Authentication Error. An error occurred during authentication (unknown_error). Please try again.)

  24. rr- commented on Sep 15, 2025

    @rr-

    Linking #3409 – I've resolved the issue on my end by changing the DNS provider. Maybe this advice will work for someone as well.

  25. jerlendds commented on Sep 15, 2025

    @jerlendds

    I can confirm changing my DNS provider in /etc/resolv.conf to cloudflare 1.1.1.1, 1.1.1.2 worked

  26. vasu-gs commented on Oct 5, 2025

    @vasu-gs

    Having issues with getting codex to login via docker dev container (via VS Code). I am using my enterprise login and have the below allowlist of domains (in firewall):

    "api.github.com"
        "github.com"
        "registry.npmjs.org"
        "pypi.org"
        "files.pythonhosted.org"
        "auth.openai.com"
        "platform.openai.com"
    

    Below is the issue I am seeing via the dev tools, do I also have to allow datadog or something else?

    Image
  27. pakrym-oai commented on Oct 16, 2025

    @pakrym-oai
    Contributor

    This issue got very large and contains a lot of problems that were already resolved. If you are still having issues signing in please file a new issue.

  28. locked as resolved and limited conversation to collaborators on Oct 16, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions