Skip to content

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

Closed

Description

@GT-610

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

Activity

  1. added
    bug
    on Aug 21, 2026
  2. added
    CLI
    windows-os
    auth
    session
    on Aug 21, 2026
  3. github-actions commented on Aug 21, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. Hero2633 commented on Aug 21, 2026

    @Hero2633

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

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIauthbugsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions