supraj.dev

AI platform · Governance

What is an AI gateway?One front door for every model call.

Many teams now call many AI models from many providers. Each team keeps its own keys, writes its own retries, and finds out the cost when the bill arrives. An AI gateway puts one managed front door in the middle. This article explains the idea using Azure AI Gateway, which became generally available at Microsoft Ignite 2026, and shows how the same pattern looks on AWS and Google Cloud.

Supraj Maripeddi · · 15 min read

Cover: three apps send requests to one AI gateway, which checks who is calling, access, token and cost limits, content safety, routing and logging, then forwards calls to several model providers.
Start hereSeveral teams call several model providers, and nobody owns the keys, limits or bill as a whole.
Leave knowingWhat an AI gateway does on each request, and how Azure, AWS and Google Cloud offer it.
Keep in mindGateway cost numbers are estimates, not your provider's bill. A gateway adds control, not safety by default.

Imagine this: a company has five product teams building with large language models (LLMs). The support team uses a model in Microsoft Foundry. The documents team uses another provider. A new agent project wants both. Each team stores its own provider keys. Each team writes its own retry code. One night a batch job uses up the shared model capacity, and the support assistant starts failing. At the end of the month, nobody can say which team spent what.

That's a made-up scenario, not a real company. It is the problem an AI gateway is built for.

01 / The problem

What problem does an AI gateway solve?

The problem is repetition. Microsoft describes it plainly. As teams connect to models and tools from different providers, "managing each connection independently can duplicate credential handling and consumption controls while making usage harder to understand". [2]

In our scenario, that shows up as four gaps:

  • Keys everywhere. Every app holds provider credentials.
  • No shared limits. One busy workload can starve another.
  • No cost view. Spend is visible only per provider bill, not per team.
  • No single log. Each app logs model calls its own way, if at all.

A gateway fixes these in one place, so each app doesn't have to. Microsoft's phrase is "a shared point of control". [2]

02 / The idea

What is an AI gateway?

An AI gateway is a proxy that sits between your apps and the AI services they call. A proxy is a server that receives a request and forwards it on your behalf. Apps send requests to the gateway. The gateway decides whether to allow them, where to send them, and what to record.

Microsoft defines Azure AI Gateway as "a managed gateway for AI traffic, including requests to AI models and Model Context Protocol (MCP) servers". [2] MCP is an open protocol that lets AI agents discover and call tools. So the gateway covers both model calls and agent tool calls.

Azure AI Gateway became generally available (GA) at Microsoft Ignite 2026. The Azure Updates entry is dated 17 November 2026. It says the service was "previously available as the AI Gateway tier of API Management". [1] The product's own release notes list GA on 18 November 2026. [12]

Azure API Management is Microsoft's general gateway product for APIs (application programming interfaces). It also has AI gateway features. Microsoft now calls AI Gateway "a dedicated product for AI traffic". The two share a resource provider but use different resource types. [2] You can use both: keep business APIs in API Management and send model and tool traffic through AI Gateway. [4]

It is broad on providers. The docs list deployments in Microsoft Foundry, Azure OpenAI, OpenAI, Anthropic, Amazon Bedrock, Google Vertex AI, or compatible custom endpoints. Apps can call supported APIs such as OpenAI Chat Completions and Responses, and Anthropic Messages. [6]

03 / Under the hood

What happens to one request?

Microsoft sums it up in one sentence. On every request, the gateway "authenticates the caller, checks what it's allowed to use, applies your policies for access, cost, and safety, routes the call, and records telemetry". [6]

Figure 1 · One request through the gateway

  1. App sends a request with a key or token
  2. Gateway checks who is calling
  3. Gateway checks what the caller may use
  4. Policies: access, cost and safety
  5. Gateway routes the call to a backend
  6. Gateway records telemetry
All 6 steps
  1. Six steps. The app holds no provider key and writes no retry code.
