Docs pages

Spend caps

A spend cap refuses requests once spend reaches it. Nothing past the cap is billed. Set caps in the Console under Spend caps.

Kinds of cap

Kinds of spend cap
CapApplies toResets
Daily and monthly, per keyEvery call made with that keyAt 00:00 UTC each day or on the 1st of the month
Daily and monthly, per organisationEvery call in the organisationAt 00:00 UTC each day or on the 1st of the month
Per agent runOne run (one agent session). The key’s cap when it has one, else the organisation’sNever: start a new session
Per requestOne request’s worst case: the model, the prompt and the full output limitChecked per request
  • Caps are in your wallet’s currency. Changing the wallet currency clears them.
  • A member cannot set a key’s run cap above the organisation’s; owners and admins can.
  • A call whose run could not be worked out is not checked against the per-run cap; the other caps still apply.

When a cap is checked

  • A cap is checked before the balance, so a top-up does not lift it.
  • Calls still running count at their worst case until they finish. While only those could reach a cap, new calls get 429 spend_cap_pending with Retry-After; once spend itself reaches the cap, the answer is 402 spend_cap_reached.

What a refused request looks like

Spend cap refusals
StatusCodeWhen
402spend_cap_reachedSpend has reached a daily or monthly cap of the key or the organisation, or the agent run’s cap.
402request_cost_cap_exceededThis request’s worst case (the model, the prompt and the full output limit) is over the per-request cap.
403key_pausedThe key is paused, usually by the runaway-spend detector after its spend jumped far past its usual rate.
429spend_cap_pendingCalls still in flight could reach a spend cap.
Example (http, 402)
HTTP/1.1 402 Payment Required
x-steerwise-spend-cap-scope: key
x-steerwise-spend-cap-window: month
x-steerwise-spend-cap-reset: <next month, 00:00 UTC>

{
  "error": {
    "message": "This key's monthly spend cap of <amount> is reached (<amount> spent this month). It resets at <date> 00:00 UTC. Raise the cap in the portal under Spend caps.",
    "type": "insufficient_quota",
    "param": null,
    "code": "spend_cap_reached"
  }
}
Spend cap headers
HeaderValuesWhat it says
x-steerwise-spend-cap-scopekey, org, run, requestWhose cap refused the call
x-steerwise-spend-cap-windowday, month, run, requestThe refusing cap’s window
x-steerwise-spend-cap-resetRFC 3339 timeWhen a daily or monthly cap starts again (00:00 UTC)
Do not retry a 402 in a loopThe OpenAI SDKs do not retry a 402. If your agent framework retries every error, exclude 402 so a stuck loop stops.

Runaway spend

Steerwise also watches each key’s hourly spend against its usual rate. When spend jumps far past it, the organisation’s owners and billing members and the key’s owner are told, and the key can be paused. A paused key gets 403 key_paused until someone resumes it in the Console under Spend caps; calls already running finish and are billed.