codex icon indicating copy to clipboard operation
codex copied to clipboard

Cannot sign in with ChatGPT - no_valid_organizations

Open greinacker opened this issue 1 year ago • 17 comments

What version of Codex is running?

0.1.2505172129

Which model were you using?

none

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

Run codex --login, then select Sign in with ChatGPT. When the browser pops up, sign into ChatGPT account, then click Continue.

What is the expected behavior?

Presumably, I would expect it to sign me in with codex-CLI.

What do you see instead?

I see the following in the browser:

Oops, an error occurred!

Route Error (400 ): { "error": { "message": "You do not have any valid organizations.", "type": "invalid_request_error", "param": null, "code": "no_valid_organizations" } }

Additional information

Not sure what's happening. My ChatGPT account has been on Plus for about a month, and I upgraded to Pro a couple of days ago. I have a single organization ("Personal"), and it is Verified. Under Billing, I have auto-recharge turned off, and I do have a payment method entered. My current balance is $0.91 (lol), but it's been reloaded multiple times before now.

The codex app just continues to show the "Waiting for authentication" message -

( ● ) Waiting for authentication… ctrl + c to quit

greinacker avatar May 22 '25 21:05 greinacker

I found out what the problem was. I had been looking for a few days to find out why I couldn't use other providers. The reason is that I didn't know how to distinguish and separate the OpenAI API platform from the rest. For example, when I entered

codex --provider openrouter,

a formula from auth.json from openai popped up and then I had valid-organizations - so in your case, you may have mixed up config.json if this happens with codex --login alone (delete auth.json and config.json from .codex config folder)

I'm just about to work on this problem

notlikejuice avatar May 23 '25 01:05 notlikejuice

Hello! My config.json is pretty empty:

{
  "model": ""
}

I tried deleting it, as you mentioned, and trying to login again, but I see the same error. Note that the error is showing up on the web site right after login and clicking "continue" to connect, rather than in the cli app.

greinacker avatar May 23 '25 01:05 greinacker

Getting this as well now. I think there seems to be issues with users who have had an API billing account already setup for quite some time.

Balaxxe avatar May 23 '25 06:05 Balaxxe

Also having this issue

crunchy234 avatar May 23 '25 10:05 crunchy234

I am also having this issue.

estsauver avatar May 23 '25 11:05 estsauver

Also the exact same issue

riki137 avatar May 23 '25 11:05 riki137

Same issue

Rohan-Muslekar avatar May 23 '25 11:05 Rohan-Muslekar

Same here

SEDIDEL avatar May 23 '25 16:05 SEDIDEL

Same here. I'm paying Pro, have been for over 2 months, can someone please take this seriously?

godely avatar May 23 '25 16:05 godely

I reported it with the support bot at openai.com, and after a few back and forths, it suggested keeping an eye on the issue here. 😂 So, hopefully the right people are here who can fix this!

greinacker avatar May 23 '25 17:05 greinacker

same here. Can codex fix its bug? 😆

alvis avatar May 23 '25 17:05 alvis

Same issue here, I reported it.. I can't access codex on web either.. so along with this --login issue I also get these.

Image Image Image Image Image

jellomld avatar May 23 '25 17:05 jellomld

also having this issue

Image

colindotfun avatar May 23 '25 21:05 colindotfun

FYI, I just tried this again today, and it's working now. If you're getting the 400 error with no_valid_organizations, give it another try! If a few of you can confirm it's working for you too, I'll close this issue...

greinacker avatar May 24 '25 20:05 greinacker

@greinacker it works on the web browser but look at your terminal - do you still see 400? I do on both my Mac and Windows (WSL) devices.

Balaxxe avatar May 24 '25 20:05 Balaxxe

@greinacker it works on the web browser but look at your terminal - do you still see 400? I do on both my Mac and Windows (WSL) devices.

No - it's all working on my side. It even added the API credits to my account, although I assume that's unrelated.

Bummer it's still giving you trouble. :(

greinacker avatar May 24 '25 20:05 greinacker

https://github.com/openai/codex/pull/1118

I would like to suggest that you try my latest commit, as it resolved my issues with valid_orgs, though it did not fully address the matter of the --free flag.

notlikejuice avatar May 26 '25 08:05 notlikejuice