Control which upstream providers serve your request and how OpenDunes selects among them.
Most models on OpenDunes are served by more than one upstream provider. By default, OpenDunes picks the provider automatically. Provider routing gives you explicit control over how it selects among them.
Available now in the dashboard. Set your account routing preferences at Settings → Routing (/dashboard/settings/routing):
These apply to your chat and API traffic (applied as the request's provider routing object). Per-request overrides via the provider body field are described below.
When you request a model like google/gemini-2.5-pro, several upstream providers may be able to serve it. OpenDunes maintains a live provider registry per model — availability, observed latency, and per-token cost in DA. The provider routing object in your request body lets you override the default selection logic.
Pass a provider object alongside your model:
| Field | Type | Description |
|---|---|---|
order | string[] | Provider names in preference order. OpenDunes tries them left to right. |
allow_fallbacks | boolean | If true (default), continue to the next provider on failure. Set false to hard-fail if the listed providers are all unavailable. |
sort | string | Auto-sort providers by a criterion (see below). Ignored when order is set. |
only | string[] | Restrict routing to these providers exclusively for this request. |
When you don't have a preference for a specific provider but want to optimize for a dimension, set sort instead of order:
| Value | Behavior |
|---|---|
price | Cheapest DA/token first. Best for batch or cost-sensitive workloads. |
latency | Lowest observed time-to-first-token first. Best for interactive use. |
throughput | Highest token/second first. Best for long generations. |
Use only to restrict a request to providers that meet your requirements — for example, to enforce data residency for Law 18-07 compliance:
Pinning a single provider also prices the request at that provider's real per-token DA rate.
Note. If none of the pinned providers can serve the model, the request fails rather than falling back elsewhere. Leave at least one viable provider in the set.
Provider routing can affect the DA cost of a request. Providers priced differently for the same model will yield different per-token rates. The X-Balance-Available header in the response always reflects your balance after the actual provider's cost is deducted.
Check which providers are available for a model and their per-token DA rates via GET /api/models/{slug}.
Pass the provider object as an extra body field: