🖐 unexpected status 400 Bad Request

Resolved 💬 4 comments Opened Aug 19, 2025 by Qualzz Closed Sep 6, 2025
💡 Likely answer: A maintainer (dylan-hurd-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.22.0

Which model were you using?

gpt-5

What platform is your computer?

Linux 6.14.0-27-generic x86_64 x86_64

What steps can reproduce the bug?

codex just output:

🖐 unexpected status 400 Bad Request: {
"error": {
"message": "Invalid type for 'input': expected string, but got array.",
"type": "invalid_request_error",
"param": "input",
"code": "invalid_type"
}
}

no matter the request

Additional information

I'm logged in using my GPT pro subscription.

View original on GitHub ↗

4 Comments

Qualzz · 1 year ago

I found the issue. Codex works fine in other folders, but if there’s a .env file in the folder containing an OPENAI_BASE_URL variable, Codex seems to pick it up, which ends up interfering with its queries.

adamsvoboda · 1 year ago
I found the issue. Codex works fine in other folders, but if there’s a .env file in the folder containing an OPENAI_BASE_URL variable, Codex seems to pick it up, which ends up interfering with its queries.

Exact same issue here! Thanks for the fix.

D1lanZ · 1 year ago

+1
Same issue. renamed the .env file fixed the issue instantly

dylan-hurd-oai contributor · 11 months ago

While the env var is different, the root cause appears to be the same as #2341 - going to close as duplicate