Guide · LLM gateway

LLM gateway vs AI gateway: how far each one reaches.

An LLM gateway governs calls to language models. An AI gateway puts the same controls in front of models, MCP tool servers and agent APIs alike.

Both sit between your applications and the AI services they call. This guide places each on one scale of scope, follows a model call through a gateway step by step, lists the jobs a gateway must do on every call, and shows how to decide which layer — or which combination — your systems need.

Updated · 7 sources

Narrow: one decision per promptBroad: every API in the company
1234
  1. LLM routerPicks which model should answer each prompt, usually by predicted quality or price.
  2. LLM gatewayOne door to every language model: keys, quotas, fallback, caching and cost for chat and embedding calls.
  3. AI gatewayThe same controls stretched over models, MCP tool servers and agent-to-agent APIs.
  4. API gatewayAuthentication, rate limits and routing for any HTTP API — AI or not. Many AI gateways are built as an extension of one.

What is the difference between an LLM gateway and an AI gateway?

An LLM gateway is a proxy for language model calls: it routes each request to an approved model, holds the provider keys, enforces token quotas, fails over between deployments and records what each call cost. An AI gateway applies those controls to all AI traffic — models, MCP tool servers and agent APIs — and is often an extension of an existing API gateway. In LLM gateway vs AI gateway, the difference is scope: every LLM gateway job is part of an AI gateway, but not the reverse.

Definitions

LLM gateway vs AI gateway, dimension by dimension.

Vendors use the two names loosely, and some products carry both. The useful distinction is what traffic each one is built to understand.

model traffic

LLM gateway

A single endpoint in front of many language model deployments. It speaks the chat, responses and embeddings APIs and understands tokens.

  • Chat, completion and embedding calls
  • Token quotas per team or application
  • Fallback across models, providers and regions
  • Cost per call, from token counts
all AI traffic

AI gateway

The control point for every AI service an organisation runs: models, the tools agents call and the agents themselves.

  • Model APIs, plus MCP servers and agent APIs
  • Sign-in and policy for tools as well as models
  • Content safety and data-loss checks on prompts
  • One inventory of AI services across teams
Tokens per model callUnit it metersTokens, tool calls and agent requests
Azure OpenAI, Gemini, Bedrock, self-hosted modelsTypical backendsThe same, plus MCP servers and agent endpoints
Built for model traffic from the startWhere it comes fromOften an extension of an API gateway
Which model, at what cost, with what fallback?Main buyer questionWhich AI service may each app or agent reach?
A key or an applicationKnows the caller asA key, an app, or a signed-in identity

One product, two names. Microsoft describes the AI gateway in Azure API Management as a set of capabilities that extends its existing API gateway, not a separate product, across language model APIs, remote MCP servers, agent-to-agent APIs and self-hosted models. Cloudflare’s AI Gateway documentation covers model traffic only — analytics, logging, caching, rate limits, retries and model fallback. Kong’s AI Gateway covers model traffic and also exposes and governs MCP tools and agent-to-agent traffic. The same name spans both scopes.

In the request path

An AI gateway sees every agent call; LLM gateway functions handle the model calls.

Every call an agent makes passes identity and policy first. Model calls then get quota, cache, deployment choice and fallback; tool and agent calls get routing and sign-in on the caller’s behalf.

One agent request, top to bottom
01
Application or agentSends a chat call, calls a tool or asks another agent for help.
chattool callagent call
02
AI gateway: identity and policyChecks who is calling and whether that caller may reach this model, tool server or agent.
OAuthmanaged identitycontent safety
03
LLM gateway functionsFor model calls: token quota, cache lookup, choice of deployment, fallback and token metering.
tokens per minutesemantic cachecircuit breaker
04
Tool and agent routesFor MCP servers and agent APIs: routing, sign-in on the caller’s behalf and logging.
MCPA2A
05
Providers and serversModel deployments in several regions and providers, and the systems behind each tool.
Azure OpenAIGeminiBedrockself-hosted
Capabilities

Eight jobs a gateway does on every model call.

