Skip to main content
Sunra routes a canonical model ID to an available provider automatically. In most requests, omit provider and let Sunra select the route.
Use the optional 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:
The discovery endpoint uses the same API key authentication as the LLM inference endpoints. Supported format values are chat/completions, messages, responses, and embeddings.

Select one provider

Set provider.only to restrict the request to one provider:
The request returns an error when none of the requested providers can serve the model and API format.

Set a preference order

Use order 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

Use ignore to remove providers from automatic routing:

Prefer the lowest price

Use sort: "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

provider
object
Optional routing preferences. Omit this object for automatic routing.