Skip to content

Quickstart

By the end of this page you’ll have a limit of 100 AI replies a day for each of your users, and a check that counts against it.

Sign up, verify your email and create a workspace. Limits, keys and usage all belong to a workspace.

Every workspace has a test side and a live side, and you start in test. Test keys have their own limits and counts, and their checks aren’t billed (see Test and live).

On the dashboard, the Get started card has a Create a test key button. It creates a key that starts with lim_test_ and can manage limits and make checks. Copy the secret now, because it’s shown only once. Keep it in your secret manager or environment, not in code.

Terminal window
export LIMITRY_API_KEY="lim_test_…" # the SDKs read this
export LIMITRY_TOKEN="$LIMITRY_API_KEY" # the CLI reads this

Only workspace owners can create keys. You can also create one under Settings → API Keys, while the app shows test (the Test | Live toggle at the top right). Choose Custom, then, under Limits and checks, set Limits to View and change and Checks to Use (limits:read, limits:write and checks:write).

Then install the client you’ll use (curl needs nothing):

Terminal window
npm install @limitry/sdk

In the app, open Limits (in test) and add one: 100 replies per day, for subjects of kind user, action ai-call. Or from your code or a terminal:

import { createClient } from "@limitry/sdk";
const limitry = createClient(); // reads LIMITRY_API_KEY
await limitry.limits.create({
name: "AI replies per day",
subject: { kind: "user" },
action: "ai-call",
amount: 100,
unit: "replies",
window: "day",
});

It applies to every subject of kind user, in test, from the next check. With the CLI, try it (this counts as one call):

Terminal window
limitry check user:usr_123 ai-call
# Allowed. AI replies per day: 99 replies left, resets 2026-10-06T00:00:00.000Z

Ask whether user usr_123 may make one AI call:

import { createClient } from "@limitry/sdk";
const limitry = createClient();
const answer = await limitry.checks.create({
subject: { kind: "user", id: "usr_123" },
action: "ai-call",
});

The answer:

{
"id": "chk_…",
"allowed": true,
"reason": null,
"limits": [
{
"limitId": "lmt_…",
"name": "AI replies per day",
"unit": "replies",
"window": "day",
"rolling": false,
"failMode": "open",
"remaining": 99,
"resetsAt": "2026-10-06T00:00:00.000Z"
}
],
"retryAfterSeconds": null
}

After 100 allowed checks in a day, the next answer is "allowed": false, with retryAfterSeconds telling you when the user can try again. A “no” is a normal answer, not an error.

In your code, guard wraps the check and the work together, so the work runs only when it’s allowed (the TypeScript and Python SDKs):

import { createClient } from "@limitry/sdk";
const limitry = createClient(); // reads LIMITRY_API_KEY
const reply = await limitry.guard(
{ subject: { kind: "user", id: user.id }, action: "ai-call" },
() => callModel(prompt),
);

If the user is over the limit, guard throws (raises in Python) LimitReached and the reply is never generated, so you don’t pay for it.

Counting replies is the simplest limit. Replies cost different amounts, so you’ll often also cap what each of your users spends, in cents, and charge each reply at what it actually cost. That’s Limit AI spend per user of your product.

When your limits work in test, move them to production:

  1. On the Limits page, still in test, click Copy to live. Check what it will create, then confirm.
  2. Switch to Live at the top right and create a live key under Settings → API Keys. It starts with lim_live_.
  3. Give your production code the live key. Nothing else changes: the same code now uses live limits and counts toward your plan.

Next, read Checks for everything a check can do, or pick a guide close to what you’re building from the introduction. To show your users how much they have left, see Show users where they stand, and to warn them before they run out, see Warn your users before they hit a limit.