LLMBUDGET.STATUS
LLMBUDGET.STATUS name
- Group
- LLM usage and budgets
- Complexity
- O(1)
- Arity
- 2 (exactly, counting the command name)
- Flags
- read-only, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- Performance and Scale
- On-Premise
- requires the llm-budget license feature
LLM budgets put a hard cap on the tokens and dollars a named budget (for example one per tenant) can spend in a time window, so you can refuse a request before you pay the model provider for it. LLMBUDGET.STATUS reports a budget’s state. For a budget that does
not exist, every field is zero.
Return value
Section titled “Return value”The reply is a flat array of alternating field names and values in both RESP2 and RESP3 (it is not sent as a RESP3 map). The fields, in order:
| Field | Type | Meaning |
|---|---|---|
tokens_used |
Integer | Tokens charged in the current window. |
token_limit |
Integer | Token cap (0 = none). |
cost_used_usd |
Bulk string | Dollars charged in the current window, with six decimals. |
cost_limit_usd |
Bulk string | Cost cap with six decimals (0.000000 = none). |
window_seconds |
Integer | Window length. |
window_remaining |
Integer | Seconds left in the current window (0 when the window is 0 or has run out). |
requests_allowed |
Integer | Requests charged since the budget was created or reset. |
requests_rejected |
Integer | Requests rejected since the budget was created or reset. |
unpriced_requests |
Integer | Allowed requests whose MODEL had no price. |
tokens_used and cost_used_usd go back to zero when a new window
starts; the request counts do not.
Errors:
ERR wrong number of arguments for 'llmbudget.status' commandif the argument count is wrong.NOLICENSE llm-budget requires a HotKV license. Contact sales@hotkv.comif your license does not include thellm-budgetfeature.
Examples
Section titled “Examples”127.0.0.1:6379> LLMBUDGET.STATUS tenant_acme 1) "tokens_used" 2) (integer) 102000 3) "token_limit" 4) (integer) 0 5) "cost_used_usd" 6) "0.220000" 7) "cost_limit_usd" 8) "5.000000" 9) "window_seconds"10) (integer) 360011) "window_remaining"12) (integer) 341213) "requests_allowed"14) (integer) 115) "requests_rejected"16) (integer) 117) "unpriced_requests"18) (integer) 0Compatibility
Section titled “Compatibility”HotKV-only command. Redis and Valkey have no equivalent.
See also
Section titled “See also”LLMBUDGET.SET, LLMBUDGET.CONSUME, LLMBUDGET.RESET, LLMBUDGET.DROP, LLMBUDGET.LIST, AI features guide
Was this page helpful?
Thanks for the feedback.