Spending controls
Agents act autonomously, so budgets are enforced by the gateway before a call reaches a provider. Controls apply at two levels, and the stricter one wins:
| Control | Account | Per token | Effect |
|---|---|---|---|
| Per-call limit | ✓ | ✓ | Reject any single call priced above N credits (403 per_call_limit_exceeded) |
| Daily cap | ✓ | ✓ | Total credits per UTC day (429 daily_cap_exceeded) |
| Monthly cap | ✓ | ✓ | Total credits per calendar month (429 monthly_cap_exceeded) |
| Approval threshold | ✓ | Calls priced at or above N credits need explicit approval (402 approval_required) |
Approvals
When a call needs approval, the CLI shows the price and asks for confirmation; non-interactive agents pass --yes. Over REST, add X-Clankerbay-Approve: true. Use this to keep humans in the loop for expensive operations.
Price protection
The CLI sends the price it saw in the schema as X-Clankerbay-Max-Credits. If a provider raises a price after your agent looked it up, the call is rejected instead of charged at the new price. Set --max-credits explicitly to allow a higher price.
Configuring
Account limits: Dashboard → Spending controls. Token limits: when creating a token, on the Spending controls page, or with cb clankerbay keys create --per-call-limit 10 --daily-cap 500. Changes reach every gateway instance within seconds.