Limits API
The limits endpoints, each in TypeScript, Python, the CLI and curl.
Set up
Section titled “Set up”npm install @limitry/sdkexport LIMITRY_API_KEY="lim_test_…"pip install limitryexport LIMITRY_API_KEY="lim_test_…"npm install -g @limitry/clilimitry loginexport LIMITRY_API_KEY="lim_test_…"To pass the key yourself, use createClient({ apiKey: key }) in TypeScript or Limitry(api_key=key) in Python.
List limits
Section titled “List limits”GET /v1/limits Try it in the API playground (opens in a new tab) Scope: limits:read.
Lists this environment’s active limits, newest first.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const limits = await limitry.limits.list();console.log(limits);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()limits = limitry.limits.list()print(limits)limitry limits listcurl -X GET "https://api.limitry.com/v1/limits" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "items": [ { "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z" } ], "nextCursor": null}| Field | Description |
|---|---|
limit | Items per page, 1–100 (default 25). |
cursor | Opaque token from a previous page's nextCursor. |
subjectKind | Only limits for this subject kind. |
action | Only limits for this action. |
archived | Send true to list the archived limits instead. |
More about this endpoint
With archived=true, it lists the archived ones instead. Filter by subjectKind and action, and page through the results with the opaque nextCursor token.
Create a limit
Section titled “Create a limit”POST /v1/limits Try it in the API playground (opens in a new tab) Scope: limits:write.
Creates a limit on how much a subject may use per window, such as 200 cents a month for every user.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const limit = await limitry.limits.create({ name: "AI budget", subject: { kind: "user", }, action: "ai-call", amount: 200, unit: "cents", window: "month", every: 1, start: "calendar",});console.log(limit);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()limit = limitry.limits.create( name="AI budget", subject={"kind": "user"}, action="ai-call", amount=200, unit="cents", window="month", every=1, start="calendar",)print(limit)limitry limits create \ --name 'AI budget' \ --subject '{"kind":"user"}' \ --action ai-call \ --amount 200 \ --unit cents \ --window month \ --every 1 \ --start calendarcurl -X POST "https://api.limitry.com/v1/limits" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"AI budget","subject":{"kind":"user"},"action":"ai-call","amount":200,"unit":"cents","window":"month","every":1,"start":"calendar"}'Returns:
{ "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z"}| Field | Description |
|---|---|
name | The limit's name, unique among the environment's active limits. By default, it's the sentence the limit reads as, such as "200 cents per user per month". If another limit already has that name, you get a 409, so send a name of your own. |
subject | Who the limit applies to. {"kind": "user"} covers every user, and {"kind": "user", "id": "user_123"} covers one. |
action | The action to limit. Default: *, every action. |
amount | How many units each subject may use per window. |
unit | What the amount counts, in words. Default: units. |
window | The kind of period. minute, hour, day, week, month and year count a period of every windows, which resets where start says, or rolls when rolling is true. total is a balance that never resets, and credits raise it. concurrent allows at most amount open reservations at once. |
every | How many window units one period lasts. For example, window: "month", every: 3 is a quarter, and window: "hour", every: 5 is five hours. Default: 1. |
start | Where each period begins. calendar uses UTC boundaries: midnight, Monday, the 1st or 1 January. billing_date counts from the subject's billing date. You set it with subjects.update. An annual plan can then still reset monthly. Until a subject has a billing date, its first check stands in for it. first_use starts a period at the first check after the previous one ended. Default: calendar. |
rolling | Whether to count the last every windows up to the moment of each check, rather than fixed periods. Only minute, hour and day limits can roll. Default: false. |
enabled | Whether checks enforce the limit. Default: true. |
failMode | What your code should do when it can't reach Limitry. open allows and closed refuses. Default: open. |
More about this endpoint
You only need to send subject.kind, amount and window. action defaults to every action (*), unit to units, and name to the sentence the limit reads as. The next check enforces the new limit. You can’t change a limit’s subject, action, unit, window, every, start or rolling after you create it. With a personal access token, the owner and admins can call this. Members can call it in test only, and guests can’t. A workspace API key with this scope can.
Get a limit
Section titled “Get a limit”GET /v1/limits/{limitId} Try it in the API playground (opens in a new tab) Scope: limits:read.
Returns one limit, with who it applies to, its action, its amount and its window.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const limit = await limitry.limits.get("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34");console.log(limit);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()limit = limitry.limits.get("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34")print(limit)limitry limits get lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34curl -X GET "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
Change a limit
Section titled “Change a limit”PATCH /v1/limits/{limitId} Try it in the API playground (opens in a new tab) Scope: limits:write.
Changes a limit’s name, amount, fail mode or whether it’s enabled.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const limit = await limitry.limits.update("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", { name: "AI budget", amount: 300, subject: { kind: "user", }, override: { reason: "Support incident: raised for a customer", },});console.log(limit);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()limit = limitry.limits.update( "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", name="AI budget", amount=300, subject={"kind": "user"}, override={ "reason": "Support incident: raised for a customer", },)print(limit)limitry limits update \ lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34 \ --name 'AI budget' \ --amount 300 \ --subject '{"kind":"user"}' \ --override '{"reason":"Support incident: raised for a customer"}'curl -X PATCH "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"AI budget","amount":300,"subject":{"kind":"user"},"override":{"reason":"Support incident: raised for a customer"}}'Returns:
{ "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
name | A new name, unique among the environment's active limits. |
amount | How many units each subject may use per window. |
enabled | Whether checks enforce the limit. |
failMode | What your code should do when it can't reach Limitry. open allows and closed refuses. |
subject | Who the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one. |
action | The action the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one. |
unit | What the amount counts. You set it when you create the limit. To change it later, create a new limit and archive this one. |
window | The kind of period. You set it when you create the limit. To change it later, create a new limit and archive this one. |
every | How many windows one period lasts. You set it when you create the limit. To change it later, create a new limit and archive this one. |
start | Where each period begins. You set it when you create the limit. To change it later, create a new limit and archive this one. |
rolling | Whether the limit counts the last windows up to each check. You set it when you create the limit. To change it later, create a new limit and archive this one. |
override | Changes a limit a sync sets, until the next sync puts its values back. Only owners and admins, or a workspace API key, can override. Without it, changing such a limit gets a 409. You can't rename it, because the sync finds it by name. |
More about this endpoint
Checks use the new rule at once. You can’t change a limit’s subject, action, unit, window, every, start or rolling, and a request that tries gets a 400. To count something different, create a new limit and archive this one. A limit a sync sets (its setIn) changes only through the sync. A request to change one gets a 409 that names where the sync came from, unless it sends override with a reason. An override lasts until the next sync. With a personal access token, the owner and admins can call this. Members can call it in test only, and guests can’t. A workspace API key with this scope can.
Archive a limit
Section titled “Archive a limit”POST /v1/limits/{limitId}/archive Try it in the API playground (opens in a new tab) Scope: limits:write.
Archives a limit, so checks stop enforcing it at once and it leaves the list.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const result = await limitry.limits.archive("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34");console.log(result);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()result = limitry.limits.archive("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34")print(result)limitry limits archive lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34curl -X POST "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34/archive" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
More about this endpoint
Archiving erases nothing. Limitry keeps the limit’s usage history and credits, and POST /v1/limits/{limitId}/restore brings it back. With a personal access token, the owner and admins can call this. Members can call it in test only, and guests can’t. A workspace API key with this scope can.
Restore an archived limit
Section titled “Restore an archived limit”POST /v1/limits/{limitId}/restore Try it in the API playground (opens in a new tab) Scope: limits:write.
Brings an archived limit back.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const result = await limitry.limits.restore("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34");console.log(result);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()result = limitry.limits.restore("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34")print(result)limitry limits restore lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34curl -X POST "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34/restore" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "id": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "name": "AI budget", "subject": { "kind": "user", "id": null }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", "every": 1, "start": "calendar", "rolling": false, "enabled": true, "archivedAt": null, "failMode": "open", "lastCheckedAt": "2026-11-06T12:00:00.000Z", "setIn": null, "override": null, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
More about this endpoint
Checks enforce it again if it’s enabled. The API refuses it while an active limit has the same name. With a personal access token, the owner and admins can call this. Members can call it in test only, and guests can’t. A workspace API key with this scope can.
Sync limits from a list
Section titled “Sync limits from a list”POST /v1/limits/sync Try it in the API playground (opens in a new tab) Scope: limits:write.
Makes the environment’s limits match the list in limits, pairing them up by name.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const result = await limitry.limits.sync({ limits: [ { name: "AI budget", subject: { kind: "user", }, action: "ai-call", amount: 200, unit: "cents", window: "month", }, ], source: "limitry.json",});console.log(result);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()result = limitry.limits.sync( limits=[ { "name": "AI budget", "subject": {"kind": "user"}, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month", }, ], source="limitry.json",)print(result)Day to day: limitry sync [file]. This endpoint’s own command:
limitry limits sync \ --limits '[{"name":"AI budget","subject":{"kind":"user"},"action":"ai-call","amount":200,"unit":"cents","window":"month"}]' \ --source limitry.jsoncurl -X POST "https://api.limitry.com/v1/limits/sync" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"limits":[{"name":"AI budget","subject":{"kind":"user"},"action":"ai-call","amount":200,"unit":"cents","window":"month"}],"source":"limitry.json"}'Returns:
{ "dryRun": false, "created": [ "Team credits" ], "updated": [ { "name": "AI budget", "changes": { "amount": { "from": 200, "to": 300 } } } ], "archived": [], "unchanged": [ "API requests per minute" ], "restored": [], "kinds": null}| Field | Description |
|---|---|
limits | Every limit you want, each described in full. An omitted field takes its default, as on create. A sync matches limits by name, so each name must be unique in the list. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name. To change one of them, rename the entry, which creates a new limit. The list holds at most 200 limits. |
archiveMissing | Whether to archive the environment's active limits whose names aren't in limits. You can restore them later. Default: false, which leaves them alone. |
dryRun | Whether to report what the sync would do without changing anything. Default: false. |
source | Where these limits come from, such as the file's name or your deploy's. The app and the 409 name it on every limit the sync sets, as in "Set by limitry.json". The CLI sends the file's name. Default: a sync. |
kinds | The workspace's kinds, from the top level down: how the app names each and the order its subject pages use for Above and Below. They replace the workspace's kinds, for test and live alike, so only owners and admins (or a workspace key) can send them. Leave this out to leave the kinds alone. Labels only: checks and the API keep using the kinds themselves. |
More about this endpoint
It creates the limits that are missing and changes the ones that differ, where an omitted field means its default. With archiveMissing, it also archives the active limits the list doesn’t name. Running it twice changes nothing the second time. Limitry checks the whole list before writing anything. If any entry has a problem, nothing changes, and the 400 lists each problem in details. Otherwise Limitry writes every change at once. You can’t change a limit’s subject, action, unit, window, every, start or rolling under the same name, so rename the entry to do that. With dryRun, it returns what it would do without writing anything. What a sync sets is locked in the app until the next sync, which names its source. This is the call behind limitry sync, for keeping your limits in a file in your repository. With a personal access token, the owner and admins can call this. Members can call it in test only, and guests can’t. A workspace API key with this scope can.
Get a credit
Section titled “Get a credit”GET /v1/limits/{limitId}/credits/{creditId} Try it in the API playground (opens in a new tab) Scope: limits:read.
Returns one credit added to a subject’s balance on this limit.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const credit = await limitry.limits.credits.get("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73");console.log(credit);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()credit = limitry.limits.credits.get( "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73",)print(credit)limitry limits credits get \ lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34 \ crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73curl -X GET "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34/credits/crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "id": "crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73", "limitId": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "subject": { "kind": "user", "id": "user_123" }, "amount": 5000, "note": "October credits", "createdByUserId": "usr_9b1d4e7a-2c5f-4a8b-b3e6-7f0d1c2a5e94", "createdAt": "2026-11-05T09:00:00.000Z", "periodStart": "2026-11-01T00:00:00.000Z", "periodEnd": "2026-12-01T00:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
creditId | The credit's ID. |
List a balance’s credits
Section titled “List a balance’s credits”GET /v1/limits/{limitId}/credits Try it in the API playground (opens in a new tab) Scope: limits:read.
Lists the credits added to subjects’ balances on this limit, including any taken back, newest first.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const credits = await limitry.limits.credits.list("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34");console.log(credits);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()credits = limitry.limits.credits.list("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34")print(credits)limitry limits credits list lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34curl -X GET "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34/credits" \ -H "Authorization: Bearer $LIMITRY_API_KEY"Returns:
{ "items": [ { "id": "crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73", "limitId": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "subject": { "kind": "user", "id": "user_123" }, "amount": 5000, "note": "October credits", "createdByUserId": "usr_9b1d4e7a-2c5f-4a8b-b3e6-7f0d1c2a5e94", "createdAt": "2026-11-05T09:00:00.000Z", "periodStart": "2026-11-01T00:00:00.000Z", "periodEnd": "2026-12-01T00:00:00.000Z" } ], "nextCursor": null}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
limit | Items per page, 1–100 (default 25). |
cursor | Opaque token from a previous page's nextCursor. |
before | Start from this moment: items older than it, newest first. Ignored with cursor, which already says where to go on. |
subjectId | Only the credits for this subject. |
More about this endpoint
Page through them with the opaque nextCursor. before starts from a moment, and subjectId keeps one subject’s credits.
Add credits to a balance
Section titled “Add credits to a balance”POST /v1/limits/{limitId}/credits Try it in the API playground (opens in a new tab) Scope: limits:write.
Adds amount credits for one subject on a limit.
import { createClient } from "@limitry/sdk";
// Uses the LIMITRY_API_KEY environment variable.const limitry = createClient();const credit = await limitry.limits.credits.create("lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", { subject: { kind: "team", id: "team_42", }, amount: 5000, note: "October credits",});console.log(credit);from limitry import Limitry
# Uses the LIMITRY_API_KEY environment variable.limitry = Limitry()credit = limitry.limits.credits.create( "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", subject={"kind": "team", "id": "team_42"}, amount=5000, note="October credits",)print(credit)limitry limits credits create \ lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34 \ --subject '{"kind":"team","id":"team_42"}' \ --amount 5000 \ --note 'October credits'curl -X POST "https://api.limitry.com/v1/limits/lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34/credits" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"subject":{"kind":"team","id":"team_42"},"amount":5000,"note":"October credits"}'Returns:
{ "id": "crd_5a8d3f2b-9c1e-4b7a-8f6d-2e0c9b4a1d73", "limitId": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34", "subject": { "kind": "user", "id": "user_123" }, "amount": 5000, "note": "October credits", "createdByUserId": "usr_9b1d4e7a-2c5f-4a8b-b3e6-7f0d1c2a5e94", "createdAt": "2026-11-05T09:00:00.000Z", "periodStart": "2026-11-01T00:00:00.000Z", "periodEnd": "2026-12-01T00:00:00.000Z"}| Field | Description |
|---|---|
limitId | The limit's ID, or its name, such as AI budget (URL-encoded). A name matches an active limit in this environment, exactly or else ignoring case. |
subject | Who gets the credits, such as {"kind": "team", "id": "team_42"}. |
amount | The credits to add, or a negative number to take them back. It can't be 0. |
note | Why you added or took back credits. It's required when amount is negative. |
More about this endpoint
On a balance, a limit whose window is total, the credits stay until they’re spent. On a limit that resets, such as one with a month window, the credits top up the subject’s current period and end when it resets. That period follows the subject’s billing date when the limit starts there, and the answer’s periodEnd says when it ends. A rolling or concurrent limit can’t take credits. A negative amount takes credits back, such as after a refund or a chargeback, and needs a note saying why. The balance can go below zero, and Limitry then refuses checks until you add more credits. With a personal access token, the owner and admins can add credits. Members can add them in test only. A workspace API key with this scope can add them too. An agent connected through MCP asks a person instead, through the limit.credit approval. Limitry keeps a credit’s Idempotency-Key forever, so never reuse one for a new credit.