Skip to main content

Model Routing

You can give the platform several candidate models instead of one, and constrain which of them may be used. Candidates are validated and filtered before a generation run starts, so an impossible request fails immediately in the HTTP response rather than asynchronously, minutes later.

Set models for a fallback chain, and modelRoutingFilter to require capabilities — a minimum context window, image input, a cost ceiling. Candidates that fail are dropped; generation proceeds with whatever survives. If nothing survives, you get an error up front.

Setting no filter is a valid choice and changes nothing about how a thread behaves.

Allowed models

Read this first: the platform accepts a curated allowlist, not the full OpenRouter catalog. Everything else on this page filters within this set.

Gemini — the whole family

Any google/gemini-* model is accepted. You don't need to wait for a specific version to be added here: we serve Gemini on Vertex AI, so a model released after this page was written works the moment Google ships it.

Model IDNotes
google/gemini-3.6-flashCurrent flash generation
google/gemini-3.5-flashPrevious flash generation
google/gemini-3.1-flash-liteSmallest and cheapest
google/gemini-3.1-pro-previewPro tier, reasoning-capable
google/gemini-3-flash-previewPreview build

These are examples, not the limit — any other Gemini ID is accepted too.

One exception: Gemini 2.x is not accepted. google/gemini-2.5-flash, google/gemini-2.0-flash, and every other google/gemini-2* ID is rejected, because Gemini 2 is deprecated on Vertex AI. Use a Gemini 3 model instead.

The prefix covers Gemini only — other Google models such as google/gemma-* are not accepted.

Other providers

These are matched exactly, so this list is the complete set:

Model IDProvider
anthropic/claude-sonnet-5Anthropic
anthropic/claude-sonnet-4.6Anthropic
deepseek/deepseek-v4-flashDeepSeek
deepseek/deepseek-v4-proDeepSeek
openrouter/autoRouter — picks a model for you

Requesting anything else — in model or any entry of models — fails immediately:

{
"code": "MODEL_INVALID",
"message": "model \"openai/gpt-5\" is not allowed",
"reason": "MODEL_NOT_ALLOWED"
}

OpenRouter variant suffixes are fine — :nitro, :free, and :floor are stripped before the check, so google/gemini-3.6-flash:nitro is allowed. Leaving model unset is also fine; you get the platform default.

The same allowlist applies when storing a per-user default via update-generation-config.

Where to next

PageCovers
FilteringWhere to set a filter, every field, and how they combine
Error HandlingThe synchronous error shape and each error code
ExamplesLong-context, cost-capped, and structured-output recipes