Usage caps vs rate limiting: what's the difference?
The short answer
A rate limit protects your servers. It caps how many requests a caller can send per second or per minute.
A usage cap enforces a plan. It caps how much one customer's key or AI agent can use over a billing period, such as a month.
They answer different questions, and an API that sells plans usually wants both. Ordainer Cap does the second job. It is not a rate limiter.
What a rate limit does
- It counts requests in a short window, such as a second or a minute.
- It protects your servers and your other callers from bursts, bugs and abuse.
- It usually applies the same limit to everyone, or to each IP address, key or route.
- When a caller is over, the answer is "slow down and try again in a moment".
- It doesn't know what plan the customer bought.
What a usage cap does
- It counts allowed calls over a plan period, such as a calendar month or a day (UTC).
- It enforces what the customer's plan allows, for each agent key. One integration or AI agent gets its own count.
- It checks before the work runs, so the answer is allow or deny at the top of your handler.
- In enforce mode, when a key is over its cap, the work doesn't run, and the caller is told when the allowance resets.
- Each decision writes one audit row, so you can show a customer what happened.
Side by side
| Rate limit | Usage cap | |
|---|---|---|
| The question it answers | How many requests can this caller send right now? | How much does this plan allow in this period? |
| Typical window | Seconds or minutes | A billing period, such as a month or a day |
| Applies to | An IP address, a key, a route or everyone | Each agent key, on the plan it is bound to |
| What a deny means | Wait a moment and try again | The allowance is used up. Retrying before the reset time won't help |
| What it protects | Your servers | The plan you sold |
Why one can't do the other's job
Take Example Co, a customer with three integrations on your API.
A rate limit can miss a plan overrun. Example Co's nightly sync script retries politely and stays under your rate limit. It runs all night anyway. By morning it has used the whole month's allowance, and no rate limit ever fired, because every call was within the limit.
A usage cap can miss a burst. One of Example Co's AI agents sends a heavy burst of calls that are all inside its monthly allowance. The cap allows every one of them. A rate limit is what smooths that burst.
AI agents and ordinary integrations both drift this way. Agents loop and retry. Scripts run on schedules nobody watches. Neither is a reason to drop your rate limits, and neither is a reason to skip plan limits.
What the caller sees
Both kinds of limit can reach a caller as HTTP 429, so the status alone doesn't tell them which one they hit. The message does.
A rate limit says to wait and try again shortly. A usage cap says the allowance is used up, when it resets, and that retrying before then won't work.
With the Ordainer SDKs, a ready-made deny response carries a code of plan_limit_reached, the reason, the limit and the reset time. It is written so an AI agent, or the person behind it, can read it and stop retrying. If your clients treat 429 as "retry soon", the Node SDK can send 402 instead.
How to run both
- Keep your rate limits where they are. That might be a gateway, a reverse proxy, your framework or your cloud.
- Give each integration or AI agent its own agent key. Put each key on a plan. A plan sets how many calls are allowed in a period, for one tool or for every tool.
- Ask before the work. At the top of your handler, send the caller's agent key and the tool name to
decide(). The answer is allow or deny, and an allowed call is counted in the same step. - Start in shadow mode. Plans you create in the console start in shadow, which logs would-deny decisions and does not block. Calls run while you watch what would have been denied. When the counts look right, switch the plan to enforce from the Plans page.
Python and Node code is on the page about capping each API customer's usage. For AI agents in particular, see how to stop a runaway AI agent on your API.
What to know during the beta
- Ordainer is in beta. During the beta you use test keys. Live keys are not available yet.
- Ordainer counts calls, not dollars or tokens.
- Each key counts on its own. One cap covering all of a customer's keys together isn't available today.
- It doesn't proxy your traffic. The check sends the agent key, the tool name, an idempotency key (the SDKs generate one if you don't set it) and, if you set it, a mode.
- Ordainer's own API also limits how many requests each key can send to it, to protect our service. That is separate from the plans you set for your callers.
Common questions
Is Ordainer Cap the same as rate limiting?
No. A rate limit protects your servers from bursts of requests. Ordainer Cap enforces the plan you sold: a count of allowed calls per agent key over a period. Keep your own rate limits for traffic spikes.
Do I still need rate limits if I use usage caps?
Yes. Usage caps decide whether a key has allowance left in its plan period. The check runs inside your handler, so they don't protect your servers from bursts. Keep your rate limits and add caps beside them.
Can an Ordainer plan count per minute?
Yes. A plan can count allowed calls per month, per day or per minute, in fixed UTC periods. A per minute plan is still a plan allowance for a key, not a rate limiter. The check runs inside your handler, so the request has already reached your server. Keep a separate rate limit for traffic spikes.
What does a caller get when a key is over its cap?
In enforce mode, the work doesn't run. With the SDK's ready-made response, the caller gets a message saying the usage limit was reached, when it resets, and that retrying before then won't work. The status is 429 by default, and the Node SDK can send 402 instead.
Does Ordainer cap tokens or dollars?
No. It counts allowed calls per agent key. If each call costs you money, cap how many calls each key may make.
Try it
Ordainer is free during the beta: sign up for test keys with 1,000 decisions a month, no credit card needed.
Get test keys · Produce a deny in the live demo
Have a customer who stayed under your rate limit and still ran past their plan? We'd like to hear how you handled it: support@ordainer.ai.