Ask Cat › AI Tool Summary › OpenRouter
How to Pin OpenRouter to the Cheap Provider: order, only, sort and max_price, with JSON You Can Paste (2026 Guide)
Article last updated:2026-09-05
The most common misconception about OpenRouter: “it automatically picks the cheapest provider for me.” It does not.
The documented default is price-based load balancing: selection is weighted by the inverse square of price, with recently unstable providers deprioritised. The official example is a US$1/M provider receiving 9x the traffic of a US$3/M provider.
Nine times is a lot. It is not all. Your request can still land on the expensive endpoint — and the gap between endpoints for one model can be 4x (GPT-6 Astra ranges from US$25 to US$100 per million output tokens).
Here is how to pin it down.
1. Everything lives under provider
Every technique below is an object called provider in the request body. Each snippet is copy-paste ready.
2. Technique one: explicit order
Try providers in the order you list:
{
"provider": {
"order": ["anthropic", "openai", "together"]
}
}
Note: by default, if everything on your list fails, it still falls back to providers not on the list. To prevent that entirely, see section 6.
Use when: you have a clear first choice but accept a backup.
3. Technique two: allowlist and blocklist
Only these providers:
{
"provider": {
"only": ["azure", "openai"]
}
}
Or simply exclude one:
{
"provider": {
"ignore": ["deepinfra"]
}
}
Use when: compliance or data residency forces a specific cloud, or you have measured one provider as unreliable.
4. Technique three: sort by price
{
"provider": {
"sort": "price"
}
}
Three values are available:
| Value | Effect |
|---|---|
"price" | Prioritises lowest cost |
"throughput" | Prioritises highest tokens per second |
"latency" | Prioritises lowest response time |
The important side effect: sort disables load balancing and enforces sequential routing. So if what you want is “always the cheapest”, this is the setting.
Use when: batch work with nobody waiting → price; a user staring at the screen → latency.
5. Technique four: a hard price ceiling
{
"provider": {
"max_price": {
"prompt": 1.0,
"completion": 2.0,
"request": 0.5,
"image": 0.1
}
}
}
Providers above the threshold are not used — the request fails rather than quietly routing somewhere more expensive.
This is the strongest safeguard of the four. The first three express a preference for cheap. This one forbids expensive. For unattended automation, add it by default.
6. Turning off fallbacks
{
"provider": {
"allow_fallbacks": false
}
}
The default is true. Set it to false and a request fails outright when your chosen providers are unavailable, rather than being served by someone else.
Should you? It depends what you fear more. Fear a surprise bill → turn it off and accept failures. Fear downtime → leave it on and accept the cost. Want both? Keep fallbacks on and add max_price — it will still fall back, just never to an expensive endpoint.
7. Set the data policy while you are here
The same provider object carries data controls:
{
"provider": {
"data_collection": "deny",
"zdr": true
}
}
data_collection:"allow"(default, permits logging) or"deny"(excludes providers that store inputs)zdr: require Zero Data Retention
If you are sending company data, these two lines matter more than the cost-saving ones.
8. Advanced: capability and performance floors
Only route to providers that support every parameter you send (so a tools request never lands somewhere that ignores them):
{
"provider": {
"require_parameters": true
}
}
Pin quantisation (relevant for open-weight models):
{
"provider": {
"quantizations": ["int4", "fp8"]
}
}
Set performance floors (percentiles over a rolling 5-minute window):
{
"provider": {
"preferred_min_throughput": {"p50": 100, "p90": 50},
"preferred_max_latency": {"p90": 3}
}
}
Deprioritised endpoints remain available as fallbacks rather than being excluded outright.
9. Three recipes to copy
A. Overnight batch, cheapest wins:
{
"provider": {
"sort": "price",
"max_price": {"prompt": 6.0, "completion": 30.0}
}
}
B. User is waiting, fast but capped:
{
"provider": {
"sort": "latency",
"max_price": {"prompt": 12.0, "completion": 60.0}
}
}
C. Company data, compliance first:
{
"provider": {
"only": ["azure", "openai"],
"data_collection": "deny",
"require_parameters": true
}
}
10. Last reminders
- Verify after configuring: send one request and check which provider served it and what it actually cost. Claiming it is configured without reading a bill is not configuration.
- Prices move: provider lists and rates change, so revisit your
max_pricethresholds periodically. - Routing has a ceiling: no routing setup beats caching your repeated context. Do both.
Official links
- Provider routing docs: https://openrouter.ai/docs/features/provider-routing
- OpenRouter tool page
- OpenRouter free-model daily limits explained
- GPT-6 Astra on OpenRouter: five providers, a 4x spread
Configuration read directly from the official docs on 2026-09-05. Parameters change; check the docs before implementing.
What Amo and Pimi think
Developers can access multiple models at once: the free version offers 50 trials per day. For stable usage, Pay-as-you-go is the most flexible option, but the 5.5% handling fee is a hidden cost, so calculate carefully before using extensively.
Let's take a look at these
- OpenRouter Comprehensive Introduction: Pricing, Features, and Actual Limitations
- OpenRouter Is the free quota enough?
- OpenRouter Alternatives
- Comprehensive Free Quota List for All Tools

