claude-code-sdk-python/examples
Ashwin Bhat ae800c5ec8
feat: add max_budget_usd option to Python SDK (#293)
Add support for limiting API costs using the max_budget_usd option,
mirroring the TypeScript SDK functionality. When the budget is exceeded,
query execution stops and returns a result with subtype
'error_max_budget_usd'.

- Add max_budget_usd field to ClaudeAgentOptions
- Pass --max-budget-usd flag to Claude Code CLI
- Add test coverage for budget limit behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-30 16:45:35 -07:00
..
plugins/demo-plugin feat: add plugin support to Python SDK (#285) 2025-10-24 15:29:01 -07:00
agents.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
hooks.py feat: add strongly-typed hook inputs with TypedDict (#240) 2025-10-10 16:22:13 -07:00
include_partial_messages.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
max_budget_usd.py feat: add max_budget_usd option to Python SDK (#293) 2025-10-30 16:45:35 -07:00
mcp_calculator.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
plugin_example.py feat: add plugin support to Python SDK (#285) 2025-10-24 15:29:01 -07:00
quick_start.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
setting_sources.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
stderr_callback_example.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
streaming_mode.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
streaming_mode_ipython.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
streaming_mode_trio.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
system_prompt.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
tool_permission_callback.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00