Can't use codex when using api keys
Resolved 💬 2 comments Opened Aug 27, 2025 by Nico-M Closed Aug 28, 2025
💡 Likely answer: A maintainer (seratch, member)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.25.0
Which model were you using?
gpt-5
What platform is your computer?
MINGW64_NT-10.0-26100 3.5.7-463ebcdc.x86_64 x86_64 unknown
What steps can reproduce the bug?
- set the api key by export OPENAI_API_KEY="xxx"
- codex
- select number 2
- repeat to remind me : To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment
- control+c can entry the codex, but it returns 401
<img width="1238" height="452" alt="Image" src="https://github.com/user-attachments/assets/18c62136-d8e5-426f-ad37-1fdbc0cd9d04" />
What is the expected behavior?
after run codex, it should be working
What do you see instead?
_No response_
Additional information
_No response_
2 Comments
Duplicate https://github.com/openai/codex/issues/2733
Closing as duplicate