Authenticated with URL (didn't work), and now I can't "change" to a working API key

Resolved 💬 1 comment Opened Jun 11, 2025 by altjx Closed Jun 11, 2025

What version of Codex is running?

0.1.2505172129

Which model were you using?

gpt-4.1

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

  1. Launch codex via CLI.
  2. When prompted to authenticate, select the URL option.
  3. Select an organization that does not have any API "credits" (aka $0 balance)
  4. Codex says insufficient quota exceeded.
  5. Exit codex
  6. Export an API key from an OpenAI organization that has API credits.
  7. Ask codex something in the prompt.
  8. Error - insufficient quota exceeded

What is the expected behavior?

When exporting OPENAI_API_KLEY with a valid API key, it should use that instead of whatever "built in" configuration it may have from the previous authentication session.

If I use this exact same OpenAI API key into other tools -- Cline, Roo Code, etc. -- it works just fine. So clearly the CLI Codex tool _isn't_ using this API key or there's something missing in the documentation or help menu to provide a different configuration to get codex to understand the new authentication process.

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