The Auto Router (openrouter/auto) automatically selects the best model for your prompt, powered by NotDiamond.
Instead of manually choosing a model, let the Auto Router analyze your prompt and select the optimal model from a curated set of high-quality options. The router considers factors like prompt complexity, task type, and model capabilities.
Set your model to openrouter/auto:
The response includes the model field showing which model was actually used:
The Auto Router pins both the selected model and provider so that subsequent requests in the same conversation route to the same place. This ensures consistent behavior within a conversation and maximizes prompt cache hits.
Stickiness applies at two levels:
session_id): When you include a session_id, stickiness kicks in on the first successful response — even before cache usage is observed. This is recommended for multi-turn conversations and agent workflows where you want consistent routing from the start.In both cases, the cache expires after 5 minutes of inactivity. Each successful request resets the timer. If the cached provider returns an error, the cache is not updated, allowing the next request to be re-routed.
For full details on how sticky routing works, cache key granularity, and the x-session-id header, see Provider Sticky Routing.
session_idUnlike using a fixed model, the Auto Router selects a different model each time based on your prompt. Session stickiness is especially important here because it also pins the model selection — not just the provider. Without it, you could get different models on each turn of a conversation, leading to inconsistent behavior and wasted prompt cache.
The Auto Router selects from a curated set of high-quality models including:
Model slugs change as new versions are released. The examples below are current as of December 4, 2025. Check the models page for the latest available models.
anthropic/claude-sonnet-4.5)anthropic/claude-opus-4.5)openai/gpt-5.1)google/gemini-3.1-pro-preview)deepseek/deepseek-v3.2)The exact model pool may be updated as new models become available.
You can restrict which models the Auto Router can select from using the plugins parameter. This is useful when you want to limit routing to specific providers or model families.
Use wildcard patterns to filter models. For example, anthropic/* matches all Anthropic models:
You can also configure default allowed models in your Plugin Settings:
These defaults apply to all your API requests unless overridden per-request.
When no patterns are configured, the Auto Router uses all supported models.
Control how aggressively the Auto Router optimizes for cost vs. quality using the cost_quality_tradeoff parameter (integer, 0–10):
The default is 7, which balances cost savings with strong output quality.
You can also set a default tradeoff in your Plugin Settings under Auto Router. The per-request value overrides this default.
You pay the standard rate for whichever model is selected. There is no additional fee for using the Auto Router.
messages format (not prompt)