Anthropic Python SDK v2.10.0 Adds Billing API Enhancements and New Error Codes
Anthropic's Python SDK v2.10.0 introduces beta support for the billing_policy parameter, new error codes for billing issues, webhook events for external key changes, and more nuanced content scan status reporting. Developers integrating billing or using error codes in automation will benefit from these updates.
What changed?
Anthropic released version 2.10.0 of the anthropic-sdk-python. The release introduces beta support for the billing_policy request parameter and adds several new error codes, including contract_spend_limit_reached, linked billing refusals, and user_profile_billing_not_authorized. It also adds webhook events for external key failure and recovery. In addition, some error data models have been renamed and the old names deprecated. The content scan reason field is now more precise, reflecting cases where no verdict is available without implying a security finding.
Why does it matter to an everyday developer?
Developers can now use the new billing_policy parameter to better control API billing policies, though it is in beta. The added error codes enable automation and error handling scripts to distinguish between different types of billing issues, such as limits or authorization failures. The webhook events alert systems when external key failures or recoveries occur, supporting more robust security and operational monitoring. The changes to content scan status prevent unnecessary alarms about security when a scan cannot return a verdict for technical reasons.
What can the developer do now?
- Integrate the billing_policy parameter in API requests to experiment with upcoming billing features.
- Update automation and monitoring to recognize the new error codes (contract_spend_limit_reached, linked billing refusals, user_profile_billing_not_authorized).
- Subscribe to the new webhook events for external key status to enhance system observability.


