Quotas

Per-key and per-account spend caps with built-in cooldown windows. Prevent runaway usage before it hits your bill.

Per-key caps

Each API key can be assigned a hard monthly spend limit. When the cap is reached, requests return 429 until the billing cycle resets.

// Set a $50 monthly cap on key_7a3f
PATCH /v1/keys/key_7a3f
{ "monthly_spend_cap": 5000 }

Per-account caps

An account-wide ceiling applies across all keys under the same organization. This is your ultimate safety net — no key can exceed it, regardless of individual limits.

// Org-wide $500 monthly ceiling
PATCH /v1/account
{ "account_spend_cap": 50000 }

Cooldown windows

After a key exhausts its per-minute burst allowance, it enters a cooldown period. Subsequent requests are queued or rejected based on your preference. Configure the window per key.

// 60s cooldown after 100 req/min burst
PATCH /v1/keys/key_7a3f
{ "burst_limit": 100, "cooldown_seconds": 60 }

Quota-exceeded response

HTTP 429
{
  "error": "quota_exceeded",
  "retry_after_ms": 3200,
  "cap_type": "monthly_spend"
}
LOCK — usage quotas that ship with your product.