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 provider, requests spread across every eligible provider.

Fastest provider under a price cap
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.

order
Try these providers first, in order.
only
Use only these providers.
ignore
Never use these providers.
sort
Rank by price, latency or throughput.Without performance data, providers rank by price.
allow_fallbacks
false uses only providers in order.Defaults to true. Without order, one provider that serves every model is chosen.
max_price
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. Other IDs return 400.

  • alibaba
  • anthropic
  • arcee-ai
  • azure
  • baseten
  • bedrock
  • bfl
  • blackbox
  • bytedance
  • cerebras
  • claudeaws
  • cohere
  • crusoe
  • darkbloom
  • deepinfra
  • deepseek
  • digitalocean
  • fireworks
  • friendli
  • gmicloud
  • google
  • groq
  • inception
  • interfaze
  • klingai
  • meta
  • minimax
  • mistral
  • moonshotai
  • morph
  • nebius
  • novita
  • openai
  • parasail
  • perplexity
  • poolside
  • prodia
  • quiverai
  • recraft
  • runware
  • sakana
  • sambanova
  • stepfun
  • streamlake
  • 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 sort or order.
  • Prevent overridesResponses carry x-minirouter-overrides: ignored.Ignores request routing except max_price.

Change these in Routing settings.

Where it works

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), allowFallbacks, maxPrice, models.Do not combine it with provider or models.
Esc