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.

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.

FieldEffect
orderTry these providers first, in order.
onlyUse only these providers.
ignoreNever use these providers.
sortRank 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_fallbacksfalse uses only providers in order.Defaults to true. Without order, one provider that serves every model is chosen.
max_priceSkip 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
  • google
  • 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 sort or order.
  • Prevent overridesResponses carry x-minirouter-overrides: ignored.Ignores request routing except max_price.

Change these in Routing settings.

Where it works

SurfaceSupport
Chat Completions, Responses, MessagesEvery field.
Token countingRejects only, ignore, max_price and allow_fallbacks: false.Also rejected when your account or key restricts providers.
Auto FreeNo provider settings.
Native providerOptions.gatewaySame controls: order, only, ignore, sort (cost, ttft, tps, balanced), allowFallbacks, maxPrice, models.Do not combine it with provider or models.