Models & routing
Provider selection
Choose which providers serve a model, in what order and at what price.
Send provider settingsExamples read your key from MINIROUTER_KEY.
Without sort or order, requests sort by price.
curl https://api.minirouter.sh/v1/chat/completions \
-H "Authorization: Bearer $MINIROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-sol",
"provider": {
"sort": "throughput",
"max_price": {
"prompt": 3,
"completion": 12
}
},
"messages": [
{
"role": "user",
"content": "Explain an API gateway in one sentence."
}
],
"max_tokens": 256
}'Fieldsorder, only and ignore take up to 32 provider IDs.
| Field | Effect |
|---|---|
| order | Try these providers first, in order. |
| only | Use only these providers. |
| ignore | Never use these providers. |
| sort | Rank by price, latency, throughput or balanced.Defaults to price. balanced picks the lowest price × expected response time, up to 3× the cheapest route. Without performance data, providers rank by price. |
| allow_ | false uses only providers in order.Defaults to true. Without order, one provider that serves every model is chosen. |
| max_ | Skip providers above {"prompt": n, "completion": n} USD per million tokens.0 to 1,000,000, up to six decimals, markup included. Providers without a known price are skipped. 0 needs a proven zero rate. Cache, request and minimum charges, and image, audio and per-request prices, are not capped. |
Provider IDsThe provider must serve the requested model, or the request returns 400. GET /v1/models/{creator}/{model}/endpoints lists a model's IDs in data.providers. Some request features narrow that list.
- alibaba
- anthropic
- arcee-ai
- azure
- baseten
- bedrock
- bfl
- blackbox
- boundless
- bytedance
- callstack
- cerebras
- claudeaws
- cohere
- crusoe
- darkbloom
- deepinfra
- deepseek
- digitalocean
- fireworks
- friendli
- gmicloud
- groq
- inception
- inference-net
- interfaze
- klingai
- meituan
- meta
- minimax
- mistral
- moonshotai
- morph
- nebius
- novita
- openai
- parasail
- pareto
- particle
- perplexity
- poolside
- prodia
- quiverai
- recraft
- relace
- runinfra
- runware
- sail-research
- sakana
- sambanova
- stepfun
- streamlake
- subconscious
- tencent
- togetherai
- vertex
- vertexAnthropic
- voyage
- wafer
- xai
- xiaomi
- zai
Not supportedEach returns 400 invalid_request.
- require_parameters
- data_collection
- zdr
- quantizations
- preferred_min_throughput
- preferred_max_latency
- enforce_distillable_text
- sort: {…}
Account and key limits
- Allowed providersSet per account or key. Requests only narrow them.
- Default sortUsed when a request sends no
sortororder. - Prevent overridesResponses carry
x-minirouter-overrides: ignored.Ignores request routing exceptmax_price.
Change these in Routing settings.
Where it works
| Surface | Support |
|---|---|
| Chat Completions, Responses, Messages | Every field. |
| Token counting | Rejects only, ignore, max_price and allow_fallbacks: false.Also rejected when your account or key restricts providers. |
| Auto Free | No provider settings. |
Native providerOptions.gateway | Same controls: order, only, ignore, sort (cost, ttft, tps, balanced), allowFallbacks, maxPrice, models.Do not combine it with provider or models. |