Can't use codex when using api keys

Resolved 💬 2 comments Opened Aug 27, 2025 by Nico-M Closed Aug 28, 2025

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?

  1. set the api key by export OPENAI_API_KEY="xxx"
  2. codex
  3. select number 2
  4. repeat to remind me : To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment
  5. 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_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