What version of Codex is running?
codex-cli 0.30.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
- Install Codex CLI
0.30.0
- Set a valid environment variable
OPENAI_API_KEY
- Run
codex --config preferred_auth_method='chatgpt'
- Login with ChatGPT Plus, Pro or Team plan account and close the session.
- Run
codex --config preferred_auth_method='apikey'
- Select
2. Provide your own API key
What is the expected behavior?
Codex CLI is usable with API key even with ChatGPT subscription login is active.
What do you see instead?
The message "To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment" continues to be displayed even with OPENAI_API_KEY is set and codex session doesn't start.
Additional information
Related issues
I confirmed this occurs with the latest 0.30.0 in my environment.
What version of Codex is running?
codex-cli 0.30.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
0.30.0OPENAI_API_KEYcodex --config preferred_auth_method='chatgpt'codex --config preferred_auth_method='apikey'2. Provide your own API keyWhat is the expected behavior?
Codex CLI is usable with API key even with ChatGPT subscription login is active.
What do you see instead?
The message "To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment" continues to be displayed even with
OPENAI_API_KEYis set and codex session doesn't start.Additional information
Related issues
I confirmed this occurs with the latest 0.30.0 in my environment.