---
title: "Provider selection"
description: "Order, restrict, sort and price-cap the providers that serve a model."
canonical_url: "https://minirouter.sh/docs/provider-selection"
markdown_url: "https://minirouter.sh/docs/provider-selection.md"
last_updated: "2026-09-26"
---

# Provider selection

Choose which providers serve a model, in what order and at what price.

## Send provider settings

Without `provider`, requests spread across every eligible provider.

```sh
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
}'
```

Examples read your key from `MINIROUTER_KEY`.

## Fields

| Field | Effect |
| --- | --- |
| `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. |

`order`, `only` and `ignore` take up to 32 provider IDs.

## Provider IDs

`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`

The provider must serve the requested model. Other IDs return 400.

## Not supported

`require_parameters`, `data_collection`, `zdr`, `quantizations`, `preferred_min_throughput`, `preferred_max_latency`, `enforce_distillable_text`, `sort: {…}`

Each returns 400 `invalid_request`.

## Account and key limits

- **Allowed providers**: Set per account or key. Requests only narrow them.
- **Default sort**: Used when a request sends no `sort` or `order`.
- **Prevent overrides**: Ignores request routing except `max_price`. Responses carry `x-minirouter-overrides: ignored`.

Change these in [Routing settings](https://minirouter.sh/dashboard/routing).

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