Routing
What happens between your request and an answer
最后更新:
You send a model name, or a route like auto/image. Somewhere in
between, four things happen in a fixed order. Knowing the order explains most of the
behaviour people find surprising.
The four steps
auto/ route that describes the modality rather than naming
a model.Why step 4 is the one that matters
Steps 1 to 3 are conveniences. Step 4 is the difference between a demo and something you can leave running.
Any single provider fails often enough that a workload with real traffic needs a fallback path. Quotas refill on the provider's schedule, not yours. Keys get rotated or revoked. A model gets deprecated with a few weeks' notice. If your application talks to one provider directly, every one of those events is an outage you have to notice, diagnose, and fix by hand.
With a gateway in between, they become a log line. The request still returns an answer, and the log tells you the original choice was skipped and why.
Choosing a route instead of a model
A specific model id is a decision you made once and then stopped revisiting. Model quality moves, prices move, and free quotas appear and disappear. A route is a decision you describe once and let the router keep making.
| If the request needs | Send |
|---|---|
| An image | auto/image |
| Video | auto/video |
| Speech synthesis | auto/tts |
| Speech recognition | auto/asr |
| Embeddings | auto/embed |
| Reranking | auto/rerank |
A route is not a guarantee about which model you get. It is a guarantee about what the router optimises for. See the full list at Models.
What gets logged
Every routed request writes an entry you can read in the console: which route or model was requested, which provider actually served it, which candidates were skipped, and the reason for each skip. That log is why "why did this call cost more than I expected" has an answer rather than a guess.
A request, step by step
The four steps above are the shape of it. This is the same sequence at the level of the individual checks, in the order they run.
- Step 1: Resolve the name. A specific model id maps to one provider entry and skips
the rest of the choice. An
auto/route expands into the candidate set that matches its modality: 6 of the 199 listed entries are modality routes, which is 3% of the catalogue.[1] - Step 2: Filter by what the request needs, hardest constraint first. A context window smaller than the request cannot serve it at all, so that is checked first. The modality comes next: an image request is only served by image models, a transcription only by speech-to-text models. Each filter removes a different slice of the list, and the modality removes the largest.
- Step 3: Order what survives. Free quota sorts to the front, then the weighting the route asks for — cost, speed, or uptime. A route that weights uptime puts providers with a clean recent record ahead of cheaper ones.
- Step 4: Send to the head of the list and read the response. A normal answer ends the request here. A rate limit, an exhausted quota, an authentication rejection or a timeout removes that candidate and control returns to the list.
- Step 5: Write the log entry: the route or model that was requested, the provider that actually served the call, the candidates that were skipped, and the reason for each skip.
What makes the router skip a candidate
Failures are not one thing. Each signal below is handled differently, and conflating them is how a fallback path turns into a retry storm.
| What came back | What the router does |
|---|---|
| A rate limit, or an error naming a request cap | Treats the candidate as temporarily unusable and moves to the next one straight away. |
| Quota exhausted | Keeps the model callable but stops preferring it, until the provider refills or the promotion ends. |
| A rejected key, or a permission error | Drops that candidate for the request and marks the credential, so the same key is not tried again on the next call. |
| No response, or a stream that never starts | Counts as a failure and tries the next candidate. A stream that has already delivered a first token is not restarted. |
| The model is absent from the provider's own list | Removes the entry from the pool rather than retrying it — a model that no longer exists will not start existing on the second attempt. |
The reason is recorded per skip, which is what makes the log readable later. Without it, "the answer came from somewhere else" and "the answer cost more than the list price" are the same unexplained event.
What routing does not decide
- It does not invent model settings. A parameter a model's API does not accept is not sent to it.[1]
- It does not upgrade a weak model. Filtering and ordering pick among models that fit the task. If the correct model for the job is not in the catalogue, routing cannot conjure it.
- It does not hide the bill. Failover changes which model served the call, and the price list follows the model, not the route. The log is where the two are reconciled.
- It does not retry forever. The candidate list has an end. When the end is reached, the request fails with the reasons attached.
Routing FAQ
What happens to my request when a provider rate-limits me?
Why did I get a paid model when free ones exist?
fm-v1-lite, the free
tier: any account can call it, and it needs no subscription.Can I see which model actually answered?
Does failover change what a call costs?
Do I need to send a route at all?
Next
Sources
Every third-party figure quoted on this site was read from the vendor documentation linked below, on the date stated. None of these links are affiliate links and none of these vendors paid to be listed. If a number here disagrees with the page it came from, the page is right — tell us and it gets corrected.
- OpenRouter — credit-purchase fees and free-model rate limits
- OpenRouter — rate-limit reference
- OpenRouter — public model list
- LiteLLM — licence, deployment options and supported models
- Cloudflare AI Gateway — features and pricing
- Vercel AI Gateway — features
- Portkey — plans
- Helicone — plans
- Model Context Protocol — specification
- OpenAI Python SDK — base_url and OPENAI_BASE_URL
- Anthropic Messages API — request format
Where the percentages come from
Every share quoted on this site is counted from the live model list, not estimated. Divide the two counts in the last column, round to the nearest whole percent, and you get the number in the first.
| Share | Of what | Count |
|---|---|---|
| 77% | are chat models | 153 of 199 listed entries |
| 9% | generate images | 18 of 199 listed entries |
| 23% | are not chat models | 46 of 199 listed entries |
| 3% | are modality routes | 6 of 199 listed entries |
| 17% | carry a context length | 34 of 199 listed entries |
[1] Counted on 29 September 2026 from GET https://freemodel.online/v1/models, which needs no key and no account. Every row uses all 199 listed entries as the denominator, because the only thing the endpoint states for every entry is its modality. It no longer publishes per-model capability flags such as tool calling or reasoning, so this site quotes no shares for them. Fetch the list and recount whenever you want to check the arithmetic.