Intelligent Routing dynamically analyzes request content and automatically matches the most suitable model from the candidate set, helping enterprises achieve optimal AI resource allocation in complex scenarios.
Overview
The model-code of Intelligent Routing is fixed to the auto-model prefix followed by 8 random characters (e.g., auto-model-abcd1234). The client sends a request with this model-code → the routing service dynamically analyzes the request content and automatically matches the most suitable model from the candidate set → actual model inference → the response is returned (the response body indicates the model that actually executed the request, preserving the real token usage).
Applicable scope:
| Dimension | Description |
|---|---|
| Region | Beijing (cn-beijing) + Singapore (ap-southeast-1) |
| Model type | Text input only |
| Calling protocol | Supports OpenAI-compatible interfaces (Chat Completions, Responses) and the Anthropic protocol (Messages); the DashScope native protocol is not supported |
| Access domain | Only maas.aliyuncs.com is supported (OpenAI-compatible and Responses protocols: https://{WorkspaceId}.{region}.maas.aliyuncs.com/compatible-mode/v1; Anthropic protocol: https://{WorkspaceId}.{region}.maas.aliyuncs.com/apps/anthropic; region is cn-beijing or ap-southeast-1); dashscope.aliyuncs.com (including compatible-mode) is not supported |
| Billing | Pay-as-you-go billing method |
| Rate limiting | Rate limits are applied at the account and workspace levels based on the actually routed model |
- Maximize model performance: Automatically matches the optimal model for different tasks, especially suited to users with extreme performance requirements.
- Precisely reduce costs: Automatically routes simple tasks to lightweight models and matches complex tasks with advanced models, avoiding the resource waste of using overly powerful models for simple tasks, and achieving a precise match between cost and requirements.
- Eliminate model selection difficulty: No need for users to manually conduct complex model evaluation and comparison; the platform automatically selects the optimal solution throughout, greatly lowering the barrier to model selection.
- Minimal learning curve: Identical to the regular model onboarding process; invoke via model-code without any extra code changes.
Create Intelligent Routing
In the Bailian console, under "Model Inference > Intelligent Routing", click "Create Intelligent Routing" to enter the creation page.
Prerequisites
- A Bailian workspace has been activated.
- The target routing model version has been released, and the current account has been granted invocation permissions for that version and the candidate models.
Procedure
- Enter a service name (required, up to 50 characters).
- Select a released version (maintained by the platform) from the routing model version dropdown.
- Select "Performance first" or "Cost first" as the routing strategy.
- In the model candidate set, select the candidate models (at least 2).
- Click Confirm Deployment to complete the creation.
model-code (in the form auto-model-XXXXXXXX), and the client invokes it with this model-code. A deleted model-code is never reused.
Besides the console, you can also create Intelligent Routing via OpenAPI. For interface details, see Intelligent Routing API reference.
Routing strategy
The routing strategy determines which model in the candidate set processes each request. Both strategies dynamically match based on request content (not fixed routing) and are selected at creation time.
Strategy | Model selection mechanism | Applicable Scenario |
|---|---|---|
Performance first (EFFECT_FIRST) | Selects the most capable model in the candidate set for each request | Scenarios with strict quality requirements, such as mission-critical business, complex reasoning, and high-quality content generation |
Cost first (COST_FIRST) | Intelligently schedules lightweight models while meeting the performance baseline | Cost-sensitive, high-concurrency scenarios that focus more on latency and unit cost |
Candidate model configuration
The candidate model set is the range from which the routing service can select models. When creating Intelligent Routing, in the "model candidate set" area, select the models to participate in routing from the candidate list. Select at least 2 candidate models, otherwise deployment fails.
- model-router-20260908
Candidate models | Input | Cache input | Output |
|---|---|---|---|
| CNY 0.8 | CNY 0.1 | CNY 2.7 |
| CNY 20 | CNY 2 | CNY 100 |
| 0-256K: CNY 2 256k-1M: CNY 6 | 0-256K: CNY 0.4 256k-1M: CNY 1.2 | 0-256K: CNY 8 256k-1M: CNY 24 |
| CNY 3 | CNY 0.3 | CNY 9 |
| CNY 1.5 | CNY 0.15 | CNY 4.5 |
| CNY 12 | CNY 2.4 | CNY 36 |
| CNY 8 | CNY 2 | CNY 28 |
| CNY 9 | CNY 0.9 | CNY 27 |
| CNY 4.5 | CNY 0.45 | CNY 13.5 |
| CNY 12 | CNY 1.5 | CNY 36 |
| 0-32K: CNY 0.2 256k-1M: CNY 1.2 32k-256K: CNY 0.6 | 0-32K: CNY 0.04 256k-1M: CNY 0.24 32k-256K: CNY 0.12 | 0-32K: CNY 0.8 256k-1M: CNY 4.8 32k-256K: CNY 2.4 |
Invoke Intelligent Routing
After an Intelligent Routing is created, invoking it works the same way as invoking a regular model—simply replace the model parameter in the request with the model-code of the Intelligent Routing (such as auto-model-abcd1234), enabling zero-code-change integration on the client side. Three invocation methods are supported: the OpenAI-compatible interface (Chat Completions and Responses) and the Anthropic protocol. Invocation examples are displayed in tabs by calling protocol.
- OpenAI compatible (Chat Completions)
- OpenAI compatible (Responses)
- Anthropic protocol
model field in the response body is the identifier of the model that actually processed the request, which you can use to verify whether routing took effect; the response body retains the real token usage, and billing follows the model actually routed to.
Billing: Fees are charged based on the model actually routed to; the Intelligent Routing service itself is currently free of charge.
Automatic failover
Intelligent Routing has built-in automatic failover, enabled by default with no configuration required. When the target model is unavailable, the routing service re-initiates the entire request with another model in the candidate set instead of switching mid-inference.
Automatic failover is not triggered in the following cases, and the error directly surfaces the original information from the actual model:
- 429 (rate limiting)
- Deterministic errors such as 400/403/404/500 (switching models will most likely fail as well)
- Timeouts or network exceptions
- Errors occurring after streaming has started returning content
Real-time filtering rules
The routing service applies real-time filtering to the candidate set:
- Filters out models that the current account has no permission to invoke.
- Filters out models that have been taken offline.
- Filters out models incompatible with the current request parameters (for example, if the request carries
response_format, it only routes to candidate models that support this parameter).
Limits
| Limit | Description |
|---|---|
| Calling protocol | OpenAI-compatible interfaces (Chat Completions, Responses) and the Anthropic protocol (Messages); the DashScope native protocol is not supported |
| Request type | Only text input is supported (available via all three interfaces: Chat Completions, Responses, and Messages); image or video input, image generation (text-to-image), Batch batch inference, and non-generative interfaces such as Embedding/Rerank are not supported |
| Context length | The upper limit equals the minimum context window among the models in the candidate set; requests that exceed it fail immediately with an error, without triggering automatic failover |
| Rate limiting | RPM/TPM limits are enforced at the account and workspace level based on the model actually routed to; during automatic failover, only the consumption of the model that ultimately succeeded is counted |
Metric description
Intelligent Routing filters the candidate set in real time based on request parameters and rejects unsupported parameters (returning a 400 error in the form of does not support parameter(s): <parameter name>). The three calling protocols differ in parameter support, as described below:
- OpenAI compatible (Chat Completions)
- OpenAI compatible (Responses)
- Anthropic protocol
response_format: Routes only to candidate models that support this parameter.enable_search: Routes only to candidate models that support this parameter.reasoning_effort: By default, routes only to candidate models that support this parameter; this parameter supports only thenone,minimal,low,medium,high,xhigh,maxenumeration values.enable_thinking: Set tofalseto disable thinking, which favors non-thinking models; set totrueto automatically exclude non-thinking models and automatically enable thinking.max_tokens: When set, it is automatically converted to themax_completion_tokensparameter before being passed to the candidate models; routing selects only candidate models that support themax_completion_tokensparameter.
| Parameter | Description |
|---|---|
top_logprobs | Limits the number of logprobs returned |
logit_bias | Token bias |
stop | Stop sequence |
tool_choice | Tool selection |
parallel_tool_calls | Parallel tool calls |
logprobs | Whether to return logprobs |
top_p | Nucleus sampling |
temperature | Sampling temperature |
presence_penalty | Presence penalty |
n | Number of generations |
thinking_budget | Thinking budget length |
Cache
Intelligent Routing does not support explicit cache parameters:
- If a request is configured with explicit cache flags, the system ignores the explicit cache-related parameters.
- Explicit caching is not involved in billing.
Manage route service
View detail
After the deployment succeeds, click the service name in the Intelligent Routing list to open the details page, where you can view:
- Basic info: service name,
model-code, running status, routing strategy tag. - Route configuration: route model version, routing strategy, candidate set and candidate model list.
- Billing: pay-as-you-go, billed by the actual model's unit price.
- Deploy config: each candidate model's TPM/RPM throttle quota.
Modify route config
Click "Edit" in the Route Configuration area to modify route version, strategy, and candidate models. Switching version changes the candidate set, taking effect within a few minutes without affecting live requests. You can also edit it through the Update a Model Deployment Task API (PUT /api/v1/deployments/{deployed_model}/update); the semantics is full replacement: all three routing_config fields are required.
After selecting a specific version, online routing behavior remains long-term stable; please conduct a thorough evaluation before upgrading to avoid business impact. Current version: model-router-2026-0908. Route versions are not auto-updated.
Delete service
Delete the Intelligent Routing service from the Intelligent Routing list, or call the delete Intelligent Routing service API (DELETE /api/v1/deployments/{deployed_model}) to delete it directly. After deletion, the model-code cannot be reused; you must create it again.
Manage via API
Besides the console, creating, querying details, listing, editing the routing configuration, and deleting intelligent routing services are all supported through OpenAPI (pay-as-you-go billing only). For the complete API details, see Intelligent Routing API Reference. Supported APIs:
| Function | API |
|---|---|
| Get a list of model routing versions | GET /api/v1/deployments/model-routing/versions |
| Create an intelligent routing service | POST /api/v1/deployments |
| List intelligent routing services | GET /api/v1/deployments?plan=mr |
| Query intelligent routing service details | GET /api/v1/deployments/{deployed_model} |
| Edit the routing configuration | PUT /api/v1/deployments/{deployed_model}/update |
| Delete an intelligent routing service | DELETE /api/v1/deployments/{deployed_model} |
Routing effect
This chapter covers routing effect metrics and monitoring. Effect metrics are viewed on the detail page's "Routing effect" tab; call monitoring is viewed on the Model Monitoring page.
Routing metrics
View the following metrics on the detail page's "Routing effect" tab. The displayed metrics are estimates, for reference only; not for billing settlement; actual billing is based on "Cost and Usage":
Metric | Meaning | Anomaly action |
|---|---|---|
Total routing requests | Total requests received (including failover-succeeded) | Investigate upstream throttling/anomalies on spikes |
Routing success rate | Successfully forwarded requests ÷ total requests × 100% | On drop, check candidate model availability |
Actual model cost (estimated) | Full cost estimated at actual model list price (tiered billing: lowest tier; peak-valley: peak price; excludes free quota; deviates from actual billing) | On rise, check routing strategy and candidate set |
Baseline model cost (estimated) | Hypothetical cost if all handled by the baseline model (same estimation methodology) | — |
Savings | Baseline cost − actual cost (positive means routing saved cost) | — |
Billed request count | Successful requests that incur charges | — |
Spend share | Single-model cost ÷ total cost | On anomaly, check candidate-set distribution |
Cost notes
Cost analysis data has approximately a 1-hour delay and is not real-time.
The above costs are all estimated by catalog price as full cost, excluding account discounts and free quotas, for reference only to evaluate routing savings.
Tiered billing models use the lowest-tier catalog price; peak-valley pricing models use peak prices.
Actual billing can be viewed in "Cost and Usage".
Model monitoring
For more granular call monitoring, go to the Model Monitoring page.
It shows model monitoring and logs at the auto-model dimension, not individual monitoring of the actually-routed models.