Usage limits & how they work
This page explains exactly how Sleepy's daily / weekly / monthly limits work, when each one resets, how credits interact with them, and what to do when you hit one.
This page explains exactly how Sleepy's daily / weekly / monthly limits work, when each one resets, how credits interact with them, and what to do when you hit one. It answers the questions users ask most: "Why did I get blocked?", "When does my limit reset?", and "Why is my 5-hour window not empty at midnight?"
TL;DR. You have five separate caps — requests-per-minute, a rolling 5-hour window, a rolling 24-hour window, a rolling weekly window, and a 30-day monthly allowance. Only the monthly one runs on a calendar-like billing period. The other three are sliding windows that empty as individual requests age out, not at a fixed clock time. Purchased extra credits let you keep going past most caps; they never raise the caps themselves.
The five limits, at a glance
Every plan ships with these numbers (the hosted service's defaults are in the table below; a deployment's admin can change them per plan):
| Limit | What it counts | Window | Resets |
|---|---|---|---|
| RPM | number of requests | rolling 60 seconds | as requests age out |
| 5-hour | spend in USD | rolling 5 hours | as requests age out |
| 24-hour | spend in USD | rolling 24 hours | as requests age out |
| Weekly | spend in USD | rolling 7 days | as requests age out |
| Monthly | spend in USD | fixed 30-day billing period | at your period boundary |
Two things are easy to miss:
- The windows are counted in dollars of usage, not tokens. Each model has
a per-token price; a request's cost is
inputTokens·inPrice + cachedTokens·cacheReadPrice + outputTokens·outPrice(cache reads are cheaper — see Context caching). That dollar cost is what the 5h / 24h / weekly / monthly meters accumulate. - The 5h, 24h and weekly windows are rolling, not calendar buckets. They are not "today" or "this week starting Monday". A window holds every request made in the last N hours/days, and it empties one request at a time as each one ages past the boundary. See When windows reset.
Out-of-the-box plan numbers
These are the seeded defaults on a fresh deployment (admin-editable; the hosted service's current numbers are on sleepyai.org/pricing):
| Plan | RPM | 5h | 24h | Weekly | Monthly | Extra credits included |
|---|---|---|---|---|---|---|
| Free | 15 | $0.50 | $1.50 | $3.50 | $5.00 | $5.00 |
| Pro | 60 | $5.00 | $10.00 | $20.00 | $30.00 | $30.00 |
| Enterprise | 200 | $20.00 | $40.00 | $70.00 | $100.00 | $100.00 |
Every plan also includes a free-model daily token budget (5,000,000 tokens /day out of the box) for models priced at $0, plus optional daily free allowances for images / video / TTS / STT. Those are separate from the dollar windows — see Daily free-model budget and Modality daily allowances.
How the limits are enforced, in order
Every request passes through the same gate sequence; the first check that fails is the one you see. The exact interleaving differs slightly between chat/text requests and modality (image / video / TTS / STT) requests, so both are spelled out.
Chat & text (/v1/chat/completions, /v1/messages, /v1/completions,
/v1/systemone):
- Authentication — browser session (chat app), CLI JWT, or virtual key
(
Authorization: Bearerorx-api-key). Otherwise401. - Telegram group gate — free users who haven't joined the required group
are refused →
403. Paid subscriptions are exempt. - Limits check — RPM, the three rolling windows, and the monthly
allowance (details below). Account suspension is also refused here. These
failures come back as
429(the limits check answers with rate-limit framing even for the monthly cap — the message text tells you which one fired). - Model gates — model not on your plan →
403; free-model daily token budget spent with no referral bonus tokens →429; model disabled →503; unknown/invalid model id, or the wrong envelope for the model's type (e.g. a chat-shaped body for a SystemOne model) →403/400. - Billing reservation — the request's worst-case cost is reserved
before the upstream call. If your remaining allowance + credits can't
cover even the maximum →
402. - Queue — if the upstream is saturated, the request waits (paid requests
are served before free ones). Wait too long →
429"upstream capacity exhausted" withRetry-After.
Modalities (images, video, TTS, STT): same auth and Telegram gates first,
then a type gate (a chat model can never serve an image endpoint — and
vice versa → 403), the plan restriction (403), then the daily modality
allowance gate (exhausted with no credits to cover the overage → 402),
then the same limits check, reservation, and queue as above.
(/v1/messages/count_tokens answers for free right after the limits check —
it makes no upstream call, so it never reserves, never queues, and is never
billed.)
Only then is the request forwarded upstream. Usage is metered from the response and settled against the reservation afterwards — and if anything fails before billing settles, the reservation is released rather than kept.
When windows reset
This is the part that surprises people, so it's worth being precise.
Rolling windows (5h, 24h, weekly)
A rolling window is "all requests made in the last N units of time". It has no fixed reset time. It empties gradually:
- Your 5-hour meter is the total cost of requests made in the last 5 hours. A request stops counting exactly 5 hours after it was made.
- Your 24-hour meter works the same way over 24 hours.
- Your weekly meter over 7 days.
What this means for you:
- There is no "resets at midnight". If you burn your 5-hour cap at 2:00 PM, the first request starts aging out at 7:00 PM — but the window only fully clears once every request in it is more than 5 hours old. The cap loosens progressively, and the dashboard's "resets in …" countdown shows the moment the oldest counted request ages out (i.e. when the cap first starts to free up, not when it's completely empty).
- The countdown can move as you keep making requests, because each new request becomes the newest edge of the window. That's inherent to a sliding window, not a bug.
- An admin can force a reset (see Resetting caps), which stamps an anchor so the windows count only from that moment.
Monthly allowance (billing period)
The monthly meter is not a rolling window and not a calendar month. It runs on a 30-day billing period anchored to your account:
- Your period starts at
billingPeriodStart. It resets whenbillingPeriodStart + 30 dayspasses. - The reset is lazy: it's computed on read. If your period has expired, the meter reads zero — there's no cron job you wait for.
- Buying a subscription or changing plan resets the period to now and zeroes the monthly meter (and the rolling-window anchors, and today's free-model budget). So upgrading effectively gives you a fresh monthly allowance immediately.
- Your billing period starts at signup (
billingPeriodStartis set when the account is created), so the first monthly window is the 30 days from when you joined — not aligned to a calendar month, and not the moment you first made a request.
Daily free-model budget
The free-model token counter is keyed by UTC calendar date. It resets at 00:00 UTC (midnight UTC, not your local midnight).
Modality daily allowances
Image / video / TTS / STT free-unit counters are likewise keyed by UTC date and reset at 00:00 UTC.
The monthly allowance vs. extra credits
Two separate dollar pools fund your usage:
- Plan allowance (
limitMonthly) — the included monthly spend. It refills every 30-day billing period. - Extra credits (
balanceUSD) — dollars you purchased or were gifted. They never expire and are never reset by a billing-period rollover.
How they combine on a request:
- The gateway first tries to cover the request from your remaining plan allowance.
- Once the monthly allowance is spent, it draws from extra credits — but only if auto-use credits is enabled (it is on by default; toggle it in Dashboard → Settings / the usage page).
- With auto-use off, requests are blocked once the allowance is spent, even
if you have credits in the wallet — you'll get a
402telling you to enable auto-use.
Rolling-window overage routes to credits too. If you're inside your monthly allowance but have blown past, say, the 5-hour cap, a request is still allowed if you have credits — but that request's cost is charged to credits, not to your monthly allowance. So bursts can't silently eat your monthly budget.
Credits do not raise the caps. They let you continue past a rolling cap or past the monthly allowance; they never make the 5-hour number itself bigger. The only way to get bigger windows is a bigger plan.
See Billing & credits for how to buy credits, gift codes, and the referral program.
Daily free-model budget
Models priced at $0 across the board (input, output, and cache read all zero) are "free models". They don't touch your dollar allowance at all — but they have their own daily token budget:
freeModelDailyTokens— 5,000,000 tokens per UTC day on the seeded plans.- It is counted on tokens, not dollars, and resets at 00:00 UTC.
- When the day's budget is spent, free-model requests are refused with a
429("Daily free-model token limit reached … Switch to a paid model or try again tomorrow") unless you have a referral token bonus balance, which is drawn on next (see below). - Paid models are never blocked by this budget.
Referral bonus tokens (tokenBonusBalance) are a separate, non-expiring
token stash (grantable via gift codes and referrals). They act as overflow for
the free-model daily budget: once today's free tokens are used, free-model
tokens are drawn from the bonus balance until it runs out. Only when both
are exhausted does the 429 fire.
Note the asymmetry: free-model tokens are blocked by a token budget, while paid models are gated by the dollar windows. That's why you can be "out of free tokens today" but still have your full monthly allowance.
Modality daily allowances
Image, video, TTS and STT models are billed in their native unit (images, rendered seconds, TTS characters, transcribed seconds) at a per-unit price, not in tokens. Each plan can include a daily free allowance per modality:
freeDailyImages(images/day)freeDailyVideoSeconds(seconds/day)freeDailyTtsCharacters(characters/day)freeDailySttSeconds(seconds/day)
How a request is settled:
- If the whole request fits in today's remaining free allowance → free.
- If only part fits → the covered part is free, the remainder is billed at the model's per-unit price (from plan allowance, then credits). You can't "ask for more than remains" to mint free units.
- If the allowance is exhausted → the request is allowed only if credits
cover the whole overage; otherwise
402"Daily free … limit reached … try again tomorrow".
These counters also reset at 00:00 UTC.
Context caching
Repeated prompt prefixes are cached upstream and billed at a lower
cacheReadPrice instead of the full input price. The gateway reports cached
token counts transparently, and Dashboard → Usage shows your cache hit rate
and estimated savings. Nothing to configure.
Because cached tokens are cheaper, the same conversation costs less per turn over time — which also means it consumes your rolling windows and monthly allowance more slowly.
Where to see all of this live
Dashboard → Usage shows, right now:
- remaining monthly allowance (with the billing-period boundary)
- meters and countdowns for the 5-hour, 24-hour and weekly rolling windows (the countdown tracks the oldest request aging out)
- today's free-model token usage and your non-expiring bonus token balance
- extra-credit balance and the auto-use credits toggle
- tokens-by-model breakdown, cache hit rate, and the recent request ledger
The chat app shows the same meters and a banner when a limit pauses generation. The CLI surfaces them too.
Common questions
"I got a 429 'Rate limit exceeded for 5 hours window' but my monthly is barely used." The rolling windows are independent of the monthly meter. Wait for requests to age out (the dashboard shows the countdown), or enable/top up extra credits — credits let the request through and bill the overage to credits instead of the window.
"Why didn't my window reset at midnight?" The 5h/24h/weekly windows are rolling, not daily buckets. They have no fixed reset time. Only the free-model token budget and modality allowances reset on a UTC day boundary; the monthly allowance resets at your 30-day billing-period boundary.
"I bought credits but I'm still blocked." Check auto-use credits is enabled (default on). Also note credits don't raise the RPM or rolling-window caps — they only fund overage. (Credits bypass a plan's model restriction list, but not the RPM or window caps.)
"Does the monthly allowance reset on the 1st?" No — it resets 30 days after your billing period started, lazily (computed on read). Buying/changing a plan resets it to now.
"Do credits expire?" No. Wallet credits never expire and are never reset by the billing rollover. Only the plan's included allowance refills.
"Why was I charged after I hit a window cap?" Because credits were enabled and covered the overage; that request's cost went to credits rather than the window.
"Can I reset my caps manually?" Not as a user. An admin can reset any user's caps from Admin → Users (this re-stamps the window anchors and zeroes the monthly meter).
Resetting caps (admin)
From Admin → Users → (user) → Reset caps, an admin can reset individual caps for a user: the 5h / 24h / weekly / monthly windows, the daily free-model token budget, and each modality's daily allowance. This is the tool for "this user hit a wall unfairly" — it stamps fresh anchors so the windows count from now.
Error codes you'll see at a limit
| Status | When |
|---|---|
402 | The billing reservation couldn't cover the request's worst-case cost (allowance + credits), or a modality's daily free allowance is exhausted with no credits |
429 | RPM exceeded, a rolling window (5h/24h/weekly) at cap with no credits, the monthly allowance exhausted, the free-model daily token budget spent (and no bonus tokens), or the upstream queue timed out |
403 | Model not on your plan, invalid/unknown model id, the wrong envelope for the model's type, or the Telegram group gate |
See API → Errors for the response bodies.