AI Gateway: One Control Point for LLM Spend
Applications call one endpoint with one key. The gateway decides which provider answers, what it may cost, and who it is billed to.
An AI gateway is a proxy that sits between your applications and the large language model providers they call. Instead of every service holding its own OpenAI, Anthropic, or Bedrock credentials, each service calls the gateway with a key the gateway issued. The gateway translates the request for the chosen provider, forwards it, and records what it cost. Because every call passes through one place, that place can enforce budgets, restrict which models a team may use, pick a cheaper model when a request is simple, and report spend by team.
Why LLM spend needs its own control point
Cloud cost tools read bills after the fact. LLM spend behaves differently: it is metered per token, it is spread across several vendors with different price sheets, and it can grow from zero to significant within a day when a new feature or an agent loop ships. A provider bill shows spend per account; it does not know which team or feature made a call unless something in front of it records that. A gateway fixes the attribution problem by issuing its own keys, and fixes the enforcement problem by refusing requests once a key’s budget is spent.
What a gateway controls
- Credentials: provider keys stay in the gateway. Teams receive gateway-issued keys that can be rotated or revoked without touching the provider account.
- Budgets: a hard spending cap per key, team, or organization, checked before a request is forwarded.
- Model access: an allow-list per key, so a prototype key cannot call the most expensive model.
- Routing: sending short or simple prompts to a cheaper tier and harder ones to a stronger model.
- Reporting: spend, request counts, latency, and failures by provider, model, and key.
Questions to ask before adopting one
Does it store prompts and responses? Some gateways log full request content for debugging. That is useful, and it also creates a copy of whatever users typed. Decide where that data may live before you route production traffic.
How is one tenant isolated from another? On a shared gateway, check whether a key’s model list restricts which deployment answers, or only which model name may be called. The two are not always the same.
What happens when the gateway is down? It is now on the request path for every LLM call.
ZopNight’s AI Gateway
ZopNight includes an AI Gateway capability for LLM cost governance. It is in limited availability today; ask us about access. It connects OpenAI, Anthropic, OpenRouter, and AWS Bedrock; connecting a provider verifies the credential with the vendor and registers a curated cheap and strong model set, and any other model the provider offers can be added. Per-team virtual keys carry hard USD budgets and model allow-lists, an org-wide budget ceiling caps total spend across keys, and a complexity router assigns prompts to a cheap or strong tier using length, max-tokens, and keyword rules, with a dry-run to test a prompt. Spend is reported by provider, model, tier, and team.
On the questions above: requests and responses pass through a ZopNight-hosted LiteLLM gateway, shared across organizations today, and the complexity router reads each prompt to choose the cheap or strong tier. Tenant isolation is enforced at the model name, because each organization’s deployments are registered under an organization-prefixed name and each key carries an alias to its own organization’s deployment. If the upstream gateway is briefly unreachable, the spend view shows a stale banner instead of reporting zero.
For the wider practice this fits into, see LLM cost governance; for Bedrock-specific levers, see the AWS Bedrock cost optimization guide.
Questions we get a lot.
If yours isn't here, email us and we'll answer directly.
Does ZopNight see my prompts?
Yes. Prompts pass through a ZopNight-hosted LiteLLM gateway, and the complexity router reads each prompt to choose the cheap or strong tier.
Which providers can ZopNight's AI Gateway connect?
OpenAI, Anthropic, OpenRouter, and AWS Bedrock. Connecting one verifies the credential with the vendor and registers a curated cheap and strong model set.
Is a gateway budget a hard cap?
In ZopNight, yes: each virtual key has a hard USD budget enforced by the gateway, and an optional org budget ceiling caps total spend across all keys.