Skip to content

Using codex-cli 0.121.0 with openrouter fails #18228

Closed as not planned
Closed as not planned

Description

@johnynek

What version of Codex CLI is running?

0.121.0

What subscription do you have?

pro

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Darwin 25.3.0 arm64 arm

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

ghostty

What issue are you seeing?

I did the official suggestions: https://openrouter.ai/docs/guides/coding-agents/codex-cli

I can start and when I issue any message at the cli I get:

■ {"error":{"code":"invalid_prompt","message":"Invalid Responses API request"},"metadata":{"raw":"[\n  {\n    \"code\": \"invalid_union\",\n    \"errors\":[\n      [\n        {\n          \"code\": \"invalid_union\",\n          \"errors\": [],\n          \"note\": \"No matching discriminator\",\n\"discriminator\": \"type\",\n          \"path\": [\n            \"type\"\n          ],\n          \"message\": \"Invalid input\"\n        }\n      ],\n[\n        {\n          \"code\": \"invalid_value\",\n          \"values\": [\n            \"openrouter:datetime\"\n          ],\n          \"path\": [\n\"type\"\n          ],\n          \"message\": \"Invalid input: expected \\\"openrouter:datetime\\\"\"\n        }\n      ],\n      [\n        {\n\"code\": \"invalid_value\",\n          \"values\": [\n            \"openrouter:image_generation\"\n          ],\n          \"path\": [\n\"type\"\n          ],\n          \"message\": \"Invalid input: expected \\\"openrouter:image_generation\\\"\"\n        }\n      ],\n      [\n        {\n\"code\": \"invalid_value\",\n          \"values\": [\n            \"openrouter:experimental__search_models\"\n          ],\n          \"path\": [\n\"type\"\n          ],\n          \"message\": \"Invalid input: expected \\\"openrouter:experimental__search_models\\\"\"\n        }\n      ],\n      [\n{\n          \"code\": \"invalid_value\",\n          \"values\": [\n            \"openrouter:web_search\"\n          ],\n          \"path\": [\n\"type\"\n          ],\n          \"message\": \"Invalid input: expected \\\"openrouter:web_search\\\"\"\n        }\n      ]\n    ],\n    \"path\": [\n\"tools\",\n      15\n    ],\n    \"message\": \"Invalid input\"\n  }\n]"}}

When I downgrade back to 0.120.0 it works as expected.

What steps can reproduce the bug?

Install 0.121.0, set up a ~/.codex/config.toml matching: https://openrouter.ai/docs/guides/coding-agents/codex-cli and then start with your openrouter API key.

What is the expected behavior?

It should respond to the message without hitting any errors.

Additional information

No response

Activity

  1. added
    bug
    on Apr 16, 2026
  2. added
    CLI
    custom-model
    on Apr 16, 2026
  3. removed
    CLI
    on Apr 16, 2026
  4. etraut-openai commented on Apr 16, 2026

    @etraut-openai
    Contributor

    Please report the problem to the openrouter maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcustom-model

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions