Limit spending by API key
Set a daily, weekly, or monthly RUB limit for a project key in the cabinet.
Last updated on
Use a separate API key and RUB limit for each project, agent, or team member whose usage must be controlled independently.
Set the limit in the cabinet
- Open API keys in the workspace that owns the key.
- Create a separate key or find an existing one.
- Open its limit settings.
- Choose unlimited use or one of the displayed periods:
DAY,WEEK, orMONTH. - Enter the RUB amount and save.
The key row shows how much of the configured amount has been spent. The same page also shows recent model usage for that key.
Give each project its own key and current spending limit.
Understand the calendar windows
| Period | Window in Europe/Moscow |
|---|---|
DAY | Starts at local midnight. |
WEEK | Starts Monday at local midnight. |
MONTH | Starts on the first day of the month at local midnight. |
Use the returned resetAt value when handling a blocked request. Do not calculate the reset from the client's timezone.
Know what the limit checks
Before a request starts, the service adds current captured spend, active reservations, and the new estimated reservation. If the total would exceed the key's limit, model execution does not start and the API returns HTTP 429 with API_KEY_SPEND_LIMIT_EXCEEDED.
The response identifies the period, limit, spent and reserved amounts, required estimate, currency, and resetAt. The reservation is still an estimate: a completed request is charged for full confirmed usage even if its final cost exceeds the amount reserved, and later requests can then be blocked.
Check the limit from a terminal or agent
An ordinary API key can read its own limit with GET https://api.provod.ai/v1/key. Use the credential already stored in the client's local configuration; do not paste the full key into a support chat.
curl --fail-with-body https://api.provod.ai/v1/key \
-H "Authorization: Bearer $PROVOD_API_KEY"The response is under data: limit is the configured RUB amount, limit_remaining subtracts captured spending in the current window, and limit_reset identifies the period (day, week, or month). null means no configured limit, not a zero balance.
This reports the key's limit, not the workspace balance. Active reservations and the new request estimate are checked separately when starting inference. If several limits are configured, this compatible format reports one period; use the cabinet for all settings. /v1/account returns account information, not the remaining limit.
Use the supported management workflow
Create, change, or remove spend limits in the cabinet UI. Automation is available through the separate control OAuth API at /api/cli/api-keys, with the exact provod:keys:* scopes and workspace permissions. Ordinary inference API keys are not control bearers. Do not copy requests from browser developer tools or treat cabinet traffic as a platform-key API.
Respond to a blocked request
For API_KEY_SPEND_LIMIT_EXCEEDED, either wait until the response's resetAt or change the key's limit in API keys. Generic retry backoff does not create more budget. If the code is a different kind of 429, follow the action for that public error instead.
Key management and exact spending
Use ordinary API keys for model calls. A separate management key controls keys, limits and analytics within its workspace. Chat Completions and Responses return the actual charge in usage.cost with usage.currency; provod.billing.total_charge preserves the exact decimal string. After a disconnect, use the saved x-generation-id and generation lookup, rather than repeating inference.