Skip to content

[Bug]: OpenRouter model selected from Admin UI list fails Test Connect with 'is not a valid model ID' #24795

Description

@Sunsilkk

What happened?

In LiteLLM Admin UI, when adding a model with provider OpenRouter, I selected openrouter/google/gemini-2.5-flash directly from the provider model list/dropdown.

When I click Test Connect, the request fails with:

OpenrouterException - {"error":{"message":"openrouter/google/gemini-2.5-flash is not a valid model ID","code":400},"user_id":"..."}

This does not appear to be a manual input error, because the model was selected from the OpenRouter model list in the UI.

Why this seems incorrect

As of March 30, 2026, google/gemini-2.5-flash still exists on OpenRouter:
https://openrouter.ai/google/gemini-2.5-flash

So either:

  1. LiteLLM Admin UI is surfacing a stale or invalid OpenRouter model ID.
  2. The Test Connect flow is sending a model name format that OpenRouter rejects.
  3. There is a mismatch between what the dropdown returns and what the backend/OpenRouter expects.

Reproduction

  1. Open LiteLLM Admin UI.
  2. Go to Models + Endpoints -> Add Model.
  3. Choose provider: OpenRouter.
  4. Select model from the provider model list: openrouter/google/gemini-2.5-flash.
  5. Click Test Connect.

Actual result

Connection test fails with:

OpenrouterException - {"error":{"message":"openrouter/google/gemini-2.5-flash is not a valid model ID","code":400}}

Expected result

If the model is selectable from the OpenRouter list, Test Connect should succeed, or the UI should not offer that model.

API request shown by the UI

curl -X POST \
  https://openrouter.ai/api/v1/chat/completions \
  -H 'HTTP-Referer: https://litellm.ai' \
  -H 'X-Title: LiteLLM' \
  -H 'Authorization: Bearer <redacted>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "openrouter/google/gemini-2.5-flash",
    "messages": [
      {
        "role": "user",
        "content": "hello"
      }
    ]
  }'

Environment

  • LiteLLM version: v1.82.3
  • Provider: OpenRouter
  • Flow: Admin UI -> Add Model -> select from list -> Test Connect

Notes

This looks related to earlier OpenRouter model ID issues, but this specific bug is about a model selected directly from the Admin UI list still failing validation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions