Error occurred when connecting to the OpenRouter model
What version of Codex is running?
codex-cli 0.65.0
What subscription do you have?
openrouter api key
Which model were you using?
openai/gpt-5.1-codex-max
What platform is your computer?
_No response_
What issue are you seeing?
my ~/.codex/config.toml is bellow:
model_provider="openrouter"
model="openai/gpt-5.1-codex-max"
[model_providers.openrouter]
name="openrouter"
base_url="https://openrouter.ai/api/v1"
env_key="OPENROUTER_API_KEY"
What does the following error message mean?
{"error":{"message":"Provider returned error","code":400,"metadata":
{"raw":"{\n \"error\": {\n \"message\": \"Invalid 'input[4].name':
empty string. Expected a string with minimum length 1, but got an
empty string instead.\",\n \"type\": \"invalid_request_error\",
\n \"param\": \"input[4].name\",\n \"code\":
\"empty_string\"\n }\n}","provider_name":"OpenAI"}},"user_id":"user_35x92YP6MlA
GxK4s537Io3nKbei"}
What steps can reproduce the bug?
Add the following lines to ~/.codex/config.toml:
model_provider = "openrouter"
model = "openai/gpt-5.1-codex-max"
[model_providers.openrouter]
name="openrouter"
base_url="https://openrouter.ai/api/v1"
env_key="OPENROUTER_API_KEY"
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
ok, After adding "wire_api = 'responses'" in config.toml, the error disappeared. However, my response was too slow. I waited for ten minutes for this result
<img width="572" height="136" alt="Image" src="https://github.com/user-attachments/assets/717322db-28ee-495e-a8d4-9ebdc502264d" />
This has been fixed in the latest prerelease version
0.66.0-alpha.11if you want to give it a try.