Set Agent Budget
ledger_set_budgetSet spending caps for an agent. Warns at 80%, blocks spend when exceeded — enforced: a ledger_track call that would cross the cap is rejected.
Dollar caps (monthly_cents/daily_cents) and token caps (monthly_tokens/ daily_tokens) are independent dimensions: dollar caps only cover non-"tokens" rails, token caps only cover rail="tokens" bookkeeping rows (tokens_in/tokens_out). Set both if the agent uses both.
Monthly cap is required; the rest are optional (0 = no limit). Overwrites any existing budget for the agent. Claiming a brand-new agent_id requires your workspace_key; that first call mints an agent_secret (returned once — save it); later calls for that agent_id must pass the agent_secret back (no workspace_key needed again).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | unique agent identifier | |
| daily_cents | No | daily spending cap in cents (0 = no daily cap) | |
| agent_secret | No | required for every call after the first for this agent_id | |
| daily_tokens | No | daily token-burn cap (0 = no cap) | |
| monthly_cents | Yes | monthly spending cap in cents | |
| workspace_key | No | required when claiming a brand-new agent_id; not needed once the agent_id has been claimed | |
| monthly_tokens | No | monthly token-burn cap (0 = no cap) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||