Limits, credits and budgets for the software you build Limits, credits and budgets for your software
Decide every costly request before you pay for it.
Your provider bills you per token. Your users pay you per month.
Give each of your users a limit, a budget or credits, like $2 of AI a month. Before each request, your code asks Limitry for a yes or a no, then calls your provider directly. Give each of your users a limit, a budget or credits, like $2 of AI a month.
Free for 100,000 checks a month. No card needed.
npm install @limitry/sdk
96¢ spent 0¢ held $1.04 left 1 block = 2¢
limitry.reserve({ cost: 54 }) Before your product runs an AI reply that could cost 54¢, your code asks first.
npm install @limitry/sdk
One request, three steps
-
Ask
Before the request runs, your code checks with Limitry that there is room. If there isn't, Limitry refuses.
-
Hold
Limitry holds the likely cost while your code calls the provider directly.
-
Charge
When it finishes, Limitry charges what it really cost and frees the rest. If the request fails, it all goes back.
const reply = await limitry.reserve(
{
subject: { kind: "user", id: user.id },
action: "ai-call",
cost: 54,
},
async (reservation) => {
const res = await llm(prompt);
reservation.cost(priceInCents(res.usage));
return res;
},
); with limitry.reserve(
subject={"kind": "user", "id": user.id},
action="ai-call",
cost=54,
) as reservation:
res = llm(prompt)
reservation.cost = price_in_cents(res.usage) Your prompts and replies never pass through Limitry.
usr_u58sr asks for one more
allowed: false reason.code: "limit_reached"
When a user is over budget, the request never runs, so it costs you nothing.
Works with Stripe, OpenRouter, the Vercel AI SDK, LiteLLM and agent frameworks. See how
Add it to your code with your coding agent
Paste this prompt into Claude Code or Codex. Your agent reads Limitry's skill, reads your code, proposes limits, and creates only the ones you agree to. The limits are for your users, not for the agent itself.
Read https://limitry.com/docs/skill/SKILL.md and follow it to add Limitry to this codebase. Find the calls that cost us money or that a user could abuse. Propose limits in a table and wait for my answer before creating any.
Rules you would otherwise write yourself
The $2 AI budget is one of them. You describe a limit once, in the app or through the API. Limitry counts every matching check against it. A request runs only if it fits every limit that applies.
-
A $2 AI budget a month for each of your free users
Hold an estimate in cents, then charge the real cost
-
Credits a whole team spends from
A balance that never resets, raised by your payment webhook
-
60 requests in any minute for each key to your API
A rolling one-minute limit
-
$5 a day for each AI agent your product runs, across every tool
A daily budget on each agent
-
At most 3 exports running per workspace
A concurrency limit
Exact even when requests race, retry or can't reach us
A counter you write yourself goes wrong in these three places. Here is what Limitry does in each.
Two requests, one unit left
Only one of them gets it. Counts stay exact under concurrent requests, and a shared pool is never overspent.
Your code can't reach Limitry
By default, your code allows the request. A limit can refuse it instead. Either way, your app keeps running.
A retried request
With an idempotency key, a retry gets the same response and Limitry counts it only once.
See who is close to their limit
Once Limitry is in your code, your whole team can see the numbers. The Usage page shows who is using each limit right now, what each one has left, and who Limitry refused.
Right now
Whoever used the most this month comes first. Limitry marks the ones it refused.
AI budget
| Who | Used | Left |
|---|---|---|
User usr_v31jt 6 refused 200 cents used · 0 cents left
| 200 cents | 0 cents |
User usr_y71rq 2 refused 200 cents used · 0 cents left
| 200 cents | 0 cents |
User usr_h57rf 131 cents used · 69 cents left
| 131 cents | 69 cents |
Know the moment a user hits their limit
Limitry tells your team in the app, by email or on their phone. Each person chooses where.
In the app
By email
From Limitry
Subject A user hit their limit
A user hit their limit
User usr_v31jt went over “AI budget” and was refused.
On their phone
Limitry now
A user hit their limit
User usr_v31jt went over “AI budget” and was refused.
Ask Claude or ChatGPT about usage
Product and finance people don't need the app or a developer. They ask their AI agent in their own words, and it answers from Limitry. The agent changes nothing unless a person allows it.
How much did our users spend on AI in the last 7 days?
Used Limitry
usage_overview
AI budget, last 7 days: 3,400 cents used. Limitry allowed 812 checks.
I can break it down by day, or list the users Limitry refused at the cap of 200 cents.
Start with the free plan
Free for 100,000 checks a month. Paid plans start at $39. A refused check is free, and you need no card to start.