Model Routing
Choose explicit models, use task-specific automatic routes, and manage language routing policies.
Decide What Should Be Selected
Routing chooses an eligible model or provider for a request. Start with an exact model ID when you need to validate one integration. Introduce automatic selection after you have defined the capabilities and constraints your application requires.
All routing uses the same API URL and workspace. Language requests require llm.write; audio requests require audio.write. Use the model alias and request format for your endpoint.
Exact Models and Automatic Routes
| Task | Automatic Model ID | Where to Use It |
|---|---|---|
| Transcription | auto | Transcription endpoint |
| Speech generation | tts/auto | Speech endpoint |
| Language generation | costream/auto | Chat Completions, Responses, or Messages |
costream/auto is a retained API identifier. Use it exactly as written; audiolab/auto is not an equivalent alias.
An exact provider/model ID selects a concrete integration. Automatic routing chooses among eligible candidates. Neither choice grants access to disabled models or bypasses workspace limits.
Constrain the Route
Capabilities, input limits, provider restrictions, deployment availability, and routing settings constrain candidate selection. A fallback must satisfy the request’s requirements as well; it cannot silently remove a required capability.
For speech and transcription, the endpoint reference describes supported provider controls such as allowlists, order, sorting, and fallback behavior. Provider-native options can further restrict the route. A pinned transcription model does not fall back to another provider unless fallback is explicitly allowed.
Set hard requirements first, then express preferences such as cost or latency. Routing heuristics are selection policies, not guarantees of benchmark quality or end-to-end response time. Validate candidate outputs with representative inputs before relying on a route.
Manage a Named Language Router
A named router is a routing policy your workspace owns and calls like a model, router/<id>. Conditional routes match on request metadata, token counts or protocol; each route can split traffic between weighted A/B variants; each variant is an ordered or cheapest-first list of models.
- Create a router on the dashboard's Routers page and configure its routes.
- Test the rules. Simulation never calls a model, so it does not prove provider availability.
- Publish. Each publish creates an immutable revision and makes it live.
- Call it through Chat Completions, Responses or Messages with
model: "router/<id>", and sendrouter_revisionto pin a revision.
Editing a router needs a dashboard session; calling it needs an API key with llm.write. Restoring an earlier revision creates a new one, so you can roll back without losing history. Follow Named Routers for examples, and the named-router reference for every field.
Inspect the Result
Test a small request and inspect its selected model, status, latency, and recorded usage. If there is no eligible route, check constraints and model availability before loosening the policy.
Fallback can occur only where the protocol supports it. Once output has been delivered, a client cannot safely treat a different model’s restarted output as the same response. See Streaming and Errors and Debugging for partial output handling.
Route Language Requests
Chat Completions, Responses and Messages route alike, streamed or not:
| Model Field | What Answers |
|---|---|
| A model ID | That model, on any host that serves it; models adds fallbacks, tried in order |
A host’s own ID, such as groq/gpt-oss-120b | That model on that host only |
~author/family-latest | The newest model of that family (Latest Aliases) |
costream/auto | The model a classifier picks for the prompt |
costream/fusion | A panel of models, compared by a judge |
router/<id> | Your named router’s published revision |
A fallback runs only when the endpoint before it fails before any output. Every candidate must support the request’s tools, response format, reasoning settings, images, PDFs and web search; one that cannot is skipped, and the request is refused only when none can.
A sampling parameter such as temperature, top_p, seed or stop is dropped for a model that does not support it, as on OpenRouter, and named in the x-audiolab-dropped-params header. A named router drops a temperature or top_p it does not list under Request Overrides the same way. Send "provider": {"require_parameters": true} to refuse the request instead.
Without max_tokens, a model may write up to its output cap, listed as top_provider.max_completion_tokens in List Models.
Models with Several Hosts
Some models are served by several hosts, such as openai/gpt-oss-120b on DeepInfra, Together AI and Groq. The model has one ID; each host is an endpoint with its own price, context, output cap, parameters, quantization and data policy. List Endpoints shows them, with each host’s uptime, latency and throughput over the last 30 minutes.
Without sort or order, endpoints are tried in this order:
- The model maker’s own endpoint, when it is one of the hosts and is healthy, such as Z.AI for
z-ai/glm-5.2. - The other healthy endpoints, in a random order weighted by the inverse square of their price (input price plus three times output price), so cheaper hosts take most requests.
- Degraded endpoints: a quarter or more of at least four recent requests failed through the host.
After five failures in a row through a host, its circuit opens: the host is tried after every other candidate for 30 seconds, longer if it keeps failing (doubling every five more failures, up to five minutes). Then one request tests it, and a success closes the circuit. An endpoint is never removed for its health, so a request is not refused because every host is failing. Health is measured from AudioLab’s own traffic: refused connections, timeouts, interrupted streams, empty answers and HTTP errors other than request errors count against a host.
A routed request holds credit for its most expensive endpoint and is charged only for the endpoint that answered, at that endpoint’s price. A host that fails costs nothing. When your filters leave one endpoint of a single requested model, the request runs on it directly. A request uses at most eight endpoints, always including each requested model’s best one.
A conversation answered by a host that discounts cached input prefers that host for ten minutes after its last answer, so the cache can be read, unless the host is degraded or its circuit is open, or the request sets sort, order or a ranking suffix. A conversation is your session_id, or else its system prompt and first message.
Provider Preferences
The provider object takes OpenRouter’s fields on Chat Completions, Responses and Messages:
| Field | Effect |
|---|---|
only, ignore | Use only, or never, these providers or endpoint tags, such as deepinfra or deepinfra/turbo |
order | Try these first, across every requested model. With allow_fallbacks: false, nothing else |
allow_fallbacks | false uses the first endpoint only |
sort | price, throughput (p50 output tokens per second), latency (p50 time to first token) or exacto. As {"by": ..., "partition": "none"}, every requested model’s endpoints are ranked together instead of one model at a time |
quantizations | Only hosts that publish one of these; unknown matches hosts that do not say |
max_price | prompt and completion in USD per million tokens. No language model charges per request or image |
preferred_min_throughput, preferred_max_latency | Endpoints measured below this throughput (tokens per second) or above this latency (seconds to first token) are tried after the rest. A number is the p50; an object sets p50, p75, p90 or p99 |
require_parameters | Refuse the request instead of dropping parameters an endpoint does not support |
zdr, data_collection | Only endpoints with reviewed zero retention, or that do not train on or publish prompts. They can only narrow your workspace’s privacy settings |
data_region | Only endpoints documented as processing in this region (Regions) |
enforce_distillable_text, options | Accepted but not honoured, and named in x-audiolab-ignored-provider-fields |
Throughput and latency are measured over the last 30 minutes of AudioLab traffic. Endpoints without measurements are ranked after measured ones, cheapest first, and count as meeting a preferred minimum or maximum.
Regions
Set provider.data_region to route only to endpoints whose provider documents processing in that region: us, eu or a country code from the table below. A list allows any of its regions, and eu includes its member states. An endpoint marked global (several regions, none fixed) or unknown (not documented) never matches. Fallbacks keep to the region.
The field works on Chat Completions, Responses, Messages and every other product, and on a stream’s session.start frame. Speech and transcription also accept its older name, provider.region.
A workspace’s Data Region setting either requires a region for every request (Only) or tries its endpoints first (Prefer). A named router can require regions too. Each requirement adds to the others, so a request can narrow its workspace and router but never widen them. When no endpoint qualifies, the request is refused before any provider is called:
{"error":{"code":"data_region_unavailable","type":"invalid_request_error","message":"No endpoint for anthropic/claude-sonnet-5 processes requests in the EU (eu). Remove provider.data_region to route without the request's region requirement.","param":"provider.data_region","metadata":{"data_region":["eu"]}}}The table lists the hosts AudioLab calls; a regional host it does not use is not counted. List Endpoints returns the same region for each endpoint.
| Provider | Endpoints | Region | Location | Source |
|---|---|---|---|---|
| Alibaba Cloud Model Studio | CosyVoice v3.5 | cn | China (Beijing) | www.alibabacloud.com, 2026-10-15 |
| Alibaba Cloud Model Studio | Other models | global | Singapore account; inference on international nodes outside mainland China | www.alibabacloud.com, 2026-10-15 |
| Amazon Web Services | Polly speech | us | AWS us-east-1 | aws.amazon.com, 2026-10-15 |
| Amazon Web Services | Transcribe | us | AWS us-east-1 | aws.amazon.com, 2026-10-15 |
| Amazon Web Services | Nova Sonic | us | AWS us-east-1 (in-Region model ID) | docs.aws.amazon.com, 2026-10-15 |
| Anthropic | All | global | Any available geography (no inference_geo sent) | platform.claude.com, 2026-10-15 |
| AssemblyAI | Sync transcription | global | Nearest US or EU region | assemblyai.com, 2026-10-15 |
| AssemblyAI | Streaming transcription | global | Nearest US or EU region | www.assemblyai.com, 2026-10-15 |
| AssemblyAI | Pre-recorded transcription | us | United States (AWS us-west-2) | www.assemblyai.com, 2026-10-15 |
| Cartesia | All | global | Routed to the closest deployment | docs.cartesia.ai, 2026-10-15 |
| Deepgram | All | unknown | Not documented for the default endpoint | developers.deepgram.com, 2026-10-15 |
| DeepInfra | All | us | United States | deepinfra.com, 2026-10-15 |
| DeepSeek | All | cn | China | cdn.deepseek.com, 2026-10-15 |
| ElevenLabs | Speech | global | Nearest of the US, Netherlands and Singapore | elevenlabs.io, 2026-10-15 |
| ElevenLabs | Other endpoints | unknown | Not documented outside text to speech | elevenlabs.io, 2026-10-15 |
| fal | All | global | The US and other countries | fal.ai, 2026-10-15 |
| Gladia | All | global | France by default; no committed region, US subprocessors for add-ons | www.gladia.io, 2026-10-15 |
| Google Cloud | Chirp 2 transcription | us | Google Cloud us-central1 | docs.cloud.google.com, 2026-10-15 |
| Google Cloud | Other transcription | us | Google Cloud US multi-region | cloud.google.com, 2026-10-15 |
| Google Cloud | Speech | global | Global endpoint, no regional isolation | docs.cloud.google.com, 2026-10-15 |
| Google Gemini | Gemini API | global | Any country with Google facilities | business.safety.google, 2026-10-15 |
| Groq | All | global | Data centers in the US, Canada, Europe, Australia and Saudi Arabia | console.groq.com, 2026-10-15 |
| Hume AI | All | global | Any country with Hume or its providers' facilities | www.hume.ai, 2026-10-15 |
| Inworld AI | Realtime speech to speech | unknown | Language model leg not documented | docs.inworld.ai, 2026-10-15 |
| Inworld AI | Speech | us | United States | docs.inworld.ai, 2026-10-15 |
| Microsoft Azure | MAI-Voice | global | Routed across 14 Azure regions | learn.microsoft.com, 2026-10-15 |
| Microsoft Azure | MAI-Transcribe | unknown | Not documented for MAI models | learn.microsoft.com, 2026-10-15 |
| Microsoft Azure | Other speech and transcription | us | Azure East US (the Speech resource's region) | learn.microsoft.com, 2026-10-15 |
| MiniMax | All | unknown | Storage in the US; processing not documented | platform.minimax.io, 2026-10-15 |
| Mistral AI | All | global | No committed inference location on the global endpoint | docs.mistral.ai, 2026-10-15 |
| Moonshot AI | All | sg | Singapore | platform.kimi.ai, 2026-10-15 |
| Murf AI | Falcon | global | Routed to a nearby Falcon region | murf.ai, 2026-10-15 |
| Murf AI | Gen2 | us | AWS us-east-2 (Ohio) | murf.ai, 2026-10-15 |
| OpenAI | All | global | No fixed region for a project without data residency | developers.openai.com, 2026-10-15 |
| Reson8 | All | eu, nl | Netherlands | reson8.dev, 2026-10-15 |
| Sarvam AI | All | in | India | www.sarvam.ai, 2026-10-15 |
| Smallest.ai | All | global | Nearest of India and the US | docs.smallest.ai, 2026-10-15 |
| Soniox | All | us | United States | soniox.com, 2026-10-15 |
| Speechmatics | Batch transcription | unknown | Not documented for the unpinned batch host | docs.speechmatics.com, 2026-10-15 |
| Speechmatics | Streaming transcription | eu | EU1 (Europe) | docs.speechmatics.com, 2026-10-15 |
| Together AI | All | global | Serverless routing; region not selectable | docs.together.ai, 2026-10-15 |
| xAI | All | global | Routed between regions; not guaranteed on the global endpoint | docs.x.ai, 2026-10-15 |
| Z.AI | All | sg | Singapore | docs.z.ai, 2026-10-15 |
Model Variants
Add a suffix to a model ID, such as openai/gpt-oss-120b:nitro. Suffixes combine; of :nitro, :floor and :exacto, the last one wins, and it wins over provider.sort.
| Suffix | Effect |
|---|---|
:nitro | Rank endpoints by throughput |
:floor | Rank endpoints by price |
:exacto | Rank endpoints by tool-call validity: first those with at least 20 tool calls in the last day and at most 5% invalid, then those without 20 calls, each by throughput, then the rest |
:free | Keep free endpoints only; refused with 404 when there are none |
:thinking | Keep endpoints that reason: those that reason by default, or every endpoint when the request sets reasoning. Refused when the request turns reasoning off |
:online | Turn on the model’s own web search; endpoints without it are skipped |
A tool call counts as valid when it names a tool the request declared and its arguments are a JSON object that matches the tool’s schema types, required properties, enums and additionalProperties: false. No model that several hosts serve accepts tools yet, so until one does, :exacto ranks their hosts by throughput. An unknown suffix is refused with 400 and metadata.variant naming it.
Latest Aliases
A ~author/family-latest ID selects the newest model of that family on offer, by release date, so requests move to a new release without a code change. For example, ~z-ai/glm-latest, ~anthropic/claude-sonnet-latest, ~openai/gpt-mini-latest and ~google/gemini-flash-latest. The response’s model field and the routing explanation’s resolved field name the model it selected.
Families: Claude Opus, Sonnet, Haiku and Fable; GPT Sol, Luna, Terra, Astra, Mini and Nano; Gemini Pro, Flash and Flash-Lite; Grok; GLM; Kimi; DeepSeek Pro and Flash; Qwen Max, Plus and Flash; Mistral Large, Medium and Small.
Read the Routing Explanation
Every language response explains its route in the x-audiolab-routing header, as JSON, and in the body’s routing field. A stream carries the field on its final chunk (Chat Completions), response.completed event (Responses) or message_delta event (Messages). Browsers can read these headers across origins.
{"mode":"named","requested":"router/support","router":"router/support","revision":3,"route":"long-context","variant":"b","candidates":["openai/gpt-5.5","google/gemini-3.5-flash"],"model":"google/gemini-3.5-flash","provider":"google","attempts":[{"model":"openai/gpt-5.5","provider":"openai","role":"output","status":"failed","code":"provider_unavailable","upstream_status":503,"cause":"http_error"},{"model":"google/gemini-3.5-flash","provider":"google","role":"output","status":"succeeded"}]}| Field | Meaning |
|---|---|
mode | direct, fallback, auto, fusion or named |
resolved, variants | The model ID the request selected, without suffixes or as an alias’s target, and the suffixes that applied |
sort, sticky | How endpoints were ranked (default, order, price, throughput, latency or exacto), and whether a conversation’s cached endpoint went first |
router, revision, route, variant | Named routers: the revision, route and A/B variant that applied |
model, provider, endpoint | What answered; endpoint is the host’s own ID when model is a model several hosts serve |
attempts | Each provider call in order, with its role, status and failure code |
classifier | costream/auto: the topic and difficulty it read |
plugins | What each plugin did: the PDF engine and pages read, web search, JSON repair, messages removed by compression |
data_region | The regions required by the request, workspace and router, the preferred region, and the region of the endpoint that served it (Regions) |
The explanation holds identifiers and codes, never prompt or output text. When the header would pass 2,000 bytes it leaves out the earliest attempts and counts them in attempts_omitted; the body keeps them all.