OpenAI rejected the request

Resolved 💬 10 comments Opened Apr 29, 2025 by CALMCRAZY Closed Aug 7, 2025

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.

!Image

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_

View original on GitHub ↗

10 Comments

qcname · 1 year ago

me too

skywalk163 · 1 year ago

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.

natikgadzhi · 1 year ago

@skywalk163 404 is prob a wrong base url.

natikgadzhi · 1 year ago

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?

xandertreat · 1 year ago

Gemini 2.5 Flash is not working as well, getting this same issue as well as errors with tool calls.

JoelAlexander · 1 year ago

@natikgadzhi +1

nabz-polo · 1 year ago

is your config file

fabiogalera · 1 year ago

Try removing the ~/.codex/config.json, in favor of config.yaml

Rishang · 1 year ago

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

codex-maintainers · 11 months ago

Thanks for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, let us know.