budget

Set spending caps

Set or update per-period spending caps for the authenticated account. At least one of caps, on_limit, or single_tx_limit_cents must be provided. Cap amounts are in atomic USDC units (1,000,000 = 1.00 USDC). Ordering constraint: daily ≤ weekly ≤ monthly.

Flat format supported: You can pass daily, weekly, monthly at the top level without wrapping in a caps object:

{"daily": 10000000, "on_limit": "approve"}

on_limit=approve: When set, charges exceeding the cap return HTTP 202 with an approval_id instead of 402. The principal can then approve or reject via POST /v1/approvals/{id}/approve or /reject.

put/v1/budget

Request

  • Base URL: https://agentlair.dev
  • URL: https://agentlair.dev/v1/budget
  • Auth: HTTP bearer

Request body

dailyinteger nullable

Daily cap in atomic USDC units (flat format). Alternative to caps.daily.

weeklyinteger nullable

Weekly cap in atomic USDC units (flat format). Alternative to caps.weekly.

monthlyinteger nullable

Monthly cap in atomic USDC units (flat format). Alternative to caps.monthly.

on_limit'reject' | 'approve'

Action when spending cap is reached. 'reject' (default) returns 402; 'approve' returns 202 with an approval_id for the principal to act on.

single_tx_limit_centsinteger nullable

Maximum allowed single-transaction amount in atomic USDC units. Null to remove. Charges above this limit trigger the approval flow even if within period budget.

Example request

{
  "daily": 10000000,
  "weekly": 50000000,
  "monthly": 100000000,
  "caps": {
    "daily": 1000000,
    "weekly": 5000000,
    "monthly": 20000000
  }
}

Response

Updated spending caps

okboolean
agent_idstring
capsobject

Updated cap state for each modified period

Changes

No recorded changes to this operation across all 1 revision of this API.