WritingBasetenBasetenpublished Aug 25, 2026seen 2d

Ai Gateways Production Inference

Open original ↗

Captured source

source ↗
published Aug 25, 2026seen 2dcaptured 2dhttp 200method plain

The two AI gateway patterns in production inference Try the new DeepSeek V4 Pro 0813 today. Frontier intelligence at a fraction of the cost. Here

AI engineering

The two AI gateway patterns in production inference

Access gateways and serving gateways explained, and how they handle identity, tenancy, limits, and metering for teams serving AI models.

Authors

Amit Gambhir

Last updated August 25, 2026

Share

TL;DR An AI gateway centralizes the decisions surrounding a model request: who can make it, where it goes, what limits apply, what happens when infrastructure degrades, and how usage is measured. One useful way to understand the category is through two dominant patterns: gateways that help applications access many model providers, and gateways that help model owners serve their own models to many customers. Ultimately, gateway selection is more of an architectural decision than a procurement one.

Every model request carries more decisions than a prompt A customer sends a request to your model API. Before the model generates a single token, your system has to answer a surprising number of questions: Is the API key valid?

Which customer and plan does it represent?

Which model or deployment should serve the request?

Has the customer reached a usage limit?

Is the serving infrastructure healthy?

How will consumption be attributed?

And if part of the system is degraded, what should the customer see?

Every production AI system answers these questions somewhere. Without a deliberate architecture, the answers spread across application code, authentication services, infrastructure configuration, billing pipelines, and incident-response procedures, each with its own view of the request. An AI gateway brings those decisions into a consistent control layer. That layer is carrying more weight than it used to. Menlo Ventures estimated that enterprise spending on model APIs grew from roughly $3.5 billion in late 2024 to $8.4 billion by mid-2025 ( source ). Model calls now represent a meaningful and fast-growing operating expense, revenue stream, or both. The underlying systems have also changed: teams are no longer serving a single model behind a single endpoint. They are operating multiple model versions and deployments, exposing APIs to external customers, and treating inference as revenue-generating infrastructure. These questions matter to any team running AI in production, but they become existential when you own, fine-tune, or operate the models and need to expose them safely to multiple customers. In that situation, the gateway is no longer “just” a convenient interface to someone else's API. It becomes part of the product you are selling. Most AI gateways follow one of two patterns "AI gateway" has become a broad label for products that handle model routing, authentication, observability, cost controls, reliability, governance, or some combination of them. In practice, most production deployments follow one of two dominant patterns. ✕ Two dominant AI gateway patterns: application-side access to multiple model providers, and customer-facing access to models you operate. Access gateway: one application, many model providers In the first pattern, the application team is the gateway's primary user. The gateway presents one interface across different provider APIs, centralizes credentials and policy, collects usage data, and supports switching or falling back to external model services. This is the pattern most developers first associate with an AI gateway. Cloudflare AI Gateway, Kong AI Gateway, LiteLLM, OpenRouter, Portkey, and the Vercel AI Gateway are all commonly evaluated for application-side access and routing, although several span more than one function. Serving gateway: your model, many customers The second pattern reverses the traffic relationship: the gateway sits between external customers and the models your organization operates. The model owner — not an application consuming third-party APIs — is its primary user. The serving gateway’s job is to issue credentials, isolate tenants, enforce limits, expose a stable and branded API, meter consumption, and connect customer traffic to production model deployments. Both patterns centralize policy around model requests, but they optimize for different owners, traffic flows, and operational problems. Teams that treat them as interchangeable end up evaluating the wrong products. The question that separates the patterns is: whose traffic is the gateway controlling, and on whose behalf is it making decisions? An access gateway controls your application's outbound model traffic on behalf of an engineering or platform team. A serving gateway controls your customers' inbound traffic on behalf of your model business. That difference shapes the significance of nearly every capability. How a serving-side gateway processes a request The rest of this article follows the serving side. It's the less documented of the two patterns, and it's the one that changes your architecture most when you're the one who owns the models. The clearest way to understand what a serving gateway owns is to trace a single customer request through it. ✕ A serving-side gateway carries customer identity and context across routing, protection, inference, metering, and auditing. Establishing identity The gateway validates the credential and resolves it to the appropriate customer context: an organization, user, project, plan, or entitlement. The credential is the join key connecting a request to limits, usage records, billing, support, and audit history. A gateway that can tell you a key is valid, but not which customer or commercial policy it represents, can authenticate traffic, but can't operate a business on it. Selecting the serving path Once the caller is known, the gateway resolves the requested model and selects an eligible serving path, such as a deployment, region, capacity pool, or model version. In more sophisticated systems, that decision can take into account backend state: deployment health, capacity, or KV cache locality , so requests land where their existing context can be reused. Model routing is tied to model identity, capacity, availability, and customer policy; keeping that policy in the gateway lets teams change how a model is served without modifying every product that calls it. Protecting the service The gateway applies the policies that protect both the infrastructure and the other customers...

Excerpt shown — open the source for the full document.

Notability

notability 5.0/10

Substantive post on production AI inference gateways