blank output with workaround forced providers

Resolved 💬 2 comments Opened May 31, 2025 by mirage335 Closed Aug 7, 2025

What version of Codex is running?

0.1.2505172129

Which model were you using?

openai/codex-mini, openai/o4-mini, etc

What platform is your computer?

Docker containers, WSL distributions, etc.

What steps can reproduce the bug?

unset OPENAI_API_KEY
unset OPENROUTER_API_KEY
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="sk-***-21"
codex --model openai/o4-mini
codex --model openai/codex-mini

What is the expected behavior?

Inputting a prompt after codex starts or as an additional CLI parameter should cause normal output.

What do you see instead?

Thinking... for a few seconds. Then nothing. Unless using the default OpenAI provider.

Additional information

This workaround comes from https://github.com/openai/codex/issues/987?utm_source=chatgpt.com .

Attempting to use the OPENROUTER_API_KEY otherwise (ie. '--provider openrouter --model openai/codex-mini') with of course does not work.

Also I find the '--full-auto' command line parameter useful in some environments, it is potentially a powerful convenience to have codex working everywhere and able to correct issues within a VPS, Docker container, etc.

Alternative providers in case of downtime, as well as experimenting with other models for the same reason, is important.

Ideally, it would be very nice if these commands just worked normally:

export OPENROUTER_API_KEY="sk-***-21"
codex --approval-mode full-auto --provider openrouter --model openai/codex-mini

By the way, codex really does seem to have a lot of great potential, I hope this gets resolved soon.

View original on GitHub ↗

2 Comments

da1z · 1 year ago

I was investigating this issue with vercel v0 model. I am not sure if it is provider bug or codex should handle completion event differently but with v0 problem is it never sends event with type response.completed

codex-maintainers · 1 year ago

Thank you for the feedback! Please try the latest version of Codex CLI to see if the issue persists. We're actively working on improvements, and we'd love to hear if this is still a problem. If it is, feel free to report back or contribute to the codex-rs/ implementation. More details can be found in our project update.