Unified Control Plane for GenAI: The AI Gateway Tier for Azure API Management
As generative AI transitions from experimental prototypes to mission-critical enterprise systems, organizations face a rapidly expanding web of AI models, agent frameworks, and contextual backends. Developers rarely rely on a single model provider anymore; instead, they mix and match specialized models based on cost, latency, context window size, or regional compliance. At the same time, AI agents require access to real-world enterprise databases, internal APIs, and Model Context Protocol (MCP) servers to perform meaningful tasks.
This explosion of endpoints creates significant hurdles for platform and security teams. Managing API keys scattered across application repositories, enforcing rate limits, preventing prompt injection, tracking token consumption across departments, and securing agent tool calls can quickly spin out of control.
To solve these challenges, Microsoft introduced the public preview of the AI Gateway tier for Azure API Management. Built on the enterprise-grade foundation of Azure API Management, this dedicated tier delivers a purpose-built runtime and portal experience tailored specifically for AI workloads. In this article, we’ll explore the architecture, real-world use cases, and hands-on deployment of the AI Gateway tier.
What is the AI Gateway Tier?
The AI Gateway tier is a fully managed runtime boundary and governance plane positioned between your applications (or AI agents) and backend AI assets. Instead of application code directly targeting distinct vendor endpoints with hardcoded API keys, all calls route through a single, secure gateway endpoint using a gateway-scoped runtime access key (api-key).
+-----------------------------------------------------------------------------------+
| Application & Agent Workloads |
| |
| +--------------------+ OpenAI / Anthropic Compatible Format |
| | AI Coding Agents | ----------------------------+ |
| | Cloud Native Apps | | |
| +--------------------+ v |
| +-----------------------+ |
| | Azure API Management | |
| | AI Gateway | |
| +-----------------------+ |
| | |
| +----------------------------------------+-------------------+ |
| | | | |
| v v v |
| +------------------+ +-------------------+ +------------------+|
| | Microsoft Foundry| | Multi-Cloud LLMs | | MCP Servers & ||
| | & Azure OpenAI | | Bedrock / Vertex | | Enterprise Tools ||
| +------------------+ +-------------------+ +------------------+|
+-----------------------------------------------------------------------------------+Key Capabilities and Architecture
- Multi-Provider Model Gateway: Applications call one stable endpoint (e.g.,
https://<gateway-name>.azure-api.net/models/openai/v1for OpenAI-compatible providers or/models/anthropic/v1/messagesfor Anthropic). The gateway holds the underlying provider credentials (preferring Managed Identities), keeping backend keys entirely hidden from client applications. - Federated MCP Tool Governance: Modern AI agents rely heavily on Model Context Protocol (MCP) tools to query enterprise knowledge sources. The AI Gateway allows platform teams to expose existing MCP servers over Server-Sent Events (SSE) or Streamable HTTP, convert existing REST APIs into MCP servers using OpenAPI specifications, or integrate with over 1,000 pre-built Logic Apps and Power Platform connectors. A single MCP server endpoint can federate multiple backends, automatically namespacing tools so conflicting tool names never collide.
- Card-Based Policy Governance: Standard Azure API Management relies on XML-based policy expressions. The AI Gateway replaces complex XML with visual Policy Cards in the Azure portal—or inline REST properties for Infrastructure as Code (IaC) workflows. The gateway evaluates every applicable policy before forwarding a request; if a policy blocks, it halts execution immediately without hitting the backend.
- Two-Tier Trust Boundary: Access to the gateway is split into two explicit security boundaries: inbound client authentication to the gateway, and outbound backend authentication to models or tools. Microsoft Entra ID governs the control plane, while backend authentication leverages Managed Identity, mTLS, OAuth, or API keys.
- Native OpenTelemetry Observability: The AI Gateway emits token-usage metrics over the OpenTelemetry Protocol (OTLP) for governed model traffic. Telemetry follows GenAI semantic conventions and can be exported directly to Azure Application Insights, Datadog, Splunk, or Grafana Cloud.
Real-World Scenario: Platform Engineering for GenAI
Imagine an enterprise platform engineering team serving five independent development squads building internal copilots.
- Without AI Gateway: Each team creates separate Azure OpenAI, Anthropic, or AWS Bedrock accounts, manages their own secrets in Key Vaults, writes custom code for rate-limiting, and lacks unified visibility into how many tokens are being consumed across the organization.
- With AI Gateway: The platform team provisions one central AI Gateway instance in Azure. They connect approved model deployments from Microsoft Foundry, Anthropic, and AWS Bedrock, along with corporate GitHub and database MCP tools. Application teams receive standard runtime access keys to call the shared gateway. The platform group enforces centralized rate limits and content safety guardrails while giving application teams full self-service freedom to select from approved assets.
Step-by-Step Implementation Guide
In this practical section, we will deploy an AI Gateway resource, establish secure VNet private networking, run the setup wizard to import models and MCP tools, apply rate-limiting policy cards, and execute a request through the gateway.
Technical Prerequisites & Region Availability
During its public preview phase, the AI Gateway tier is available with the following baseline parameters:
- Supported Regions:
East US 2andSweden Central. - Supported Model Backends: Microsoft Foundry, Azure OpenAI, OpenAI, Anthropic, AWS Bedrock, and Google Vertex AI.
- Networking Subnets: A delegated VNet integration subnet (minimum
/27,/24recommended) when configuring private networking. - Identity Requirements: Microsoft Entra ID for administrative portal access and Azure RBAC; runtime access keys (
api-keyheader) for applications and agents.
Step 1: Provisioning the AI Gateway Instance via Azure CLI
You can provision an AI Gateway resource using the Azure CLI or Azure Developer CLI (azd). Execute the following command to deploy a new gateway resource in a supported region:
# Register required resource providers
az provider register --namespace Microsoft.ApiManagement
# Create a resource group in a preview region
az group create --name rg-aigateway-prod --location swedencentral
# Provision the AI Gateway tier instance
az resource create \
--resource-group rg-aigateway-prod \
--namespace Microsoft.ApiManagement \
--resource-type service \
--name apim-aigateway-sweden \
--location swedencentral \
--sku name=AiGateway \
--properties '{}'Step 2: Configuring Secure Private Networking
Production AI workloads demand strict network isolation. The recommended pattern involves joining the gateway to a virtual network with dedicated subnets for integration and private endpoints:
- VNet Integration: Enable VNet integration on the gateway and select a delegated subnet (
/24or/27). - Inbound Private Endpoint: Create an inbound private endpoint in its dedicated subnet, link private DNS zones, and verify clients resolve the gateway’s address to its private IP.
- Outbound Backend Reachability: Ensure backend model endpoints and MCP servers are reachable via outbound private endpoints or internal private IPs.
- Disable Public Access: Once end-to-end traffic over private DNS is confirmed, disable public network access.
Step 3: Running the Guided Setup Wizard & MCP Configuration
The portal includes an automated setup wizard that scans your Azure subscriptions to discover existing model deployments and MCP servers.
- Open the AI Gateway Portal and select your gateway resource (
apim-aigateway-sweden). - Navigate to Home > Get Started > Configure.
- Import Foundry Models: Select your target Azure subscriptions. The wizard scans for Microsoft Foundry accounts and discovers active model deployments (e.g., gpt-4o, gpt-4o-mini). Choose Managed Identity as the backend authentication method.
- Add Custom Models or External Providers: For AWS Bedrock, Google Vertex AI, or Anthropic, select Add a custom model, provide the backend endpoint, and register model names.
- Federate MCP Tools: Connect remote MCP servers by URL using SSE or Streamable HTTP, upload OpenAPI specifications to turn REST endpoints into tools, or select Power Platform connectors.
- Configure OTLP Metrics Destination: Configure an OpenTelemetry Protocol (OTLP) exporter pointing to Azure Application Insights or an external collector to capture token-usage metrics.
Step 4: Applying Policy Cards (IaC / JSON)
While policies can be toggled visually in the portal, platform engineering teams can define them declaratively using JSON configuration for Infrastructure as Code workflows.
Here is an example policy definition enforcing a Token Rate Limit of 100,000 tokens per minute and turning on Azure AI Content Safety for a published model asset:
{
"name": "gpt-4o-governance-policy",
"properties": {
"targetAsset": "gpt-4o",
"policies": {
"tokenRateLimit": {
"enabled": true,
"tokensPerMinute": 100000,
"counterKey": "context.Subscription.Id"
},
"contentSafety": {
"enabled": true,
"severityThreshold": "Medium",
"blockCategories": ["Hate", "Sexual", "SelfHarm", "Violence"]
},
"fallback": {
"enabled": true,
"secondaryModel": "gpt-4o-mini"
}
}
}
}Step 5: Calling Governed Models from Application Code
Once your models are published and a runtime key is generated from the portal’s Keys page, client applications can call the gateway using standard OpenAI or Anthropic SDKs simply by altering the base_url.
Python Example using the Standard OpenAI Client Library:
import os
from openai import OpenAI
# Initialize client pointing to the AI Gateway runtime endpoint
client = OpenAI(
base_url="https://apim-aigateway-sweden.azure-api.net/models/openai/v1",
api_key="aigw_live_8f92a1b3c4d5e6f7a8b9c0d1e2f3a4b5" # AI Gateway Runtime Key
)
# Submit a chat completion request through the gateway
response = client.chat.completions.create(
model="gpt-4o", # The exact published model name configured on the gateway
messages=[
{"role": "system", "content": "You are a helpful platform engineering assistant."},
{"role": "user", "content": "Explain the architectural benefits of an AI Gateway tier."}
],
temperature=0.7
)
print(f"Response: {response.choices[0].message.content}")
print(f"Prompt Tokens: {response.usage.prompt_tokens}")
print(f"Completion Tokens: {response.usage.completion_tokens}")Observability & Inspection
Because the gateway emits OpenTelemetry data with standard GenAI semantic attributes over OTLP, platform teams gain immediate visibility in Application Insights or Grafana:
- Token Consumption over Time: Track input vs. output token counts segmented by model, application key, or team.
- Latency Heatmaps: Compare time-to-first-token (TTFT) and total generation time across Azure OpenAI, Anthropic, and AWS Bedrock.
- Throttling & Error Events: Monitor HTTP
429 Too Many Requeststriggered by token rate limit policies before reaching backend models.
Closing Words
In this article, you explored the AI Gateway tier for Azure API Management. You learned how it bridges the gap between AI application teams and platform engineers by providing a unified gateway for multi-provider models and federated MCP servers. You also implemented a complete setup using the setup wizard, applied private networking patterns, configured OTLP observability, and applied governance policies via policy cards.
You now have a solid foundation for centralizing, securing, and observing AI workloads across your entire cloud estate. From here, you can start integrating custom MCP servers created from OpenAPI specifications, implement private networking with Azure Private Endpoints, or connect Microsoft Foundry-hosted agents directly to governed gateway tools.
Thank you for taking the time to go through this post and making it to the end. Stay tuned, because we’ll keep continuing providing more content on topics like this in the future.
Author: Rolf Schutten
Posted on: August 4, 2026