Intelligent Routing dynamically analyzes user request content and automatically matches the most suitable model from the candidate model set to process each request, helping enterprises achieve optimal AI resource allocation in complex scenarios.
Overview
The model-code of Intelligent Routing is fixed with the auto-model prefix followed by 8 random characters (for example, auto-model-abcd1234). The client sends a request via 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 and retains the real token usage).
Applicable scope:
| Dimension | Description |
|---|---|
| Region | Beijing (cn-beijing) + Singapore (ap-southeast-1) |
| Model type | Text input only |
| 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 protocol: 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 limit | Rate limits are applied based on the actual routed model, at both the account and workspace level |
- Maximized model performance: Automatically matches the optimal model for each task, particularly suited to users with the most demanding performance requirements.
- Precise cost reduction: Automatically routes simple tasks to lightweight models and matches complex tasks with advanced models, avoiding the resource waste of assigning an oversized model to a small task and achieving precise alignment between cost and needs.
- Eliminates model selection difficulties: 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.
- Effortless usage experience: Fully consistent with the standard model integration process; simply invoke via model-code, with no code changes required.
Create an Intelligent Routing
Under "Model Inference > Intelligent Routing" in the Bailian Console, 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 permission to call that version and the candidate models.
Procedure
- Enter the service name (required, up to 50 characters).
- Select a released version from the routing model version dropdown (maintained by the platform).
- Select "Performance first" or "Cost first" as the routing strategy.
- In the candidate model set, select the candidate models (at least 2).
- Click Confirm Deployment to complete the creation.
model-code (in the format of auto-model-XXXXXXXX), and clients use this model-code to make calls. A deleted model-code is not reused.
In addition to the console, you can also create intelligent routing through OpenAPI. For interface details, see the Intelligent Routing API reference.
Routing strategy
The routing strategy determines which model in the candidate model set processes each request. Both strategies dynamically match models based on request content (not fixed routing) and are selected at creation time.
Strategy | Model selection mechanism | Applicable scenarios |
|---|---|---|
Performance first (EFFECT_FIRST) | Selects the highest-performing model in the candidate set for each request | Scenarios with stringent 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 minimum performance threshold | Cost-sensitive, high-concurrency scenarios where latency and unit cost are primary concerns |
Candidate model configuration
The candidate model set is the range of models the routing service can choose from when selecting a model. When creating an Intelligent Routing, select the models to participate in routing from the candidate list in the "candidate model set" area. Select at least 2 candidate models; otherwise the deployment cannot proceed.
- model-router-20260908
Candidate models | Input | Cached input | Output |
|---|---|---|---|
| $0.15 | $0.016 | $0.47 |
| $3 | $0.3 | $15 |
| 0-256K:$0.4 256k-1M:$1.2 | 0-256K:$0.08 256k-1M:$0.24 | 0-256K:$1.6 256k-1M:$4.8 |
| $0.44 | $0.044 | $1.32 |
| $0.22 | $0.022 | $0.66 |
| $2.5 | $0.5 | $7.5 |
| $1.4 | $0.28 | $4.4 |
| $1.32 | $0.132 | $3.96 |
| $0.66 | $0.066 | $1.98 |
| $2 | $0.25 | $6 |
| 0-32K:$0.03 256k-1M:$0.2 32k-256K:$0.1 | 0-32K:$0.006 256k-1M:$0.04 32k-256K:$0.02 | 0-32K:$0.13 256k-1M:$0.8 32k-256K:$0.4 |
Invoke Intelligent Routing
After an Intelligent Routing is created, it is invoked in the same way as a regular model—simply replace the model parameter in the request with the Intelligent Routing model-code (such as auto-model-abcd1234), enabling zero-code-change integration on the client side. Three invocation methods are supported: the OpenAI-compatible API (Chat Completions, Responses) and the Anthropic protocol. Invocation examples are shown 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 executed the request, which you can use to verify whether routing took effect; the response body retains the real token usage, and billing is based on 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, which is enabled by default and requires no configuration. When the target model is unavailable, the routing service re-initiates the entire request with another model in the candidate set instead of switching midway through inference.
Automatic failover is not triggered in the following cases; errors are passed through directly with 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)
- Timeout or network exceptions
- Errors occurring after a streaming response 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 call.
- Filters out models that have been taken offline.
- Filters out models that are incompatible with the current request parameters (for example, if the request carries
response_format, it routes only 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 (for all three interfaces: Chat Completions, Responses, and Messages); image and video input, image generation (text-to-image), Batch (batch inference), and non-generation interfaces such as Embedding/Rerank are not supported |
| Context length | Upper limit = the minimum context window among the models in the candidate set; requests exceeding the limit fail immediately without triggering automatic failover |
| Rate limiting | RPM/TPM rate limiting applies to the actually routed model at the account and workspace level; during automatic failover, only the consumption of the model that finally succeeds is counted |
Parameter description
Intelligent Routing filters the candidate set in real time based on request parameters and rejects unsupported parameters (returning a 400 error such as does not support parameter(s): <parameter name>). Parameter support differs across the three calling protocols, described separately 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 the enumeration valuesnone,minimal,low,medium,high,xhigh, andmax.enable_thinking: set tofalseto disable thinking, with a preference for non-thinking models; set totrueto automatically exclude non-thinking models and enable thinking.max_tokens: when set, it is automatically converted to themax_completion_tokensparameter and passed to the candidate model; during routing, only candidate models that support themax_completion_tokensparameter are selected.
| Parameter | Description |
|---|---|
top_logprobs | Limits the number of returned logprobs |
logit_bias | Token bias |
stop | Stop sequences |
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 the request is configured with an explicit cache flag, the system ignores parameters related to explicit caching.
- Explicit caching is not involved in billing.
Manage route service
View detail
After a successful deployment, 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
In the "Routing Configuration" area of the details page, click "Modify" to change the routing model version, routing policy, and candidate models. When you switch the routing version, the candidate model set changes accordingly; changes take effect within a few minutes and do not affect live requests. You can also edit via the update model deployment API (PUT /api/v1/deployments/{deployed_model}/update), whose semantics are full replacement — all three fields of routing_config 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 an 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. A model-code cannot be reused after deletion; you must create a new one.
Manage via API
In addition to the console, the creation, detail query, listing, routing configuration editing, and deletion of the Intelligent Routing service can all be performed through OpenAPI (pay-as-you-go billing method only). For complete API descriptions, see the Intelligent Routing API reference. Supported APIs:
| Feature | API |
|---|---|
| List 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 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 | 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.