Based on the Azure AI Gateway overview, security and policy docs. [6] [7] [8]

For the app, the change is small. Microsoft's quickstart shows a normal Chat Completions call, sent to the gateway's URL with a gateway key: [5]

curl --fail-with-body "$AI_GATEWAY_CHAT_URL" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \
  -d '{
    "model": "ai-foundry-demo-learn/gpt-6-1-sol",
    "messages": [
      {"role": "user", "content": "Give me three uses for an AI gateway."}
    ]
  }'

The model value is an alias. A model alias is a stable name that apps use, while the platform team decides which backend model it points to. [3] Microsoft adds a warning: changing the backend still means checking that the new model supports the app's API and behaviour. [3]

04 / Identity

Who is allowed through?

Azure AI Gateway keeps three kinds of access apart. [3]

People who manage it
Admins use Azure management permissions, through Azure role-based access control (RBAC), to change models, policies and keys. [8]
Apps that call it
Apps and agents use a Microsoft Entra token or a gateway API key. Entra ID is Microsoft's identity service. [8]

The third relationship is the gateway to the backend. The gateway signs in to the model provider with a managed identity or a backend credential. A managed identity is an Azure identity for a service, so no key needs to be stored. [3] [8]

The point is separation. "Permission to configure a gateway doesn't automatically grant permission to call its models or tools." [3] And provider credentials "belong in the gateway's backend configuration, not in client requests". [8]

Watch the API keys

A gateway API key grants gateway-wide runtime access. It does not identify the person behind a shared key. Microsoft says Entra authentication "is the preferred choice for production workloads". [8] [5]

05 / Fair sharing

How do you stop one team using everything?

With limits. A token is a small chunk of text that models count for usage and billing. Azure AI Gateway has three kinds of limit: a request rate limit, a token rate limit and a cost limit. [9]

Each limit has a counter. Count by identity, and each app gets its own allowance. Clear the counter dimensions, and all apps share one pool. [9] Microsoft's how-to uses two apps, a support assistant and a document processor, to show both choices.

Figure 2 · Separate allowances or one shared pool

Request rate
120 calls per 60 seconds, for each app
Token rate
200,000 tokens per minute, for each app
Cost
Estimated USD 100 a month by default; USD 200 for the support app
Trade-off
One app can't use up the other's allowance
Example values from Microsoft's "Limit requests by rate, tokens, or cost" guide. They are examples, not recommendations. [9]

Limits can sit at different scopes: the whole gateway, a model alias, a backend model or a tool. A narrower policy adds a control. It never grants an exception to a broader one. [7]

06 / The money

How does the gateway track cost?

It estimates. The gateway converts the tokens it sees into an estimated US dollar cost, and exports it as an OpenTelemetry metric. [10] OpenTelemetry is an open standard for metrics, logs and traces.

To split cost by team, give each app its own API key, or add selected Entra token claims such as a cost centre. Your reporting tool then groups the cost by key or claim. [10]

Three details matter before you trust these numbers:

  • They are estimates. Prices come from a Microsoft-maintained catalog. Negotiated discounts and reserved capacity can differ. "These are estimates, not billing records." [10]
  • Cost limits can overshoot. The gateway checks spend before admitting a request and charges the cost after the response. A request in flight can cross the limit. Rejections use an HTTP 403 (forbidden) error. [10]
  • Missing prices count as zero. If a model can't be matched to a price, its estimate can be zero. Microsoft says cost accounting "fails open" in that case, so a cost limit alone can't bound real spend. Add token and request limits too. [10]

07 / Reliability

What happens when a model is slow or down?

The alias can point to more than one backend. Then the gateway decides which one serves each request. The docs list these options: [13]

  • Priorities and weights. Spread requests across deployments, for example most to the current version and some to a new one.
  • Model failover. Retry a failed backend or switch to another eligible deployment, and temporarily skip failing backends.
  • Session affinity. Prefer the same backend for requests with the same session key.
  • Auto model selection. Pick a model per prompt. This is a preview feature.

