Spend & limits
Hard caps per key and per account, a live balance, and one-tap top-ups — so a runaway loop can never overspend, and a low balance never surprises you.
Spend caps
Section titled “Spend caps”You can set a hard spending cap on an individual API key and on the whole account, each as a monthly or daily limit. Both are enforced before a request is dispatched — the key cap is checked first, then the account cap — so a cap is never exceeded, only reached. Set a per-key cap on the API Keys page and the account cap in Billing settings; the current-period spend against each is shown alongside it.
When a cap is hit
Section titled “When a cap is hit”A request blocked by a cap returns HTTP 402 in your surface’s error envelope, with a code that tells you which limit applied. The account-level message reads “account has reached its monthly spend limit”. A zero balance returns 402 with insufficient_credit.
{ "error": { "message": "api key has reached its monthly spend limit", "type": "invalid_request_error", "code": "spend_limit_exceeded" }}{ "error": { "message": "insufficient credit balance", "type": "invalid_request_error", "code": "insufficient_credit" }}Balance, top-ups & auto-recharge
Section titled “Balance, top-ups & auto-recharge”Your balance is shown in Billing and updates live as requests complete. Set a low-balance threshold to get an in-app banner before you run dry, top up in a tap through Stripe Checkout, and optionally enable auto-recharge so a saved card refills the balance when it dips below your threshold.