Somewhere between the second team calling a model API and the first auditor asking which data went to which provider, the question changes. It stops being "which model should we use?" and becomes "how do we govern every call to every model?" An AI gateway is one answer to the second question, and it is not always the right one yet.
Short answer: an AI gateway is a service that sits between your applications and AI model providers and applies the same controls to every request: one API, routing, fallback, spend limits, audit logs, key management and data-handling policy. You need one when the number of teams, providers or data rules makes per-application controls impossible to keep consistent.
What does an AI gateway do?
Think of it as an API gateway that understands model traffic.
- One API. Applications call a single, stable interface, so switching or adding a model is a configuration change.
- Routing. Each request goes to a model by rule: cost tier, task type, latency, data classification or customer.
- Fallback. When a provider errors or throttles, the request retries down a defined chain.
- Spend limits. Cost is capped at whatever scopes the gateway supports, and requests are refused once a cap is reached.
- Audit. Each call records who called which model, when, with what outcome and cost.
- Key management. Provider credentials live in one place; applications get their own keys, revocable without touching the provider account.
- Data-handling policy. Sensitive content is redacted or blocked, and keys are restricted to approved models and regions.
Each function maps to a documented operational or security risk. The next three sections take the main ones in turn.
Rate limits and outages differ by provider
Providers meter usage on several axes. OpenAI's rate limits guide lists limits in requests, tokens, images and audio per minute or day, at organization and project level, with whichever limit you hit first taking effect. For 429 responses it says to treat Retry-After as a minimum wait, use exponential backoff with jitter when the header is missing, cap attempts and total retry time, and not retry quota, billing or other errors that need action.
Anthropic's documentation works differently. Limits are measured in requests, input tokens and output tokens per minute at the organization level, with optional per-workspace limits. The Start, Build and Scale usage tiers each carry a monthly spend cap; reaching it returns HTTP 429 with no retry-after header, so automatic retries fail until access resumes. A spend limit you set yourself returns HTTP 400 with an invalid_request_error. Ramp limits can also return a 429 after a sharp usage increase, even under your stated limits.
The numbers change; the lesson does not. A limit can surface as a 429 that means "wait a second", a 429 that means "stop until next month", or a 400. Applications should not each learn that. A gateway can normalize it once: retry the transient cases, fail fast on quota and spend errors, and fall back where policy allows. Outages are the other driver. Providers publish live status, as the OpenAI status page does with per-API status and incident history, and any dependency with a status page will have bad days.
Fallback is a data-handling event
If the primary model is covered by one set of provider terms and the fallback by another, a failover changes where your data goes. Define fallback chains per use case, restrict them to approved providers and regions, and make the model that actually answered visible in the response and the audit log. If data may not leave a boundary, the right behavior is to fail the request, not to reroute it quietly. Fallback also changes output quality, so evaluate every model in the chain on your own examples.
Spend and data risk need a control outside the model
Two entries in the OWASP Top 10 for LLM Applications 2025 describe problems a gateway is placed to reduce.
OWASP LLM10, Unbounded Consumption, covers excessive, uncontrolled inference, including denial of wallet. Its mitigations include rate limiting, user quotas and monitoring. Provider-side limits apply to your organization, not to the customer, feature or runaway agent loop that caused the spend. Finer-grained limits enforced before the provider call close that gap.
OWASP LLM02, Sensitive Information Disclosure, lists sanitization, pattern-based redaction, tokenization, least privilege and clear retention policy among its mitigations, and warns that system-prompt instructions "may not always be honored". A gateway is a control outside the model. Its limits are real, though: pattern-based redaction finds structured values such as emails and card numbers far more reliably than names or clinical free text. It narrows exposure; it does not replace deciding what may be sent at all. The piece on designing for data boundaries goes further.
NIST's Generative AI Profile (AI 600-1) names value chain and component integration as a risk: generative AI systems depend on many third-party components, which makes problems hard to attribute. A central record of the model served, the policy applied and the cost per request is the practical counter.
Do you need an AI gateway yet?
Our threshold test. Count how many of these are true today, not next year:
- Teams. Two or more teams or products call models with their own keys.
- Providers. You use more than one provider, or have a dated plan to add one.
- Spend volatility. The model bill moves month to month and nobody can attribute the change to a team, feature or customer.
- Agents. Something in production calls models in a loop. See what it takes to build agents that work.
- Resale. Customers consume AI features you bill for, so you need per-customer keys and limits.
- Regulated data. Personal, health, financial or contractually restricted data can reach a prompt.
- An audit request. Security, compliance or a customer has asked for a record of model use you cannot produce.
The rule we'd apply: zero or one, a well-structured client wrapper with timeouts, retries and a provider spend alert is enough, and a gateway would add a hop, a dependency and something to operate. Two or three, design for a gateway now, starting with one API and audit. Four or more, or either of the last two on its own, adopt or build one before the next release. Regulated data and audit requests trigger on their own because both need a single enforcement point you can show to someone else, and controls spread across applications are hard to evidence consistently.
Build, adopt or self-host
A thin proxy is a small project. A governed gateway is not. Build time hides in the long tail: streaming, normalizing error and usage formats across providers, token accounting that reconciles with invoices, per-key policy, tamper-resistant audit storage, redaction, key rotation, and keeping up with provider API changes. Then you operate it on the critical path of every AI request.
| Option | What you gain | What you give up |
|---|---|---|
| Build | Exact fit; no third party in the request path | Engineering time now and maintenance indefinitely; you own its uptime |
| Adopt a managed gateway | Breadth of providers and policy features quickly | A vendor on your critical path that also sees your traffic, so its terms join your data-flow diagram |
| Self-host open source | Control and no per-request vendor fee | Operations, upgrades and security patching become your team's work |
Our view, from engineering reasoning rather than a study: build when needs are narrow and stable and you already run an internal API platform; adopt when audit and policy features are needed soon and the gateway is not where you differentiate; self-host when control matters and you can staff the operations. Whichever you choose, keep application code on an OpenAI-compatible interface where possible. It keeps exit open.
What to test before you choose
- Failure behavior on a 429, a timeout, a quota error and a full outage, with the fallback visible in responses.
- Where policy is enforced: are caps checked before the provider call, and at which scopes?
- Audit quality: model served, tokens, cost, key and outcome per request, exportable.
- Data controls: what redaction detects and misses; per-key policy; region and provider restrictions.
- Keys: scoping, test keys, rotation and revocation.
- Latency overhead at your percentiles, including time to first streamed token.
- Exit: standard API surface, exportable logs and configuration.
A pilot with real traffic and a forced failure beats any feature matrix.
Conduix
Conduix is an AI gateway that iVirtualSoft builds and operates; it is listed on our products page. Its published llms.txt and governance documentation describe an OpenAI-compatible API, routing with fallback, spend caps, audit logging and configurable PII redaction. Confirm in the current documentation how each control is scoped before you rely on it, and put it through the same tests as any other gateway.
The takeaway: a gateway is worth its extra hop once consistency matters more than simplicity. Run the threshold test, and if it says not yet, write down which signal would change the answer.




