codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI 0.36 Only -  stream error: unexpected status 404 Not Found

Open akkinra opened this issue 1 year ago • 5 comments

What version of Codex is running?

0.36

Which model were you using?

Any model

What platform is your computer?

Linux

What steps can reproduce the bug?

After authenticating, type any message in the cli

What is the expected behavior?

LLM response

What do you see instead?

⚠️ stream error: unexpected status 404 Not Found: ; retrying 1/5 in 192ms…

Additional information

No response

akkinra avatar Sep 17 '25 12:09 akkinra

Same bug here using vscode extension for macos

aitormendez avatar Sep 18 '25 07:09 aitormendez

Started happening on version 0.39.0 for me--I'm on Azure. Deployment hasn't changed since version .20

kingdomseed avatar Sep 19 '25 14:09 kingdomseed

In my case, the cause was that I had OPENAI_* variables exported in my ~/.zshrc, in particular:

  • OPENAI_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1
  • OPENAI_API_KEY=...
  • OPENAI_MODEL=qwen3-coder-480b-a35b-instruct

That “compatible” endpoint doesn’t implement the streaming route codex uses, so every request ended in 404 Not Found (error: “stream error: unexpected status 404 Not Found”).

Solution: comment out those lines and reload the shell. After that, codex worked again.

# ~/.zshrc
# export OPENAI_API_KEY="sk-REDACTED"
# export OPENAI_BASE_URL="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
# export OPENAI_MODEL="qwen3-coder-480b-a35b-instruct"

aitormendez avatar Sep 27 '25 06:09 aitormendez

For me this is because wire_api = "responses" in my config.toml, I change it as wire_api = "chat" then it works

nlp4whp avatar Oct 13 '25 06:10 nlp4whp

We've made a number of improvements here. Also recommend in the future to do codex logout and codex login, it can happen that the auth token doesn't get refreshed and this fixes it.

tibo-openai avatar Oct 16 '25 20:10 tibo-openai