Skip to main content
Set spending limits at the workspace, API key, or BYOK provider level. Budgets enforce hard limits that block requests when exceeded.

Prerequisites

Authentication

OperationAPI key (ak_*)Session JWT
List / Get budgetsYesYes
Create / Update / DeleteNoYes
Read operations accept API keys. Write operations require session authentication.

Create a budget

Budget endpoints aren’t wrapped by the SDK. Use cURL or any HTTP client with a session token:
curl -X POST https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets \
  -H "Authorization: Bearer $SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "scope_type": "workspace",
    "period": "monthly",
    "limit_usd": 500,
    "enforce": true
  }'
Response:
{
  "id": "bdgt_abc123",
  "workspace_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "scope_type": "workspace",
  "period": "monthly",
  "limit_usd": 500.0,
  "enforce": true,
  "include_byok": false,
  "spend_usd": 42.50,
  "percent_used": 8.5,
  "created_at": "2026-03-20T10:00:00Z",
  "updated_at": "2026-03-20T10:00:00Z"
}

Budget scopes

The scope_type field determines what spending the budget tracks:
scope_typeDescriptionRequired extra field
workspaceTotal workspace spendinclude_byok (optional, default false)
api_keyPer-key spendscope_id (API key ID, required)
byok_providerPer-BYOK-provider spendscope_provider (provider name, required)

Workspace budget with BYOK

To include BYOK usage in a workspace budget, set include_byok: true:
curl -X POST https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets \
  -H "Authorization: Bearer $SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "scope_type": "workspace",
    "period": "monthly",
    "limit_usd": 1000,
    "enforce": true,
    "include_byok": true
  }'

API key budget

curl -X POST https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets \
  -H "Authorization: Bearer $SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "scope_type": "api_key",
    "scope_id": "key_abc123",
    "period": "daily",
    "limit_usd": 50,
    "enforce": true
  }'

Periods

Budgets reset on a fixed schedule (UTC):
PeriodResets at
daily00:00 UTC
weeklyMonday 00:00 UTC
monthly1st of month 00:00 UTC

Check budget status

curl https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets \
  -H "Authorization: Bearer $AURIKO_API_KEY"
Each budget in the response shows current spend:
{
  "id": "bdgt_abc123",
  "scope_type": "workspace",
  "period": "monthly",
  "limit_usd": 500.0,
  "spend_usd": 127.50,
  "percent_used": 25.5,
  "enforce": true
}

Update and delete

Update a budget (at least one field required):
curl -X PATCH https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets/{budget_id} \
  -H "Authorization: Bearer $SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{"limit_usd": 750}'
Delete a budget:
curl -X DELETE https://api.auriko.ai/v1/workspaces/{workspace_id}/budgets/{budget_id} \
  -H "Authorization: Bearer $SESSION_JWT"

Enforcement

When enforce 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:
enforcement_limit = limit_usd - min($10, 10% of limit_usd)
For example, a 100budgetenforcesat100 budget enforces at 90. A 500budgetenforcesat500 budget enforces at 490. Auriko triggers alerts at 50%, 75%, 90%, and 100% of the budget limit. For handling budget_exceeded errors, see Error handling.

Rate limiting

Auriko rate-limits budget management writes to 10 per minute per user and API key reads to 60 per minute per IP. See Rate limits for details.