Duczer East
Healthcare

In-perimeter AI on governed clinical and operational data.

Financial Services

Private AI and data platforms built to clear model-risk and audit review.

Financial services

Private AI, KYC/AML, API gateways and data governance for banks.

Insurance

Change data capture, governed agents and integration for insurers.

Healthcare

PHI document intelligence, FHIR APIs and in-perimeter AI for health systems and plans.

GuideIntegration & Security5 min read

Azure API Management as an AI Gateway: Policies, Limits and Logging

A walkthrough of the policies that turn Azure API Management into a gateway for model calls.

Authored byCo-Founder and Managing Partner, Duczer East
Part of the Insights topic: API Management & Integration
On this page
  1. What does the Azure API Management AI gateway do?
  2. What the AI policies do
  3. How do I limit tokens per team or per agent?
  4. Security and access
  5. Resilience across model endpoints
  6. Logging
  7. How do we roll it out?
  8. Decisions to make before you configure anything
  9. Limits to know
  10. Questions we hear
  11. A first engagement

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

NeedPolicy or featureNotes
Token limits and quotasllm-token-limitPer minute, or a quota per hour to year, by any counter key
Token metricsllm-emit-token-metricCustom dimensions, sent to Azure Monitor and Application Insights
Semantic cachingllm-semantic-cache-lookup, llm-semantic-cache-storeNeeds an embeddings deployment and an external cache that supports vector search
Content safetyllm-content-safetyUses Azure AI Content Safety
ResilienceBackends: load balancer and circuit breakerRound-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?

  1. List the model endpoints, owners and current quotas.
  2. Pick the tier from the features you need. See the tier and price breakdown.
  3. Import one model API and authenticate to it with a managed identity.
  4. Add a token limit keyed to the consumer, then the token metric.
  5. Add backends and a circuit breaker for the second endpoint.
  6. Turn on content safety and semantic caching last, and measure each.
  7. Register MCP servers and agent APIs behind the same gateway once model traffic is stable.

Decisions to make before you configure anything

DecisionWhy it mattersOwner
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.

Related: Azure API Management consulting and pricing · Azure API Management pricing by tier · What is an AI gateway

Frequently asked questions

Can Azure API Management be an AI gateway?

Yes. It has token limit, token metric, semantic caching and content safety policies, backend load balancing, and support for MCP servers and A2A agent APIs.

Does it support non-OpenAI models?

Microsoft lists OpenAI Chat Completions and Responses, Google Vertex AI and, in the v2 tiers, the Anthropic Messages API, plus models from other providers such as Amazon Bedrock.

Is the AI gateway a separate product from API Management?

No. Microsoft describes it as an extension of the existing API gateway, with capability that varies by tier.

How does it share model quota between teams?

The token limit policy applies a tokens-per-minute limit or a longer quota to any counter key, such as a subscription key, so one consumer cannot use the whole deployment quota.

Can it authenticate to models without API keys?

Yes. Microsoft documents managed identities for authenticating the gateway to AI services in Azure.

Authored by

Co-Founder and Managing Partner, Duczer East

David deBoisblanc is co-founder of Duczer East and a digital transformation and innovation leader in data-centric AI, agentic systems, and enterprise integration. He shapes intent-driven AI solutions that modernize how organizations use data, drawing on deep experience with Cloudera and complex enterprise integration landscapes.

Newsletter

The Practitioner's Briefing

Senior-level insights on agentic AI, data engineering and enterprise integration, delivered to your inbox.

One email when there is something worth reading. Unsubscribe any time.

Let's Talk

Want to discuss the ideas raised here?

Tell us what you are working on. A senior practitioner replies, and only your email is required.

Get a quote