
Did you know that OpenRouter can automatically optimize your LLM requests based on what's most important to you? Whether you're looking for the lowest cost, fastest response times, or specific provider requirements, our API gives you control.
How Default Provider Routing Works
By default, OpenRouter load balances your requests across multiple providers, prioritizing the most cost-effective options while ensuring reliability. Here's what happens behind the scenes:
- We filter out providers experiencing recent outages
- We load-balance across providers, weighted by price (lower prices = more likely to get routed to)
- If needed, we'll fall back to other providers as backup
This approach balances affordability and reliability, without any configuration needed.
Optimize for Price with One Parameter
If budget is your top concern, you can prioritize the absolute lowest-cost provider by adding a sort to your API request:
"provider": { "sort": "price" }Or use our shorthand by appending :floor to any model name:
model: "anthropic/claude-3.7-sonnet:floor"
Need Speed? Prioritize Token Throughput
When generation time matters most, you can prioritize the providers that generate the most tokens/:
"provider": { "sort": "throughput" }Or simply use our :nitro shortcut:
model: "anthropic/claude-3-opus:nitro"
Set a Maximum Price While Maximizing Speed
You can combine approaches to get the best of both worlds. For example, to get the fastest possible provider within a certain price range:
{
"model": "meta-llama/llama-3.3-70b-instruct:nitro",
"max_price": {"prompt": 3.0, "completion": 5.0}
}This will select the highest-throughput provider for Llama 3.3 70b Instruct, but only if the price is under $3 per million input tokens and $5 per million output tokens.
Want More Control?
You can further customize routing by:
- Specifying an exact provider order to try
- Excluding specific providers
- Setting requirements for parameter support
- Filtering by data collection policies
Check out our full provider routing documentation to learn more about these advanced options.
Feel free to reply to this email if you have questions or need help.
Unsubscribe from future emails.