Weights are simple ratios. Microsoft's example gives deployment A a weight of 5 and deployment B a weight of 1. A then gets about 83.3% of requests and B about 16.7%, while both are available. [14] Try your own numbers:

Figure 3 · How weights split traffic

A gets about 83.3% of requests and B about 16.7%.

Share = weight ÷ sum of weights, for backends at the same priority. Arithmetic only; see Microsoft's routing guide for retry behaviour. [14]

Failover arrived just before GA. The release notes for 12 November 2026 describe "ordered failure rules" that can retry the same backend or switch to the next eligible deployment, within a per-request retry limit. [12]

08 / Seeing and screening

What about logging and content safety?

Logging. The gateway exports metrics, logs and traces using OTLP, the OpenTelemetry protocol. You can send them to Azure Application Insights or to your own OpenTelemetry destination. [11] Traces show which alias was called, which backend was chosen, and which model actually answered. [11]

Prompts are a privacy question. Capturing request and response bodies is off by default. If you turn it on, it can export prompts, completions and tool inputs and outputs. Microsoft notes there is no built-in redaction of personally identifiable information (PII) in captured payloads. [11]

Content safety. The gateway can screen prompts with Azure AI Content Safety. For agent tools, it can curate or block individual MCP tools, and inspect tool calls with Agent hooks. [6] Agent hooks call your own decision service before a tool runs or after it finishes. That feature is in preview. [12]

Timing matters for tools. A check before a call can stop it. A check after a call can withhold the result, but "it can't undo work the tool has already performed". [7]

09 / The same pattern elsewhere

What does this look like on AWS and Google Cloud?

The pattern exists on both. The shape is different.

On AWS, the official answer is a reference design: Guidance for Multi-Provider Generative AI Gateway on AWS. It gives access to many LLMs "through a unified, industry-standard API gateway based on OpenAI API standards". [15] It runs the open-source LiteLLM proxy as containers on Amazon Elastic Container Service (ECS) or Amazon Elastic Kubernetes Service (EKS). It stores virtual API keys in Amazon Relational Database Service (RDS), and provider credentials in AWS Secrets Manager. Logs go to Amazon Simple Storage Service (S3). [15] The implementation guide says admins "can configure budgets, set rate limits, restrict model access", with retry and fallback across providers. [16] You deploy it from sample code and run it yourself. It is not a managed AWS service.

On Google Cloud, the answer is Apigee, Google's API management platform. Google says Apigee "provides AI gateway related features". [17] Its tutorial builds "a complete AI gateway" with Model Armor screening, routing across providers, semantic caching and automatic fallback. [18] Two policies handle tokens: PromptTokenLimit throttles prompt tokens, and LLMTokenQuota enforces token limits over a time period. [19] Model Armor and the semantic cache policies need an Apigee Comprehensive environment. [18]

Figure 4 · The same job on three clouds

What it is
Azure AI Gateway, a dedicated product for AI traffic
Who runs it
Microsoft: a fully managed service that scales automatically
Limits
Request rate, token rate and estimated cost limits
Safety
Azure AI Content Safety; MCP tool controls; Agent hooks (preview)
Failover
Priorities, weights and model failover rules on an alias
From each provider's official docs, read on 26 November 2026. [6] [15] [17]

10 / The decision

Do you need one, and what does it cost?

Price. Azure says you can start with 10,000 free gateway requests per subscription each month, with usage-based pricing after that. [1] Model usage is billed by the provider, separately.

Regions. You can create a gateway in 16 Azure regions, including East US, West Europe and Southeast Asia. It scales automatically. Microsoft still recommends load testing through the gateway to check latency. [20]

Older setups. If you used the AI Gateway tier of API Management, the resource type changes. Those older resources keep working until 15 January 2027. The runtime URL and the key header change too. The migration guide also lists the content safety policy as not supported on the new resource type, so check how you screen prompts before you move. [21]

