for AI apps and expensive endpoints
Rate limiting you install, not deploy.
You limit by the user, workspace or tier you already have, and charge each call what it actually costs — a refilling token budget per user, so one retry loop can’t burn a month of LLM spend in an afternoon. One SDK call at the edge, and nothing to operate.
- no credit card
- live key in 60 seconds
Then see who spent it.
Every decision streams to your dashboard off the request path — which identifier, which namespace, what it cost, what got blocked. This is the real thing, filled with representative numbers rather than a customer’s traffic.
Requests per hour
Top identifiers by cost
| Identifier | Namespace | Cost | Requests | Blocked |
|---|---|---|---|---|
| user_8f2c1a | ai_generation | 48,900 | 612 | 551 |
| workspace_acme | ai_generation | 21,400 | 1,840 | — |
| user_3b91de | ai_generation | 12,750 | 946 | — |
| user_c47f02 | embeddings | 8,320 | 2,104 | — |
| tier_free | ai_generation | 5,180 | 3,890 | — |
The bill arrives per token.
One user in a retry loop, one abusive script, one generous free tier — an LLM feature can spend a month’s budget in an afternoon. A load balancer can’t see prompt length, and an IP limit can’t tell a paying customer from a bot behind the same NAT.
Lymit’s token bucket is the missing primitive: a refilling budget per userId, workspaceId or tier, charged with the estimated cost of each call before you call the model.
Three steps, one dependency, none to operate.
- 01
Install
npm install @lymit/sdk. Zero dependencies. Node, Bun, Deno, Cloudflare Workers.
- 02
Declare
Name a namespace and its algorithm in code — fixed window, sliding window, or a token bucket for AI budgets.
- 03
Limit
Call limit(identifier, { cost }) with the user, workspace or tier you already have. Change limits later from the dashboard — no redeploy.
1import { Lymit } from "@lymit/sdk";23const lymit = new Lymit({ apiKey: process.env.LYMIT_API_KEY });45const ai = lymit.namespace("ai_generation", {6 algorithm: "tokenBucket",7 capacity: 5000, // tokens per user8 refillRate: 1000, // per hour9 interval: "1h",10});1112const { success, remaining } = await ai.limit(user.id, {13 cost: estimatedTokens,14});Where the counting happens.
single writer per key · SQLite at the edgeEach namespace gets its own single-threaded counter — a Cloudflare Durable Object with SQLite storage, placed near your servers. A check is one in-memory operation with no locks, no compare-and-swap and no Redis cluster to keep alive across regions. Decisions stream to an edge SQLite database for your dashboard, off the request path.
- 11–23 ms
- p50 measured from Cloudflare's edge in Sydney, London, Frankfurt, New York, Dallas, Toronto and Los Angeles — 5–8 ms of it inside our Worker
- 0 ms
- of telemetry on the request path — events are batched behind the response
- 1
- dependency in your app, and it has none of its own
Add your distance to the nearest Cloudflare location. Regions without Durable Object hosting nearby (South America, Africa, India today) pay one longer hop. Every number we quote is measured and published with its method.
Priced by requests. Start free.
Hobby
$0forever
- 10 000 requests / dayaround 300 000 a month — but the cap is daily
- All three algorithms, token bucket included
- 7-day analytics
- 1 200 requests / minute ceiling
- Dashboard overrides
Pro
most popular$29per month
- 1 000 000 requests / month includedthen $0.30 per 10 000 — the same rate as your plan, and your traffic is never cut off
- Dashboard overrides, no redeploy
- Per-identifier rules for VIPs and abusers
- 30-day analytics
- 30 000 requests / minute ceiling
Enterprise
from $149per month
- Volume agreed up front
- Custom SLAs
- Dedicated event database
- 90-day analytics
- 120 000 requests / minute ceiling
- Sharded hot namespaces, region priority
opens an email to hello@lymit.io · we reply within a day
Talk to usHobby stops at its cap and resumes at 00:00 UTC. Paid plans are never cut off for volume — we keep serving and meter the excess. Every figure above is read from the same plan definition the edge enforces, so the page cannot drift from the product.