What
When a run stops because the USD budget is used up, the result comes back with subtype: "error_max_budget_usd" and is_error: true, so scripts can tell budget exhaustion apart from other failures.
Evidence
subtype: "error_max_budget_usd"
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundleerror_max_budget_usd
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed since
Anthropic's documentation has since written up error_max_budget_usd, on Subagents in the SDK.
| Spend | `maxBudgetUsd` in TypeScript, `max_budget_usd` in Python | No limit. Compared against `total_cost_usd`, so subagent requests count | Enforces the cap in three ways: refuses to spawn more subagents, returning `Budget limit reached…agent-sdk/subagents see the edit
Added since
A small documentation edit on How the agent loop works touched a line naming error_max_budget_usd after this was published.
With [streaming input](/docs/en/agent-sdk/streaming-vs-single-mode), a message that is still queued when a turn ends at the max-turns limit stays queued. Claude Code doesn't add it to that turn's last model call. It starts a new turn for t…agent-sdk/agent-loop see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
A small documentation edit on How the agent loop works touched a line naming error_max_budget_usd after this was published.