What is an AI gateway?
An AI gateway is an intermediary that sits between applications and AI models and can apply shared access, routing, and usage rules to incoming requests.
An AI gateway is a software layer between applications and artificial intelligence models. It receives requests, sends them to the chosen service, and can apply shared rules for access, usage, and security. For example, it can tell apart the projects that use a language model (a system that processes and generates text) and record their usage without leaving every control to individual teams. Capabilities depend on the product and its configuration: a gateway alone cannot guarantee that every application passes through it, or that a filter catches every piece of confidential data. Compared with an API gateway, which manages access to software services in general, an AI gateway can add model-specific controls such as counting tokens, the units a model splits text into. Choosing one therefore depends on the available features and on how the organization enforces their use.
See also: API gatewayThe single entry point for externally exposed APIs: authentication, rate limiting, versioning and CORS handled outside application code.
Why it emerged as its own layer
An API gateway can authenticate a requester and limit the number of requests. With a model, however, two requests can consume very different amounts of text. OpenTelemetry's generative AI conventions distinguish input from output tokens: requiring both counts, tied to the project and model, makes reporting more useful than request counts alone. Estimating spend also requires the applicable prices and reconciliation against the provider's bill.
Model routing selects a request's destination. The Kubernetes project describes a case where the model name must be extracted from the request body before a destination is selected. The proposed portable solution is experimental: buyers should verify how a product makes that choice instead of assuming all gateways behave alike.
An enterprise example
A group of industrial companies wants to attribute usage of an internal assistant to its divisions. It configures authorized applications to use a gateway, assigns each an identity, and logs each request's model and token count. Before launch, it checks that counts still arrive for interrupted responses and compares estimates with the bill. A per-project limit can reduce the risk of denial of wallet, an attack that inflates pay-per-use spending, but it must be tested against the applications' real calls.
Why it matters for decision makers
Centralization also creates a dependency: if the gateway is unavailable, applications using it may stop working. Before choosing, agree on availability, failure recovery, key management, and the ability to export logs and configuration. Switching to an alternative model requires checks on quality, response format, and where data goes.
Logging involves choices too: OpenTelemetry warns that logged requests and responses are likely to contain personal data. Collect only what is needed and define access and retention. OWASP notes that sensitive information disclosure can also occur when attackers bypass filters, so application permissions and controls remain necessary alongside the gateway.
Frequently asked questions
Related terms
- API gatewayThe single entry point for externally exposed APIs: authentication, rate limiting, versioning and CORS handled outside application code.
- Model routingModel routing selects an AI model for each request, balancing answer quality and cost with the constraints that apply to the task and the company data involved.
- Prompt injectionPrompt injection is an attack that places deceptive instructions in an AI system's inputs to alter its responses or actions in ways nobody has authorized.
- Denial of walletAn attack that hits the bill instead of the service: it inflates pay-per-use cloud and AI API consumption, as in LLMjacking, until the cost becomes the damage.