Ordainer Cap vs AI gateways
The situation
You ask "how do I cap my API customers' usage?" or "how do I stop a runaway agent?" and the answers point to AI gateways: LiteLLM, Vercel AI Gateway, Cloudflare AI Gateway. They are good tools, and they solve a nearby problem.
The short version: an AI gateway is a proxy between your app and the AI model providers it calls, and its limits are mostly dollar budgets and request-rate limits. Ordainer Cap is a check in front of your own API or MCP tool. It enforces the plans you sold, as a count of allowed calls per agent key, and it doesn't proxy your traffic.
What each gateway does
LiteLLM is an open-source gateway you host yourself (MIT license, with a separate Enterprise license for some features). It gives one endpoint for many LLM providers, and its docs also cover A2A agents and MCP tools, with per-key access control for MCP. Budgets are in dollars per key, user, team or customer, over a reset window you choose. It also has tokens-per-minute and requests-per-minute limits, and per-session caps for agents. It needs a database for key, team and user budgets.
Vercel AI Gateway is a hosted gateway for calling AI models across providers. Budgets are in dollars, per team, project, API key or user, and reset daily, weekly, monthly or not at all. Vercel's docs describe a budget as a soft cap: the request that crosses the limit still completes, and later requests get a 402. Rate limits are set by Vercel per model.
Cloudflare AI Gateway is a hosted gateway for calls to AI providers, including your own AI endpoints. It has request-rate limits (a number of requests per time window, answered with 429) and dollar spend limits over daily, weekly or monthly windows. A spend limit can be split by metadata such as an agent_id, so each agent gets its own budget. Cloudflare's docs say spend limits are eventually consistent and apply to models with known pricing.
What Ordainer Cap does
Your customers' integrations and AI agents call your API or MCP tool. Before your handler does any work, it sends the caller's agent key and the tool name to decide(). Cap checks that key's plan, answers allow or deny, counts the call in the same step, and writes one audit row. On a deny in enforce mode, the work doesn't run, and only that key is stopped. The same customer's other keys keep working. Plans you add in the console start in shadow mode, which logs what would have been denied and lets those calls run, until you switch them to enforce.
A plan is a count of allowed calls each month, day or minute, for one tool or for every tool. Your traffic doesn't route through us: the check sends the agent key, the tool name and, if you set them, an idempotency key, a mode or a session lease.
Side by side
| LiteLLM | Vercel AI Gateway | Cloudflare AI Gateway | Ordainer Cap | |
|---|---|---|---|---|
| What it's for | Your app's calls to LLM providers (also A2A agents and MCP tools) | Your app's calls to AI models | Your app's calls to AI providers | Your customers' calls to your own API or MCP tool |
| How it sits | Proxy you host | Hosted proxy | Hosted proxy | A check your handler calls; traffic doesn't pass through |
| Main limit units | Dollars; tokens and requests per minute; per-session caps | Dollars | Dollars; requests per time window | Allowed calls per agent key |
| Limit periods | Reset window you choose | Daily, weekly, monthly or none | Daily, weekly or monthly (spend); a time window you set (rate) | Month, day or minute |
| Who a limit applies to | Key, user, team, customer, session | Team, project, API key, user | Gateway, provider, model, or metadata such as agent_id | Each agent key |
When you'd use which
- You call AI models and want to control what your own app spends on them. That's what a gateway is built for.
- You sell an API or MCP tool and your customers' agents run past the plans you sold them. That's what Cap is for.
- Both. If your product calls models on the way out and sells an API on the way in, use a gateway for the first and Cap for the second. They don't overlap.
What Cap doesn't do
- It doesn't proxy traffic or call model providers.
- It counts calls, not dollars or tokens. If each call costs you money, cap the calls.
- It isn't a rate limiter. Keep your own rate limits for traffic spikes.
- One cap covering all of a customer's keys together isn't available today. Each key counts on its own.
See it work
- How to cap each API customer's usage, with code
- How to stop a runaway AI agent on your API
- Produce a real deny in the live demo
Facts about other products come from their official docs as of November 2026. If something has changed, tell us at support@ordainer.ai and we'll fix it.
Try it
Ordainer is free during the beta: sign up for test keys with 1,000 decisions a month, no credit card needed.
Using a gateway today and still seeing customers' agents run past their plans? We'd like to hear how you're handling it: support@ordainer.ai.