Skip to content

Custom chat completion API not working after upgrade to codex >=0.59 #7051

@michaelnny

Description

@michaelnny

What version of Codex is running?

0.59 to 0.61

What subscription do you have?

plus

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Our working environment requires us to access all gpt models through our central internal proxy server, and this server only support chat completion API. Thus, I'm using codex with chat completion mode with our interall proxy API to access the gpt-5 model, after upgrade to version >= 0.59, codex no longer works.

As we ran into error related to tool calls (this error is from 0.61, other version had similar error):

unexpected status 400 Bad Request: {"error":{"code":null,"message":"An assistant message with 'tool_calls' must be followed by tool messages
responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_F5k9261v7RiXieQiIKHYARcl","param":"messages.
[5].role","type":"invalid_request_error"}}

Already switched versions between 0.59 to 0.61, but none of it works. Right now the only working version is 0.58.

These are the config file in ~/.codex/config.toml:

[profiles.custom_provider]
model = "gpt-5"
model_provider = "custom provider"
model_reasoning_effort = "high"
forced_login_method = "api"

[model_providers.custom_provider]
name = "Internal LLM Proxy"
base_url = "http://xxxxx:8080/v1"  
wire_api = "chat"                        
env_key = "XXX_OPENAI_API_KEY"        

What steps can reproduce the bug?

launch codex (>=0.59) with custom chat completion api

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingcustom-modelIssues related to custom model providers (including local models)tool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions