Introduction
Limitry answers one question for your code: may this subject do this action, at this cost? You give your users, teams, API keys or agents an allowance, like a $2 AI budget a month, set in the dashboard or the API. Before each expensive feature in your product, costly in money or in computing time, such as an AI reply, a paid tool, an API request or an export, your code asks Limitry. Limitry keeps the counts, windows, balances and holds behind the answer, so you don’t have to.
Limitry works inside the software you build, whether it’s a SaaS product, an internal system or custom software: your code asks it before each costly action, then calls your providers directly.
A few words you’ll see throughout these docs:
- A subject is whoever acts in your software: one of your users, teams, API keys or AI agents. You choose the kinds and the ids.
- A limit is a rule, such as “100 AI replies a day for each of your users”.
- A check is the question your code asks. The answer is yes or no, with what’s left and when it resets.
- Test and live are the two sides of every workspace. You build in test, with a test key, and copy your limits to live when they work.
What are you building?
Section titled “What are you building?”Each of these guides takes one job from the first limit to the code around the costly call:
- Limit AI spend per user of your product: each of your free users gets a $2 AI budget a month, charged at what each reply cost.
- Sell prepaid credits: customers buy credits, and their whole team spends from one balance.
- Budgets at several levels: each tenant gets 1,000 credits a month, each team 100 and each user 10, all checked in one call.
- Rate-limit your API’s customers: each customer’s key gets 60 requests in any minute and 1,000 in any hour.
- Give AI agents a budget: each of your agents may spend $5 a day on models and paid tools.
- Cap jobs running at once: each workspace runs at most 3 exports at the same time.
Where to start
Section titled “Where to start”- Quickstart: a first limit and a first check, in about five minutes.
- Add Limitry with your agent: let Claude Code or Codex find the costly calls in your code and propose limits.
- How Limitry works: how Limitry decides, what happens under load, and what happens if Limitry is down.
Most of what you can do in the app, you can also do through the API, the CLI and the MCP server. Copy to live is in the app only: from your own code, read the limits with a test key and write them with a live key (see Test and live). An agent on the MCP server can’t create API keys or webhook endpoints: it asks, and a person approves (see Approvals).