Strip the product names away and every LLM gateway does the same core jobs. An AI gateway does all of them, then repeats the identity and logging jobs for tools and agents.

Model gatewayone endpoint between every app and every model
One endpointapps call one address; the gateway translates to each provider’s API
Key custodyprovider keys live in the gateway, or a managed identity replaces them
Token quotastokens per minute or per month, per app, team or key
Load balancinground-robin, weighted or priority across deployments
Circuit breakerstop sending to a backend that refuses, for as long as it asks
Cachingserve a repeated or near-identical prompt without a model call
Content checksscreen prompts and answers for unsafe content or personal data
Token meteringtokens and cost per caller, for showback and chargeback

Two kinds of cache

  • Exact cacheReturns a stored answer when the same request arrives again.
  • Semantic cacheEmbeds the prompt and returns the stored answer of a close-enough earlier prompt — fewer model calls, at the risk of answering a slightly different question.

Spillover saves money. Microsoft’s architecture guidance describes slightly under-buying reserved (provisioned) capacity and placing a pay-as-you-go deployment beside it, so the gateway sends overflow there. Clients see one endpoint; the bill sees full use of the reserved capacity.

Step by step

A model call through an LLM gateway: quota checked first, refusals routed by Retry-After.

The order matters. A gateway that checks quota after the call has already spent the tokens; one that retries a refusing backend at once turns one fault into many.

  1. Identify

    The gateway learns who is calling — a key, an application, or a signed-in person.

    auth
  2. Check the allowance

    It counts the prompt’s tokens and refuses up front if the caller’s quota would be exceeded.

    token limit
  3. Look in the cache

    A matching earlier answer returns without a model call.

    cache hit
  4. Pick a deployment

    Reserved capacity first, then pay-as-you-go; a nearby region before a far one.

    priorityweights
  5. Call with its own credential

    The app never holds the provider key.

    key custody
  6. Handle a refusal

    A 429 (Too Many Requests) may carry a Retry-After header (RFC 6585). The gateway breaks the circuit to that deployment for that long and moves the call to another one, rather than hitting the refusing endpoint again.

    429Retry-After
  7. Record

    Tokens in, tokens out, cached tokens, model, caller and cost go to one ledger.

    metering
Decision guide

LLM gateway vs AI gateway: provider count and tool traffic decide which you need.

Two questions settle it: how many model providers and deployments you run, and whether your agents call tools and other agents that also need governing.

Models, tools and agents
Agents on one cloudTool and agent calls still need sign-in, policy and logs. An AI gateway extension of the API gateway you already run fits well.AI gateway
Agents everywhereModels from several providers and tools across the business. You need both layers: model routing with fallback, and governance for tool traffic.Both layers
Model calls only
A few apps, one providerWith a few clients whose code you control and can update easily, Microsoft’s architecture guidance says the routing logic can live in that code. Add a gateway when clients multiply.Maybe neither yet
Many models, many teamsFallback across providers, one key holder and cost by team matter most.LLM gateway
One providerSeveral providers

What problem are you solving first?

Spend and quotasAn LLM gateway: token quotas per team, metering per call and cost by business unit.
Outages and rate limitsAn LLM gateway with load balancing, a circuit breaker that honours Retry-After, and deployments in more than one region or provider.
Agents calling toolsAn AI gateway — or an MCP gateway — so every tool call carries a signed-in identity and lands in one log.
All of the aboveBoth layers, with one identity model shared between them so a tool call and a model call by the same agent are traceable to the same person.
Evaluation

Questions to ask any LLM or AI gateway before you adopt it.

Most gateways demo the same dashboard. The differences show up under load, under failure and in the audit.

