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.
Use the supported management workflow
Create, change, or remove spend limits in the cabinet UI. There is currently no documented public automation contract for managing these limits. 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.