🧩maxBudgetUsd Option
Also known as maxBudgetUsd, max_budget_usd, Agent SDK spend cap, Claude Agent SDK maxBudgetUsd
The option that stops a run once it has spent a set sum.
Think of it like
It is like giving a child five dollars for the fair. When it is spent, the fun stops.
Example
Mia lets users start research agents. She sets maxBudgetUsd to 2, so no single run can cost much.
Why it matters
An agent that loops can burn money fast, and a cap makes the worst case known.
Definition
Common mistake
Key takeaways
- 1Dollar cap. On estimated spend.
- 2Subagents count. Toward it.
- 3Can go a bit over. Leave room.