Bug: 400 Bad Request "invalid_request_error" when using gpt-5.4/gpt-5.3-codex models

Resolved 💬 1 comment Opened May 4, 2026 by Domingos-Daniel Closed May 4, 2026

What version of Codex CLI is running?

OpenAI Codex (v0.128.0)

What subscription do you have?

OPENAI COMPATIBLE API KEY

Which model were you using?

gpt-5.4, gpt-5.3-codex

What platform is your computer?

"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })" Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

Powershell 5.1.26100.8115 and 7+

What issue are you seeing?

Whenever I select the models gpt-5.4 or gpt-5.3-codex via a custom API gateway (Piramyd), the first message sent returns a 400 Bad Request error. The system seems to fail during the tool/function calling initialization.

Error Message:

JSON
{
"error": {
"message": "Bad request. Please check the parameters sent.",
"type": "invalid_request_error",
"code": "invalid_request"
}
}
Context & Logs:
The CLI (v0.128.0) attempts to run initial discovery commands (like git status or ls) and fails to sync the call_id with the provider.

Provider: Custom OpenAI-compatible API (Piramyd)

Environment: Windows PowerShell / VS Code

Permissions: YOLO mode enabled

Steps to Reproduce:

Run codex chat (or claude-piramyd).

Select model gpt-5.4 or gpt-5.3-codex.

Send any prompt (e.g., "Hello").

The CLI initiates a tool call, and the API returns the 400 error immediately after the first tool execution.

What steps can reproduce the bug?

Uploaded thread: 019df262-3727-7431-9381-cdb448d61328

What is the expected behavior?

The CLI should correctly format the tool_outputs or function_call parameters to match the expected schema of the API gateway, or allow disabling automatic tool discovery to prevent parameter mismatch.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