Short answer: the AI gateway in Azure API Management is a set of capabilities on the same gateway, not a separate product. Policies limit tokens, report token use, cache similar prompts, screen prompts for unsafe content and spread load across model endpoints. Capability depends on tier. Checked against Microsoft documentation on November 24, 2026.
What does the Azure API Management AI gateway do?
Microsoft describes the AI gateway as a way to secure, scale, monitor and govern AI models, agents and tools. It sits in front of language model APIs that follow the OpenAI Chat Completions or Responses schema, the Anthropic Messages API (v2 tiers) or the Google Vertex AI API. Models can run in Microsoft Foundry or at other providers such as Amazon Bedrock. The same gateway can also front remote MCP servers, A2A agent APIs and self-hosted models.
What the AI policies do
| Need | Policy or feature | Notes |
|---|---|---|
| Token limits and quotas | llm-token-limit | Per minute, or a quota per hour to year, by any counter key |
| Token metrics | llm-emit-token-metric | Custom dimensions, sent to Azure Monitor and Application Insights |
| Semantic caching | llm-semantic-cache-lookup, llm-semantic-cache-store | Needs an embeddings deployment and an external cache that supports vector search |
| Content safety | llm-content-safety | Uses Azure AI Content Safety |
| Resilience | Backends: load balancer and circuit breaker | Round-robin, weighted, priority-based and session-aware |
How do I limit tokens per team or per agent?
Microsoft's example limits tokens per minute for each subscription key:
<llm-token-limit counter-key="@(context.Subscription.Id)" tokens-per-minute="500" estimate-prompt-tokens="false" remaining-tokens-variable-name="remainingTokens"></llm-token-limit>The counter key can be a subscription, an IP address or any key your policy builds. That lets you limit by team, by application or by agent. The policy can estimate prompt tokens on the gateway so a request that is already over the limit never reaches the model. Model providers hand out quota as tokens per minute for each deployment, so the gateway is where you share that quota out fairly, which keeps one application from using all of it.
Security and access
- Use managed identities to authenticate to AI services in Azure, so there are no API keys to rotate.
- Use the credential manager to set up OAuth access for apps and agents that call APIs or MCP servers.
- Apply the content safety policy to screen prompts before they reach a model.
Resilience across model endpoints
Define each model endpoint as a backend, then add a load balancer and a circuit breaker. Microsoft notes that priorities let you use endpoints bought as provisioned throughput first. The circuit breaker can use the Retry-After header from a backend to set how long to stop sending it traffic. Scaling the gateway does not scale the models behind it, so place model deployments in the same regions as your gateways.
Logging
Enable logging for model APIs to record token use, prompts and completions in Azure Monitor and Application Insights. Decide before you start whether prompts may be stored. Where they may not, log metadata only.
How do we roll it out?
- List the model endpoints, owners and current quotas.
- Pick the tier from the features you need. See the tier and price breakdown.
- Import one model API and authenticate to it with a managed identity.
- Add a token limit keyed to the consumer, then the token metric.
- Add backends and a circuit breaker for the second endpoint.
- Turn on content safety and semantic caching last, and measure each.
- Register MCP servers and agent APIs behind the same gateway once model traffic is stable.
Decisions to make before you configure anything
| Decision | Why it matters | Owner |
|---|---|---|
| Who is a consumer: team, application or agent? | It sets the counter key for limits and the dimensions on token metrics. | Platform team |
| May prompts and completions be stored? | It decides whether logging captures content or only token counts. | Security and privacy |
| Which models sit behind which backend? | Priority and circuit breaker rules depend on it. | AI platform owner |
| Which tier? | Capability, network options and the Anthropic schema depend on tier. | Architecture and finance |
| Who approves a new MCP server or agent API? | Anything registered behind the gateway inherits its policies. | Governance lead |
Limits to know
- Capability varies by tier. Check the policy on your tier first.
- The Anthropic Messages API is supported in the v2 tiers only.
- The unified model API, which puts several providers behind one endpoint, is in preview.
- Integrating the AI gateway into Microsoft Foundry is also a preview.
- The gateway governs traffic. It does not decide which prompts are safe in your business. Put a hard rule after any classifier.
Questions we hear
Is the AI gateway a separate purchase? No. Microsoft says it extends the existing API gateway and is not a separate offering. You pay for the API Management tier and the services around it.
Can it govern MCP servers? Yes. It can expose a REST API as an MCP server or sit in front of an existing one. For the protocol rules, see MCP authentication with OAuth.
For how we approach the pattern across vendors, see AI gateway implementation.
A first engagement
Duczer East offers an AI gateway fit check: we map your model endpoints and agents against the policies above and return a short written plan, including which tier fits.



