provider object in the request body to customize how routing decisions are made.
The provider Object
Include a provider object in any /v1/chat/completions request to override routing defaults:
Full Field Reference
Default Strategy: Cost-Based Load Balancing
By default, ARouter load balances requests across healthy providers, prioritizing cost. The algorithm:- Exclude providers with significant outages in the last 30 seconds
- Among stable providers, weight selection by the inverse square of the price
- Use remaining providers as automatic fallbacks
- Provider A is 9× more likely to be chosen than Provider C (inverse square weighting)
- If Provider A fails, Provider C is tried next
- Provider B (recently degraded) is tried last
sort or order, load balancing is disabled and providers are tried in strict order.
Provider Sorting
Use thesort field to explicitly prioritize a provider attribute. Load balancing is disabled and providers are tried in order.
Available sort values:
"price"— prioritize lowest cost per token"throughput"— prioritize highest tokens/sec"latency"— prioritize lowest time-to-first-token
- TypeScript
- Python
- cURL
:nitro and :floor Shortcuts
Append a suffix to the model slug as a shorthand for sorting:
Advanced Sorting with Partition
When using candidate model lists (models[]), the sort field can be an object with a partition option to control how endpoints are sorted across models.
By default (
partition: "model"), endpoints are grouped by model — the first model’s endpoints are always tried before the second model’s. Setting partition: "none" removes this grouping, allowing global sorting across all candidate models.
Use Case 1: Route to Highest Throughput Across Multiple Models
When you have multiple acceptable models and want whichever is fastest right now:- TypeScript
- Python
- cURL
Use Case 2: Cheapest Model That Meets Performance Requirements
Combinepartition: "none" with performance thresholds to find the lowest-cost option that still meets your SLA:
- TypeScript
- Python
- cURL
Performance Thresholds
Set minimum throughput or maximum latency preferences to filter providers. Providers that don’t meet thresholds are deprioritized (moved to the end), not excluded entirely.How Percentiles Work
ARouter tracks provider performance over a rolling 5-minute window:
Higher percentiles (p90/p99) give confidence about worst-case performance. All specified percentile cutoffs must be met for a provider to be in the preferred group.
preferred_min_throughput and preferred_max_latency are soft preferences — they never prevent a request from being served. This is different from max_price, which is a hard limit.Ordering Specific Providers
Useorder to specify which providers to try and in what sequence. Load balancing is disabled when order is set.
- TypeScript
- Python
- cURL
Allowing Only Specific Providers
Useonly to restrict routing to a specific set of providers:
Ignoring Providers
Useignore to skip specific providers for this request:
Disabling Fallbacks
By default, ARouter falls back to alternative providers if the primary is unavailable. Setallow_fallbacks: false to require the exact provider:
503 error rather than routing elsewhere.
Requiring Parameter Support
Setrequire_parameters: true to only route to providers that support all parameters in your request. By default, ARouter may route to providers that ignore unsupported parameters.
Quantization Filtering
Filter providers by the model quantization level they serve. Useful when you need specific precision/performance tradeoffs:"fp32", "fp16", "bf16", "int8", "int4".
Data Collection Policy
Control whether ARouter routes to providers that may store your request data:Zero Data Retention (ZDR)
For maximum privacy, restrict routing to providers with Zero Data Retention guarantees:Maximum Price
Set a hard limit on how much you are willing to pay per token. Requests will fail rather than be routed to providers above this price:Unlike performance thresholds,
max_price is a hard limit. If no provider meets the price requirement, the request returns an error.Provider Health and Availability
ARouter continuously tracks provider health using a circuit-breaker mechanism:
This is fully transparent — your application does not need to implement provider-level retry logic.
Specifying a Provider via Model Prefix
The primary way to control which provider handles your request is via theprovider/model format:
Native Provider Proxy
For complete control, use the provider proxy endpoint/{provider}/{path} to bypass ARouter’s model-routing layer entirely:
Supported Providers
See Providers for the full list with capabilities.