Ask the vendor, then test it
  • Who is the caller?Does the gateway know only an API key, or the application, team and person behind each call?
  • What happens on a 429?Does it wait for Retry-After and move to another deployment, or retry at once and multiply the load?
  • How many layers retry?Model client libraries retry on their own — OpenAI’s Python library retries a 429 twice by default. A gateway retrying on top, and an agent loop on top of that, multiplies one fault into many calls.
  • Is quota checked before the call?Counting tokens after the response turns a budget into a report.
  • Where do prompts go?Logging prompts and answers helps debugging and audit; it also creates a copy of sensitive data. Know where it lives and who reads it.
  • Can cost be split by team?Showback and chargeback need every call tagged with its team, project and application.
  • Does a semantic cache know its limits?A close-enough match can answer the wrong question. Check the similarity threshold and which routes it applies to.
  • Does it cover tool calls?Agents spend as much risk in tool calls as in model calls; MCP traffic needs identity and logs too.
On Botminds

The Botminds LLM gateway knows the agent, project and person behind every call.

A standalone gateway knows the caller you configure it to see — a key, an app, a signed-in identity. The gateway built into Botminds knows which agent, project, workspace and person every call belongs to, so routing, fallback and cost follow your organisation’s structure without re-pointing any application.

Standalone AI gatewayBotminds LLM gateway
Knows who is askingA key, an app or a signed-in identityThe agent, the project, the workspace and the person
Provider keysHeld by the gatewayHeld by the gateway, encrypted
FallbackConfigured per routeA pool per agent, across providers and regions
Rate limitsRefuses over the limitPaces to each deployment’s declared quota and spreads across the pool
SpendPer key, or per tag you add to each callAllowance checked before the run; cost per run, agent, project and workspace
Who may use a modelPolicy written per route and callerModels scoped to a project, a workspace or the environment
WiringEvery app re-pointedBuilt in; every agent has it

Models are records — Azure OpenAI and Azure AI Foundry deployments, Google Gemini, and OpenAI, AWS Bedrock or models you host added to the gateway’s model list — so moving a project to a newer model is one edit. Read the full design in the LLM gateway, and how agents use models in the Academy lesson LLMs and services. For tool traffic, see MCP for the enterprise.

Questions people ask

LLM gateway vs AI gateway: common questions.

The technology behind itLLM gatewayEvery model, with fallback and cost by team
What is the difference between an LLM gateway and an AI gateway?

In LLM gateway vs AI gateway, the difference is scope. An LLM gateway governs calls to language models: routing, keys, token quotas, fallback, caching and cost. An AI gateway applies the same controls to every AI service — models, MCP tool servers and agent APIs.

What does an LLM gateway do?

It gives applications one endpoint for every language model, holds the provider keys, enforces token quotas per caller, balances load and fails over between deployments, caches repeated prompts, and records tokens and cost for every call.

What is the difference between an LLM gateway and an API gateway?

An API gateway handles any HTTP API: authentication, request rate limits and routing. An LLM gateway understands model traffic — it counts tokens, translates between provider APIs, caches prompts and fails over between models. Several AI gateways are built as extensions of an API gateway.

Is an LLM gateway the same as an LLM router?

No. A router decides which model should answer a given prompt, often by predicted quality or price. A gateway decides how every call is made — with which key, under which quota, to which deployment, and with what fallback. A router can run inside a gateway.

What is an MCP gateway?

An MCP gateway sits in front of Model Context Protocol servers, so the tools agents call get the same treatment as model calls: sign-in, policy, routing and logs. Azure API Management and Kong both cover MCP servers alongside model APIs in their AI gateways.

Do I need a gateway if I only use one model provider?

Not always. Microsoft’s architecture guidance says that with a few clients whose code you control, the routing logic can live in that code. A gateway earns its place once many applications share quotas, teams need cost broken out, or you need failover across deployments and regions.

Does semantic caching make answers less accurate?

It can. A semantic cache returns the stored answer of an earlier prompt that is close in meaning, so a question that differs in one detail may get the earlier answer. Use it on routes where near-duplicate questions really share an answer, and tune the similarity threshold.

Does Botminds include an LLM gateway?

Yes. Every agent, workflow step and mesh on Botminds reaches its model through the built-in LLM gateway, which holds the keys, pools models across providers and regions, paces calls to each quota and records cost by team. See the LLM gateway.

See it on
your own work.

Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.