# maxBudgetUsd Option

> The option that stops a run once it has spent a set sum.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** maxBudgetUsd, max_budget_usd, Agent SDK spend cap, Claude Agent SDK maxBudgetUsd

## Think of it like

It is like giving a child five dollars for the fair. When it is spent, the fun stops.

## Definition

maxBudgetUsd is the Agent SDK option that stops a run when its estimated spend reaches a dollar amount. In Python it is max_budget_usd. Spend by subagents counts too. The check runs after each reply, so the reply that crosses the line still ends. Spend can go a little past the cap. The run then ends with an error result.

## 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.

## Common mistake

Setting it to 0 to mean no cap. The CLI rejects 0, and the session never runs.

## Three principles

- **Dollar cap.** On estimated spend.
- **Subagents count.** Toward it.
- **Can go a bit over.** Leave room.

## Related terms

- [maxTurns Option](https://learn.benibix.com/term/ai/max-turns-option)
- [ResultMessage](https://learn.benibix.com/term/ai/sdk-result-message)
- [Result Subtype](https://learn.benibix.com/term/ai/result-subtype)
- [Claude Agent SDK Cost Tracking](https://learn.benibix.com/term/ai/agent-sdk-cost-tracking)

---

Source: https://learn.benibix.com/term/ai/max-budget-usd-option
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
