Overview
The Budgets service manages per-grant spending budgets. Allocate budgets when issuing grants, debit as agents consume resources, check remaining balances, and review transaction history.
Allocate
Allocate a spending budget for a grant. Threshold alerts are automatically triggered at 50% and 80% consumption.
Parameters
Response (BudgetAllocation)
Debit
Debit an amount from a grant’s budget. Uses atomic operations to prevent overdraft. Returns an error with HTTP 402 and code INSUFFICIENT_BUDGET if the balance is insufficient.
Parameters
Response (DebitResponse)
Debits are all-or-nothing. If the remaining budget is less than the debit amount, the API returns HTTP 402 with code INSUFFICIENT_BUDGET and the debit is not applied.
Balance
Check the current budget balance for a grant.
Parameters
Response
Returns a BudgetAllocation — same struct as Allocate. See above for field descriptions.
Transactions
List all transactions for a grant’s budget. Supports pagination.
Parameters
Response (TransactionsResponse)
BudgetTransaction