deeprelay quota
Show remaining subscription quota (monthly and weekly)
Show remaining subscription quota (monthly and weekly)
Synopsis
Answers one question at a glance: how much of my plan can I still spend?
deeprelay quota shows what is left on the five meters the server
enforces on every request, plus when the weekly and monthly meters reset:
- Monthly input: weighted input tokens left this billing period.
- Monthly output: weighted output tokens left this period. Reasoning tokens are output tokens.
- Weekly input: weighted input tokens left under the weekly input cap this week.
- Weekly output: weighted output tokens left under the weekly output cap this week. The two weekly caps are independent: spending one does not touch the other.
- Weekly reset: when both weekly caps reset, in UTC, for example
Thu 2026-11-26 10:14 UTC. Your week is fixed: it resets all at once, every week, on the weekday and at the time of day your subscription started. The monthly meters keep their own billing-period reset. - Web searches: server-side web searches used this month out of your plan's allowance (see Web search allowance below). The row is absent when your plan has no search allowance.
- Usage backstop: how much of the per-period metered ceiling is left, in dollars. It counts your plan usage at list price and stops plan coverage if that ceiling is reached, whatever the token meters say.
- Monthly reset: when the monthly meters start over (the end of the current billing period, UTC).
- Wallet-billed calls (24h): how many of your calls in the last 24 hours were billed to your credit balance instead of the plan (see PAYG indicator below).
- Period at pay-as-you-go rates: what this period's plan-covered traffic would have cost on pay-as-you-go, read off the request ledger with each model's cached-input rate honored, so you can size a credit top-up before a cap stops you. When part of your input was cache reads it also shows the share and what the same traffic would cost without the cached rate: the plan counts cached input in full, pay-as-you-go bills it at a fraction of the input rate. Absent until the period has covered usage.
Token figures are weighted tokens, the same units the server gates on and
the same units as the x-deeprelay-quota-* response headers. A model's usage
factor multiplies what its tokens cost you against quota: at factor 2, a
million served tokens spend two million of the allowance.
Every number comes from the server (GET /v1/billing/subscription). None is
typed into the CLI, so the readout always matches what the server enforces.
For used-versus-included figures, use
deeprelay billing subscription.
--short: one stable line
--short prints a single line for status bars, prompts and scripts. Its
grammar is stable: new information is only ever appended at the end.
in:<remaining>/<limit> out:<remaining>/<limit> wk-in:<remaining>/<limit> wk-out:<remaining>/<limit> cap:$<remaining>/$<limit>[ payg][ search=<used>/<limit>][ resets=<YYYY-MM-DD>][ wk-resets=<YYYY-MM-DDTHH:MMZ>]
$ deeprelay quota --short
in:412.4M/500M out:48.1M/50M wk-in:101.0M/125M wk-out:9.2M/12.5M cap:$97.40/$100 resets=2026-10-03 wk-resets=2026-10-01T10:14Z
inandoutare the monthly meters.wk-inandwk-outare the weekly meters.capis the usage backstop in dollars.- Token numbers use K/M/B suffixes. Remaining always shows one decimal and rounds down, so the line never overstates what is left. Limits drop a trailing
.0(500M, but12.5M). - The
capremaining shows cents and rounds down. Its limit drops.00when it is a whole dollar amount ($100). resetsis the UTC date the monthly meters (in,outandsearch) start over: the end of the current billing period. It is absent when the server reports no period end.wk-resetsis when both weekly meters (wk-inandwk-out) start over, in UTC to the minute (2026-10-01T10:14Z). The week resets on the same weekday and time every week: the weekday and time your subscription started. The token is always last, and is absent when the server reports no weekly reset or neither weekly meter has a cap.- A meter with no cap configured prints as
, for example:unlimited wk-out:unlimitedorcap:unlimited. - An org without an active subscription prints
no subscriptionand exits 0, so a status line never errors. - A subscriber whose usage meter could not be read prints
quota unavailablerather than a figure. It never shows a full quota it cannot confirm. --shortprints this line even when stdout is not a terminal. Pass-o jsonexplicitly to get JSON instead.
Scripts written against the earlier three-meter line (a single combined wk
meter) need updating: that meter became the two wk-in / wk-out meters and cap was added before the subscription launched. From here on the
line only grows at the end.
The PAYG indicator
When at least one of your calls in the last 24 hours was billed to your
credit balance while you were subscribed, the line ends with a single
payg token:
in:412.4M/500M out:48.1M/50M wk-in:101.0M/125M wk-out:9.2M/12.5M cap:$97.40/$100 payg
A subscribed call falls back to pay-as-you-go, at list price, when the plan cannot cover it. That happens when a request's estimated input or output exceeds what is left in the tighter of the monthly and weekly windows for that dimension, when a meter is exhausted, or when the model is not in the plan. The indicator makes those fallbacks visible before they show up on your balance. "Recent" means the last 24 hours, clamped to the start of the current billing period.
The count comes from the server's usage.recent_payg_calls_24h field. When the
server does not report it (an older server, or a failed read), the token is
simply absent, and the rest of the line is unchanged.
Web search allowance
Plan subscribers get a monthly allowance of server-side web searches (the
web_search server tool on /v1/messages and /v1/responses): 100 a
month on Base, 500 a month on Plus. The allowance has a monthly window only;
there is no weekly search cap. Every search that reaches the search provider
counts, including one that returns no results. Failed searches and duplicates
within a request do not.
When an allowance is configured, --short ends with a search token that
shows searches used (not remaining) over the allowance:
in:412.4M/500M out:48.1M/50M wk-in:101.0M/125M wk-out:9.2M/12.5M cap:$97.40/$100 search=37/100
The token comes after payg when both appear, and before resets. It is absent when the plan has
no search allowance, so the line is then exactly as before.
When the allowance is used up, the request is not rejected. The search
returns a result to the model saying the allowance is spent and when it
resets, and the turn continues without it. Your org admin can opt into paid
overflow with deeprelay quota search-overflow on (off by default). With
overflow on, only the per-search fee is billed to your credit balance; the
request's tokens stay on the plan.
Search result text the model reads counts as input tokens against the token meters above, at the model's usage factor, like any other input.
Machine-readable output
-o json (with or without --short) prints raw integers:
deeprelay quota --short -o json
{
"subscribed": true,
"meter_available": true,
"monthly_input_remaining": 412400000,
"monthly_input_limit": 500000000,
"monthly_output_remaining": 48100000,
"monthly_output_limit": 50000000,
"weekly_input_remaining": 101000000,
"weekly_input_limit": 125000000,
"weekly_output_remaining": 9200000,
"weekly_output_limit": 12500000,
"backstop_remaining_micro_cents": 9740000000,
"backstop_limit_micro_cents": 10000000000,
"resets_at": "2026-10-03T00:00:00Z",
"weekly_resets_at": "2026-10-01T10:14:00Z",
"recent_payg_calls_24h": 0,
"searches_monthly": 100,
"searches": 37
}
- The backstop is in micro-cents (a millionth of a cent), the precision usage is metered at:
10000000000is $100. - A remaining value of
-1means that meter has no cap. resets_atis when the monthly meters reset;weekly_resets_atis when both weekly meters reset (RFC 3339, UTC). Either isnullwhen the server did not report it.recent_payg_calls_24hisnullwhen the server did not report it.searchesis searches used this period, not remaining.searches_monthlyis0when the plan has no search allowance.- A non-subscriber gets
"subscribed": falsewith every figure zero. "meter_available": falsemeans the meter could not be read, so the zero remaining figures mean "unknown", not "none left".
Examples
# Where do I stand?
deeprelay quota
# Stop a batch when under 10M weighted input tokens are left this month.
left=$(deeprelay quota --short -o json | jq '.monthly_input_remaining')
[ "$left" -ge 10000000 ] || { echo "input quota nearly spent"; exit 1; }
# Warn when the weekly output cap is running low, and say when it resets.
q=$(deeprelay quota --short -o json)
echo "$q" | jq -e '.weekly_output_remaining >= 1000000' >/dev/null \
|| echo "weekly output allowance nearly spent, resets $(echo "$q" | jq -r .weekly_resets_at)"
In the Claude Code status line
Claude Code can run a command for its status line. Add this to
~/.claude/settings.json to keep your plan usage and reset date in view while
you work:
{
"statusLine": {
"type": "command",
"command": "deeprelay quota --short"
}
}
The deeprelay binary must be on the PATH Claude Code runs commands with.
Without a plan the line reads no subscription, so the status line never
shows an error.
Related commands
| You want | Command |
|---|---|
| Used vs included, plus the cost backstop | deeprelay billing subscription |
| Credit left for pay-as-you-go | deeprelay billing balance |
| Past consumption, broken down | deeprelay usage |
deeprelay quota [flags]
Options
-h, --help help for quota
--short One stable line for status bars and scripts
Options inherited from parent commands
--api-base string API base URL (override with DEEPRELAY_API_BASE env) (default "https://api.deeprelay.ai/v1")
--debug Enable debug logging to stderr
--no-preflight Skip the plan/credit check before inference requests (override with DEEPRELAY_NO_PREFLIGHT env)
-o, --output string Output format: table|json (default table on TTY, json otherwise) (default "table")
SEE ALSO
- deeprelay - deeprelay command-line interface
- deeprelay quota search-overflow - Show or set paid web-search overflow (on|off)