Codex 0.149.0 drops API keys stored in `auth.json`, causing 401 Unauthorized "Missing API key"

Resolved 💬 2 comments Opened Aug 21, 2026 by GT-610 Closed Aug 21, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.149.0

What subscription do you have?

ChatGPT Pro $200

Which model were you using?

gpt-5.6-sol, gpt-5.6-terra

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell 7.6.5 in Windows Terminal

Codex doctor report

Now I've downgraded to 0.148.0 and continue my work, so it's not available.

What issue are you seeing?

After updating to 0.149.0, I tried to resume my previous work but encountered the error unexpected status 401 Unauthorized: error:{"Missing API key"}. I hadn't changed any Codex settings. I rolled back to 0.148.0, and then continued working as usual, and everything worked fine.

I logged in with echo $env:OPENAI_API_KEY | codex login --with-api-key.

Latest Codex Desktop also has this bug.

What steps can reproduce the bug?

  1. Upgrade to 0.149.0
  2. Run codex and continue a session
  3. It shows unexpected status 401 Unauthorized and Missing API key error message.

What is the expected behavior?

Sessions should work normally.

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 7 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39820

Powered by Codex Action

Hero2633 · 7 days ago

在config.toml文件中的[model_providers.ID] 字段下面添加:
requires_openai_auth = true可以解决

<img width="1241" height="635" alt="Image" src="https://github.com/user-attachments/assets/ddd8779e-9d57-4656-b245-b65cf844d39f" />