provider and let Sunra select the route.
provider object when you need a specific provider or want to control the eligible provider set. Provider routing is supported by Chat Completions, Messages, Responses, and Embeddings.
Discover available providers
Provider availability varies by model and API format. Query the discovery endpoint before presenting provider choices in an application:format values are chat/completions, messages, responses, and embeddings.
Select one provider
Setprovider.only to restrict the request to one provider:
Set a preference order
Useorder to prefer providers in sequence. Providers not listed in order remain eligible unless allow_fallbacks is false.
allow_fallbacks controls the initial eligible provider set. It does not retry a request through another provider after an upstream response or failure has started.
Exclude providers
Useignore to remove providers from automatic routing:
Prefer the lowest price
Usesort: "price" to prefer the lowest-priced eligible route. Price sorting applies when order is omitted.
latency and throughput sorting are not currently supported.
Provider fields
Optional routing preferences. Omit this object for automatic routing.