# What is an AI gateway?

> An AI gateway sits between an application and one or more model APIs. It can centralize authentication, expose compatible request formats, select eligible routes, measure usage, and enforce access or spend boundaries. It does not make different models equivalent or remove the need for application-level evaluation and error handling.

_Last reviewed 2026-08-15 · [Editorial review](https://keeprouter.com/editorial-policy#editorial-team)_

## The request path

```text
Application -> AI gateway -> eligible model route -> model maker
            <- normalized response and measured usage <-
```

The application authenticates to the gateway and names a model or routing policy. The gateway validates the key, checks route compatibility and commercial rules, forwards the request, then returns a client-facing response and usage record. A managed gateway may also provide one billing relationship for a published catalog; a self-hosted gateway usually connects credentials your team already owns.

## What is commonly centralized

- API keys, model allowlists, rate or spend controls;
- compatible OpenAI- or Anthropic-shaped routes;
- canonical model IDs and route eligibility;
- request status, token counts, latency, and cost attribution;
- bounded retry or failover between eligible routes for the same public model.

## What is not safely universal

Tool semantics, reasoning fields, image input, context limits, structured output, safety behavior, regional availability, and response quality vary by model and route. “Compatible” describes a client contract, not identical capability. A gateway also cannot make a side-effecting agent retry safe unless the application provides idempotency.

## Managed, self-hosted, or direct

Use a managed gateway when you want a hosted access and billing layer with low operational overhead. Use a self-hosted gateway when infrastructure control, custom policy, and bring-your-own provider credentials justify operating the proxy and its data stores. Use direct APIs when one provider-specific feature or contract is the primary requirement.

## When you probably need one

An AI gateway becomes useful when several services share model access, teams need attributable keys and spend limits, model evaluation is frequent, or compatible clients must reach more than one maker. A single small workload with one stable provider may be simpler as a direct integration.

For a concrete decision sequence, use [how to choose an AI gateway](/answers/how-to-choose-an-ai-gateway). The [managed versus self-hosted guide](/compare/managed-vs-self-hosted-ai-gateways) then makes deployment, credential, data, and on-call ownership explicit.

## Frequently asked questions

### Is an AI gateway the same as an API gateway?

It applies API-gateway controls to model-specific concerns such as model IDs, tokens, tool streams, and provider routes.

### Does an AI gateway improve answer quality?

Not automatically. Quality depends on model, prompt, context, tools, and your evaluation.

### Can it hide every provider difference?

No. It can normalize common request shapes, but model-specific features and behavior still differ.

### Should I manage or self-host the gateway?

Choose managed for less operations and self-hosted for deeper infrastructure and credential control.

## Sources reviewed

1. [Cloudflare AI Gateway overview](https://developers.cloudflare.com/ai-gateway/)
2. [Kong AI Gateway overview](https://developer.konghq.com/ai-gateway/)

## Related guides

- [Unified LLM API](https://keeprouter.com/features/unified-llm-api.md)
- [KeepRouter vs LiteLLM](https://keeprouter.com/compare/litellm.md)
- [AI gateway guide: what it controls, when to use one, and how to adopt it](https://keeprouter.com/blog/ai-gateway-guide.md)
- [engineering teams](https://keeprouter.com/built-for/engineering-teams.md)

## Verify it with the live product

Check the live model catalog, create a free-scoped key, and inspect the resulting request evidence.

[Create a free key](https://keeprouter.com/login?returnTo=%2Fconsole%2Fkeys%3Fmodel%3Dfree) · [Live models and pricing](https://keeprouter.com/models.md)
