Routing
Provider preferences
Per-request provider routing options
Provider preferences
Pass a provider object in the request body to influence routing (OpenRouter-compatible field names):
{
"model": "openai/gpt-4o",
"provider": {
"order": ["anthropic", "openai"],
"only": ["openai", "anthropic"],
"ignore": ["ollama"],
"sort": "price",
"allow_fallbacks": true
},
"messages": [{ "role": "user", "content": "Hi" }]
}| Field | Description |
|---|---|
order | Prefer providers in this order when sorting candidates |
only | Allow only listed providers |
ignore | Exclude listed providers |
sort | price (lowest catalog rate first), throughput / latency (reserved; falls back to order) |
allow_fallbacks | When false, disables automatic model failover |
Provider preferences are combined with your project allowlist and key hierarchy (project → org → platform keys).
The optional provider_preferences feature key exists for future metering; default price is 0.