OpenAI rejected the request
What version of Codex is running?
v0.1.2504251709
Which model were you using?
Qwen/Qwen3-235B-A22B
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64 WSL2 ubuntu
What steps can reproduce the bug?
codex --provider one -m Qwen/Qwen3-235B-A22B --approvalMode full-auto
I'm using a local LLM service called one-api. When I make a simple request for a function, "codex" always thinks for a while and looks through a lot of code before giving this error.
What is the expected behavior?
implement the function correctly
What do you see instead?
system ⚠️ OpenAI rejected the request. Error details: Status: 400, Code: invalid_type, Type: invalid_request_error, Message: 400 Invalid type for 'messages.[0].content': expected one of a string or array of objects, but got an object instead. (request id: 2025042922302269393158109822363). Please verify your settings and try again.
Additional information
No response
me too
me too OpenAI rejected the request. Error details: Status: 404, Code: unknown, Type: unknown, Message: 404 status code (no body). Please verify your settings and try again.
@skywalk163 404 is prob a wrong base url.
Folks, it would be useful to be able to see a trace of the HTTP request that codex made when it gets a model error like this. I'm trying to debug another provider where some models work fine and others crap out with HTTP 400 with no body, and I'd love it if --debug=true would render the raw requests + headers and responses.
Would it be useful if I pushed up a PR?
Gemini 2.5 Flash is not working as well, getting this same issue as well as errors with tool calls.
@natikgadzhi +1
is your config file
Try removing the ~/.codex/config.json, in favor of config.yaml
In debug its stuck at Failed to parse JSON result and later failure.
I am using openrouter and Qwen/Qwen3-235B-A22B and asked codex to create a hello world all in python
Thanks for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, let us know.