You probably don't need a gateway yet if:

  • One app calls one model, and one team owns both.
  • You can't take an extra network hop on a very latency-sensitive path. Load test first. [20]
  • Your API program already runs on API Management, and its AI features cover what you need. Microsoft says those remain supported. [4]
What I'd do
  1. Add a gateway once a second team or a second provider shows up. That is when duplicated keys and limits start to hurt.
  2. Use Entra identities, not shared keys, for production apps. Give each app its own identity so cost and limits are per app.
  3. Set token and request limits as well as cost limits, because cost estimates can be zero or late.
  4. Leave payload capture off unless you have a reason and a retention plan for the data.
  5. On AWS, treat the guidance as code you own and patch. On Google Cloud, check your Apigee environment type before you plan on Model Armor.

Keep these names

A small glossary

LLM
Large language model. The kind of model behind chat and text generation.
Token
A small chunk of text. Providers count tokens for usage limits and billing.
Proxy
A server that receives requests and forwards them on the caller's behalf.
Model alias
A stable name that apps call. The platform team maps it to one or more backend deployments.
Backend
The model deployment or tool server that actually handles the request.
MCP
Model Context Protocol. A protocol that lets AI agents discover and call tools.
Microsoft Entra ID
Microsoft's identity service. Issues tokens that prove who a user or app is.
Managed identity
An Azure identity for a service, so it can sign in to other Azure services without a stored key.
RBAC
Role-based access control. Permissions granted through role assignments.
OpenTelemetry (OTLP)
An open standard for metrics, logs and traces. OTLP is its wire protocol.
Failover
Switching to another backend when the first one fails.

Check the concept

Can you explain it back?

1. Where do provider API keys live when you use an AI gateway?

In the gateway's backend configuration, or are replaced by a managed identity. Not in client requests.

2. A team admin can edit the gateway. Can they call its models?

Not automatically. Management permission and runtime permission are separate.

3. Weights are 5 and 1. What share does each backend get?

About 83.3% and 16.7%, while both are available.

4. The gateway shows an estimated cost of zero for a model. Was it free?

No. A missing price can show as zero. Cost accounting fails open, so add token and request limits.

5. Is the AWS multi-provider gateway a managed AWS service?

No. It is guidance with sample code that runs LiteLLM on ECS or EKS in your account.

Continue the thread

Around the same platform

Read further

Sources

All read on 26 November 2026. Provider pages are live and can change.

  1. Azure Updates: Generally Available: Azure AI Gateway (ID 580080, added 17 November 2026)
  2. Microsoft Learn: What is AI Gateway?
  3. Microsoft Learn: AI Gateway concepts
  4. Microsoft Learn: AI Gateway and Azure API Management service
  5. Microsoft Learn: Quickstart: Create an AI Gateway
  6. Azure AI Gateway docs: What is Azure AI Gateway?
  7. Azure AI Gateway docs: About policies
  8. Azure AI Gateway docs: Security and identity
  9. Azure AI Gateway docs: Limit requests by rate, tokens, or cost
  10. Azure AI Gateway docs: Attribute and cap model spend
  11. Azure AI Gateway docs: Observability
  12. Azure AI Gateway docs: Release notes
  13. Azure AI Gateway docs: Models and routing
  14. Azure AI Gateway docs: Distribute requests across deployments
  15. AWS Solutions Library: Guidance for Multi-Provider Generative AI Gateway on AWS
  16. AWS: Implementation guide for the Multi-Provider Generative AI Gateway guidance
  17. Google Cloud: Apigee AI capabilities
  18. Google Cloud: Build an AI gateway with Apigee
  19. Google Cloud: Apigee LLM token policies
  20. Microsoft Learn: AI Gateway region availability and scalability
  21. Microsoft Learn: Migrate from the AI Gateway tier in API Management

Written with AI assistance. Technical sources are listed above.