A futuristic cloud security and AI workflow dashboard routes data through servers in a modern data center.
Microsoft has opened a public preview of automatic model selection in Azure AI Gateway. Applications keep calling the same model alias, but the alias no longer has to point every request at the same model. Microsoft Foundry’s model router ranks the eligible models registered behind that alias for the incoming prompt, and AI Gateway applies the organization’s routing rules to select the backend. The router ranks; the backend does the work, uses its own quota, and bills for the request. AI Gateway itself is generally available. Automatic selection is the part in preview.

A futuristic cloud security and AI workflow dashboard routes data through servers in a modern data center. Which wins: model fit or capacity you already pay for?​

The most consequential setting isn’t Balanced, Quality, or Cost. It’s what the gateway does when the router’s top pick and your preferred deployment disagree. Microsoft Learn documents two ways to settle that question.

  • Model first considers models across priority groups. Once the gateway picks a model, it uses that model’s highest-priority group. This lets you favor provisioned capacity for a given model without ruling out a different model that might suit the prompt better.
  • Priorities first confines selection to the highest-priority group. A model in a lower-priority group won’t win just because the router ranks it higher. If the top group contains only one model, there’s no model choice for the router to make within that group.

Say you’ve reserved throughput for a model that handles routine support summaries, and you’ve registered a second, pay-as-you-go model for tougher requests at a lower priority. If the router favors the second model for a long case history, Model first can send it there. Priorities first keeps the request on the reserved deployment. Neither choice guarantees a lower bill: one can make better use of capacity you’ve already committed to, while the other lets you spend on a different model when the router judges it a better fit.

The objective is a separate choice. Balanced weighs quality against cost, Quality favors the highest-quality eligible model without regard to price, and Cost favors less expensive models, potentially at the expense of quality on harder prompts. Weights come into play later: they split traffic among backends serving the same model at the same priority, not among different models competing for the request.

What to check before turning it on​

For a non-production trial, start with an AI Gateway alias backed by at least two supported models that share the API format your application actually uses. The backends can be in Foundry or Azure OpenAI, at another provider, or on your own OpenAI-compatible endpoint, but the router must support each model. In the AI Gateway portal, create or edit the alias, enable Choose a model based on the prompt, and pick the objective and precedence. Map each backend to its versionless router model name, then set priorities and weights. Lower priority numbers are preferred. For REST configuration, Microsoft documents API version 2026-11-01; the preview is available wherever AI Gateway is offered.

An unchanged alias name doesn’t guarantee an unchanged API contract. The alias exposes only the formats every registered model supports. Add a Chat Completions-only backend, for example, and the alias no longer exposes the Responses API. Nor does the gateway rewrite request parameters for the chosen model: a non-default temperature can produce an error if that model doesn’t accept it. Microsoft also says to put Claude and OpenAI models on separate aliases because they don’t share the required API format. Check the actual payloads your clients send, not just whether a bare test prompt returns an answer.

Multi-turn applications need a separate test. A Responses API follow-up that includes previous_response_id goes back to the backend that served the earlier turn, without a fresh ranking. That means a conversation that starts with a simple question and gets harder won’t automatically switch models on the harder turn. Microsoft’s documented alternatives are to send the conversation history with each request if you want the gateway to rank every turn, or to call the Foundry model router directly. The latter is a different integration, not a setting on the gateway alias.

Measure the routing decision, not just the answer​

Gateway authentication and policies still apply: callers can use Microsoft Entra ID or a gateway runtime API key, and the gateway can enforce configured token and cost limits. With a telemetry destination such as Application Insights, traces can show the ranking, the chosen model, and time spent ranking. For a useful pilot, run the same representative prompts under both precedence settings and compare which deployments actually serve them, how often requests fail on parameter compatibility, and whether answer quality justifies any shift to pay-as-you-go capacity. Test a stateful follow-up separately so it doesn’t get mistaken for a fresh routing decision.

Microsoft is waiving the model-router routing fee for this integration during preview, not the AI Gateway charge or backend usage charges. It says routing fees will apply at general availability, and it does not recommend the preview for production workloads or provide a preview SLA. The useful question for a trial, then, isn’t whether the feature can route a prompt. It’s whether it makes better choices on your workload without breaking the API contract or sending more traffic than intended away from capacity you already pay for.

 

References

  1. (In preview) Public Preview: Use model router with AI Gateway Azure Updates 2026-11-23T20:15:53Z
  2. Use model router with AI Gateway - Microsoft Foundry | Microsoft Learn learn.microsoft.com