Skip to main content
ARouter routes each request to the optimal upstream provider based on model availability, provider health, and cost efficiency. This happens automatically — no configuration required for most use cases. For advanced control, pass a 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:
  1. Exclude providers with significant outages in the last 30 seconds
  2. Among stable providers, weight selection by the inverse square of the price
  3. Use remaining providers as automatic fallbacks
Example: If Provider A costs 1/Mtokens,ProviderBcosts1/M tokens, Provider B costs 2/M, and Provider C costs $3/M:
  • 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
If you set sort or order, load balancing is disabled and providers are tried in strict order.

Provider Sorting

Use the sort 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

: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:

Use Case 2: Cheapest Model That Meets Performance Requirements

Combine partition: "none" with performance thresholds to find the lowest-cost option that still meets your SLA:

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

Use order to specify which providers to try and in what sequence. Load balancing is disabled when order is set.

Allowing Only Specific Providers

Use only to restrict routing to a specific set of providers:

Ignoring Providers

Use ignore to skip specific providers for this request:

Disabling Fallbacks

By default, ARouter falls back to alternative providers if the primary is unavailable. Set allow_fallbacks: false to require the exact provider:
If the specified provider is unavailable, ARouter returns a 503 error rather than routing elsewhere.

Requiring Parameter Support

Set require_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:
Common quantization values: "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:
ZDR providers do not log, store, or use request data for training. See Data Collection for more details.

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 the provider/model format:
See Model Routing for the full list of supported formats.

Native Provider Proxy

For complete control, use the provider proxy endpoint /{provider}/{path} to bypass ARouter’s model-routing layer entirely:
See Provider Proxy for the full reference.

Supported Providers

See Providers for the full list with capabilities.