Cannot sign in with ChatGPT - no_valid_organizations

Resolved 💬 17 comments Opened May 22, 2025 by greinacker Closed May 27, 2025

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

View original on GitHub ↗

17 Comments

notlikejuice · 1 year ago

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

greinacker · 1 year ago

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.

Balaxxe · 1 year ago

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.

crunchy234 · 1 year ago

Also having this issue

estsauver · 1 year ago

I am also having this issue.

riki137 · 1 year ago

Also the exact same issue

Rohan-Muslekar · 1 year ago

Same issue

SEDIDEL · 1 year ago

Same here

godely · 1 year ago

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

greinacker · 1 year ago

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!

alvis · 1 year ago

same here. Can codex fix its bug? 😆

jellomld · 1 year ago

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

<img width="400" alt="Image" src="https://github.com/user-attachments/assets/7949fa36-fbcf-4f67-aa02-4917f8e5f6ad" />
<img width="400" alt="Image" src="https://github.com/user-attachments/assets/770abcf5-d480-4ec9-a286-34cfe129c622" />
<img width="400" alt="Image" src="https://github.com/user-attachments/assets/236f901a-c675-42c9-bb2d-2d7dfd6cd1af" />
<img width="400" alt="Image" src="https://github.com/user-attachments/assets/431de2d6-dc2c-4b1e-b954-bb94af42332d" />
<img width="400" alt="Image" src="https://github.com/user-attachments/assets/bcd9cb7c-311e-4e93-b089-4e8d47ff89f4" />

colindotfun · 1 year ago

also having this issue

!Image

greinacker · 1 year ago

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

Balaxxe · 1 year ago

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

greinacker · 1 year ago
@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. :(

notlikejuice · 1 year ago

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.