หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Model router in Microsoft Foundry gives you frontier-level quality at a lower cost. It's a routing model, trained by Microsoft on billions of interactions, that judges how demanding each request is and sends it to the model best suited to answer it. Simple prompts go to small, fast models. Prompts that need deep reasoning or complex tool use go to frontier models. You call one model name, and model router chooses from more than 40 models from OpenAI, Anthropic, Microsoft AI, xAI, DeepSeek, Meta, and more.
Important
Features or capabilities marked (preview) in this article are in public preview and are subject to the Supplemental Terms of Use for Microsoft Azure Previews. Previews are provided without a service-level agreement, and Microsoft doesn't recommend them for production workloads. Certain features might not be supported or might have constrained capabilities.
Why use model router
- Frontier-level quality at a lower cost. In the default Balanced mode, model router picks the most cost-effective model within a small quality range of the best model for each prompt, so you pay frontier prices only for the prompts that need a frontier model. Simple prompts also go to faster models, which can lower average latency. Choose Quality or Cost to shift the tradeoff.
- 45 models, and growing. As of November 18, 2026, model router routes across 45 models from OpenAI, Anthropic, Microsoft AI, xAI, DeepSeek, Meta, and Fireworks. When you route across the full pool, new models join as they launch and retired models leave, with no changes to your code. For recent additions, see What's new in model router.
- The API you already use. Call model router with the Responses API, the Chat Completions API, or the Messages API (preview), from the SDKs, agent frameworks, and coding tools you already use.
- Smart about conversations. In a long chat or an agent loop, session affinity (preview) keeps the conversation on the same model when that pays off, so prompt-cache hits keep lowering your cost and latency.
- Built for agents and coding tools. Each step of an agent, or each request from a coding tool, can get a different model: a fast model for a quick classification or edit, and a reasoning model for planning or a hard refactoring.
- Resilient by default. If the selected model returns a retryable error, model router fails over to the next-best model automatically, with nothing to configure.
- Uses the capacity you already have (preview). Model router serves the selected model from your own deployments in the same Foundry resource first: provisioned throughput (PTU) for OpenAI models, and then pay-as-you-go. Router-managed capacity serves the rest. For details, see How model router chooses capacity.
- One endpoint, full visibility. You manage one model name, one rate limit, and one content filter. Each response's
modelfield names the model that answered, and your deployment's Monitor tab compares your cost with single-model baselines. - Start in minutes with Auto (preview). Set
modeltoautoon your Foundry resource or project endpoint. There's nothing to deploy: an endpoint and an API key are all you need.
Treat your first configuration as a starting point. Before you move production traffic, compare model router with your current model on your own prompts for quality, cost, and latency. For guidance, see Evaluate model router for your workload.
Ways to use model router
Auto and your own deployment use the same API calls. Start with Auto, and move to your own deployment later by changing model from auto to your deployment name, when you need dedicated rate limits, your own routing mode and model subset, a custom content filter, or Data Zone Standard.
| Way | What it is | Best for | Start here |
|---|---|---|---|
| Auto (preview) | Set model to auto on your Foundry resource or project endpoint. No deployment. |
The fastest start, prototypes, and light traffic. | Send your first request with Auto |
| Your own model router deployment | Deploy model-router and call it by deployment name. |
Production traffic, dedicated rate limits, a custom routing mode or model subset, a custom content filter, and Data Zone Standard. | Deploy model router |
| Agents and agent frameworks | Use a deployment as the model for Foundry Agent Service, Microsoft Agent Framework, LangGraph, OpenAI Agents SDK, Google ADK, CrewAI, and the Claude Agent SDK. LangGraph and the OpenAI Agents SDK also work with Auto. | Agentic apps where each step needs a different model. | Use model router with agents, agent frameworks, and coding tools |
| Coding tools | Use a deployment as the model in GitHub Copilot, Codex, OpenCode, or Claude Code. | Coding sessions that mix quick edits with hard problems. | Choose an integration |
| AI Gateway (automatic model selection is in preview) | An AI Gateway alias with automatic model selection uses model router to choose among the models behind the alias. | Teams that already route traffic through AI Gateway. | Use model router with AI Gateway |
Auto routes across all pool models available in your region with the Balanced routing mode, unless an admin configures Auto for the resource. For a side-by-side comparison, see Choose Auto or your own deployment.
Supported APIs
Call model router by using the API format your app already uses. All three formats work with Auto and with your own deployment.
| API format | Path | Endpoints | Models that can answer | Details |
|---|---|---|---|---|
| Responses API | /openai/v1/responses |
Resource and project | Models in your model pool | Use the Responses API |
| Chat Completions API | /openai/v1/chat/completions |
Resource and project | Models in your model pool | Use the Chat Completions API |
| Messages API (preview) | /anthropic/v1/messages |
Resource only | Claude models only, each deployed in the same Foundry resource | Use the Messages API |
The resource endpoint is https://<resource>.services.ai.azure.com, and the project endpoint is https://<resource>.services.ai.azure.com/api/projects/<project>. The https://<resource>.openai.azure.com host also works for the Responses and Chat Completions APIs. The /openai/v1/ path doesn't need an api-version query parameter.
Authenticate by using an API key or Microsoft Entra ID. Microsoft Entra ID callers need the Foundry User role on the resource or project. The Messages API takes the key in the x-api-key header instead of api-key. For streaming, tools, structured outputs, reasoning effort, and other features by API, see Feature support by API.
Routing modes
The routing mode sets the tradeoff between quality and cost.
| Routing mode | How model router chooses | Good fit |
|---|---|---|
| Balanced (default) | Considers models within a small quality range of the best model for the prompt (for example, 1–2%), and picks the most cost-effective one. | Most workloads. |
| Quality | Picks the highest-quality model for the prompt, and ignores cost. | Critical tasks, such as legal review, medical summaries, or complex reasoning. |
| Cost | Considers a wider quality band (for example, 5–6%), and picks the most cost-effective one. | High-volume, budget-sensitive workloads, such as content classification or simple Q&A. |
Set the mode on your deployment, or override it for one request with per-request controls (preview). Auto uses Balanced unless an admin configures Auto for the resource. To learn more, see Routing modes in depth and Choose a routing mode.
Models, regions, and versions
As of November 18, 2026, model router version 2025-11-18 routes across 45 models from OpenAI, Anthropic, Microsoft AI, xAI, DeepSeek, Meta, and Fireworks, using the pool models available in each region. It's available in 32 regions for Global Standard deployments, 23 of which also offer Data Zone Standard, and Auto works in all 32. Claude models need a deployment in your Foundry resource first, and Fireworks models need Fireworks enabled for your Azure subscription. For the full list, see Supported models.
Version 2025-11-18 is generally available and is the default for new deployments. Preview versions 2025-08-07 and 2025-05-19 retire on January 27, 2027, so move those deployments to 2025-11-18 before then. Each retirement date applies to a model router version, not to model router itself. For the full lists and lifecycle details, see Supported models, regions, and versions for model router.
Pricing
You pay a model router routing fee for each 1 million input tokens, plus the selected model's usage at that model's rates.
- The routing fee applies to Auto, to model router deployments, and to requests that your own deployments serve. When your own pay-as-you-go deployment of the selected model serves a request, you pay that deployment's usage plus the routing fee. When your provisioned throughput (PTU) deployment of an OpenAI model serves it, you pay only the routing fee, because you already pay for the PTUs.
- With AI Gateway, there's no model router routing fee while automatic model selection is in preview. AI Gateway has its own charges.
For the routing fee, see Model router pricing. To track spending, use your deployment's Monitor tab, which shows estimated cost and compares it with single-model baselines, or use Microsoft Cost Management. For steps, see Compare cost with single-model baselines and Track costs in Cost Management.
Data, privacy, and security
- Prompts aren't stored. Model router analyzes each prompt to route it, but it doesn't store your prompts.
- Where data is processed. With Global Standard, data can be processed in any geography where the selected model is deployed. With Data Zone Standard, data is processed within the data zone, and when your own deployments serve routed requests, model router uses only your Data Zone Provisioned and Data Zone Standard deployments. Auto always processes data as Global Standard. For details, see Data, privacy, and security for Foundry Models sold by Azure.
- Claude models. Anthropic provides the Claude models. For details, see Deploy and use Claude models in Microsoft Foundry.
- Fireworks models. Model router uses the Fireworks models only when an admin enables Fireworks for your Azure subscription and accepts its terms. For details, see Enable Fireworks on Foundry.
- Content filters. You set content filters (guardrails) on the model router deployment, and they apply to all traffic to and from it. You don't set filters for each underlying model. For Auto, the resource's content filter setting for instant access applies. For details, see Set capacity, content filters, and version and Configure Auto for your resource.
- Access control. Microsoft Entra ID callers need the Foundry User role, which also lets you read the resource's API key. For details, see Role-based access control for Microsoft Foundry.
- Governance. Admins decide which models model router can use. For a deployment, choose a model subset of approved models; Azure Policy checks the deployment's models when it's created or updated. For Auto, an admin can limit the models for each Foundry resource, or turn Auto off. For details, see Govern model router with Azure Policy.
- Azure Government. Model router isn't available in Azure Government. For details, see Microsoft Foundry in Azure Government.
Limitations
| Limitation | Details | What to do |
|---|---|---|
| Context window | The effective context window is the smallest context window among the models in your pool. A request with a larger context succeeds only if it's routed to a model that supports it. | Use a model subset of large-context models when you need long context. |
| Input types | Model router accepts text and image input, but it bases the routing decision on the text only. Audio input isn't supported. | Use a direct model deployment for audio. |
| Claude models | Model router routes to a Claude model only when that model is deployed in the same Foundry resource, with a deployment type that matches the model router deployment. The Messages API needs at least one such deployment. | Deploy the Claude models you want before you route to them. See Add Claude models. |
| Fireworks models | Model router routes to a Fireworks model only when Fireworks is enabled for your Azure subscription. | Have a subscription admin enable Fireworks. See Enable Fireworks on Foundry. |
| Optional parameters | When the selected model doesn't support an optional parameter, such as temperature on a reasoning model, model router drops it. |
To make every parameter required, use routing_config.require_parameters (preview). |
| Quota | Each model router deployment's TPM and RPM limits apply to every request it routes. Auto has its own limit, which depends on your region and quota tier. | See Quotas and limits for model router. |
For answers to common questions, see the model router FAQ.