Anthropic Python SDK v0.104.0 adds thinking token count estimates for streaming responses
Anthropic released version 0.104.0 of its Python SDK on May 21, 2026. The update adds support for a thinking-token-count beta feature that provides estimated token counts in thinking block deltas when streaming responses from reasoning models.
Anthropic Python SDK v0.104.0 adds thinking token count estimates for streaming responses
Anthropic released version 0.104.0 of its Python SDK on May 21, 2026, adding support for tracking token usage in reasoning model thought processes.
What's new
The update introduces a thinking-token-count beta feature that provides estimated token counts within thinking block deltas during streaming responses. This allows developers to monitor token consumption in real-time as Claude's reasoning models process extended chains of thought.
The feature specifically targets streaming scenarios where Claude models with thinking capabilities—such as Claude 3.5 Sonnet with extended thinking mode—generate internal reasoning before producing final outputs.
Technical details
The implementation provides token count estimates as part of the delta stream, enabling developers to:
- Track thinking token usage during active streaming
- Estimate costs for reasoning operations in real-time
- Monitor and debug extended thinking processes
- Optimize prompts based on thinking token consumption
The feature is marked as beta, indicating the API may change in future releases.
Version information
- Version: 0.104.0
- Release date: May 21, 2026
- Type: Minor version update
- Full changelog: Available at github.com/anthropics/anthropic-sdk-python/compare/v0.103.1...v0.104.0
What this means
This update addresses a key observability gap for developers using Claude's reasoning capabilities. Previously, tracking token usage in thinking blocks required waiting for complete responses. With streaming token counts, developers can now monitor costs and performance in real-time, particularly important for applications using extended thinking modes where reasoning token counts can significantly exceed output tokens. The beta designation suggests Anthropic is still refining how thinking token metrics are calculated and surfaced to developers.
Related Articles
Anthropic SDK v0.124.0 Moves Files and Skills APIs to General Availability, Adds Computer Use and Browser Use Toolsets
Anthropic released v0.124.0 of its Python SDK, graduating the Files and Skills APIs to general availability and introducing new computer use and browser use toolsets. The release is available now on GitHub.
OpenAI Python SDK v3.1.0 Adds Ultrafast Tier Support, Deprecates Sora Video APIs
OpenAI released v3.1.0 of its Python client library, adding support for a new 'Ultrafast' tier, WebSocket stream IDs, and structured MCP/WebSocket error handling. The release also formally deprecates the Sora video API and strips out remaining Stainless SDK-generation infrastructure.
Anthropic Claims Claude Agents Beat Industry Hit Rates in Autonomous Protein Design Trials
Anthropic published two experiments showing Claude models autonomously running open-source protein design software end-to-end, claiming hit rates of 26.8% against an industry baseline of 10-15%. Independent verification of the results is still pending.
Anthropic Expands Claude Cowork to Mobile for All Paid Plans
Anthropic announced that Claude Cowork, its workspace-focused feature, is now available on mobile and web for all paid plans. The rollout began last month exclusively on Anthropic's most expensive tier before expanding today.
Comments
Loading...