Prerequisites
- An Auriko API key for read operations, or a session token for full access
- Workspace owner or admin role
Authentication
| Operation | API key (ak_*) | Session JWT |
|---|---|---|
| List / Get budgets | Yes | Yes |
| Create / Update / Delete | No | Yes |
Create a budget
Budget endpoints aren’t wrapped by the SDK. Use cURL or any HTTP client with a session token:Budget scopes
Thescope_type field determines what spending the budget tracks:
scope_type | Description | Required extra field |
|---|---|---|
workspace | Total workspace spend | include_byok (optional, default false) |
api_key | Per-key spend | scope_id (API key ID, required) |
byok_provider | Per-BYOK-provider spend | scope_provider (provider name, required) |
Workspace budget with BYOK
To include BYOK usage in a workspace budget, setinclude_byok: true:
API key budget
Periods
Budgets reset on a fixed schedule (UTC):| Period | Resets at |
|---|---|
daily | 00:00 UTC |
weekly | Monday 00:00 UTC |
monthly | 1st of month 00:00 UTC |
Check budget status
Update and delete
Update a budget (at least one field required):Enforcement
Whenenforce is true and spending reaches the enforcement threshold, subsequent inference requests return a 402 error with code budget_exceeded.
The enforcement threshold has a buffer to account for in-flight requests:
budget_exceeded errors, see Error handling.