Provider Selection
Provider selection lets pay-as-you-go users choose the upstream provider for supported open-source models. It is optional; if you do nothing, the platform picks the provider. Subscription requests ignore provider preferences.When Provider Selection Applies
- Provider selection only applies when a model reports
supportsProviderSelection: true. - Use
GET /api/models/:canonicalId/providersto discover eligible models and provider IDs. - If a model does not support provider selection, the request ignores provider preferences.
Discover Providers and Pricing
Use this endpoint to list available providers and the pricing you will pay when selecting one.defaultPriceis used when you do not select a provider.providers[].pricingis what you pay when you do select a provider (includes the markup).- If a model is unsupported, the response includes
supportsProviderSelection: false.
Per-Request Provider Override
For a single request, send the provider ID in theX-Provider header.
X-Provideris case-insensitive (x-provideralso works).- The provider ID must be one of the values returned by the providers endpoint.
Persistent Provider Preferences
These endpoints let a user save provider preferences in their session metadata.GET response (placeholders):
PATCH payload:
preferredProviders: ordered list of allowed providers; the system tries each in order.excludedProviders: providers that should never be used.enableFallback: whentrue(default), fall back to the platform default if no preferred provider is available.modelOverrides: optional per-model overrides for the fields above.availableProviders: full set of provider IDs available to your account for the model.
Resolution Order
When multiple selections exist, the system resolves providers in this order:X-Providerheader override- Per-model
preferredProviders - Global
preferredProviders - Platform default (only if
enableFallbackis true)
Billing and Markup
- If you select a provider (via header or preferences), billing uses the provider-specific price plus a 5% markup.
- If you do not select a provider, billing uses the model’s default price.
Error Behavior
- If
enableFallbackisfalseand no preferred provider is available,/api/v1/chat/completionsreturns400witherror.code: "no_fallback_available". PATCH /api/user/provider-preferencesvalidates provider IDs and returns:422 INVALID_INPUTfor malformed payloads.400 INVALID_EXCLUSIONSif exclusions would leave a model with no usable provider.