The Vercel AI SDK's Anthropic provider, @ai-sdk/anthropic@4.0.21, released on July 26, includes a patch that modifies how certain token types are reported. This update specifically addresses the reporting of 'thinking tokens' within the Anthropic integration.
Key Points
- The
@ai-sdk/anthropic@4.0.21release occurred on July 26. - This update fixes how 'thinking tokens' are reported.
- 'Thinking tokens' are now reported as 'reasoning token usage'.
- The change is part of a patch release,
e29788d. - Previous versions, including
@ai-sdk/anthropic@4.0.20and@ai-sdk/anthropic@3.0.102, introduced support for the Claude Opus 5 model. - Claude Opus 5 offers capabilities such as 128k output tokens, structured output, and adaptive thinking.
- Earlier versions also added support for fallbacks in 'default' mode, routing safety classifier refusals to Anthropic's recommended fallback model.
- Mid-conversation tool changes are supported via the
toolChangessystem message provider option, emittingtool_addition/tool_removalcontent blocks.
Context
According to the Vercel AI SDK changelog, the @ai-sdk/anthropic@4.0.21 update specifically addresses a reporting mechanism. This follows earlier updates to the Anthropic provider, including versions @ai-sdk/anthropic@4.0.20, @ai-sdk/anthropic@3.0.102, and @ai-sdk/anthropic@2.0.91, all released on July 24. These prior releases introduced significant features such as support for the Claude Opus 5 model, which includes advanced capabilities like 128k output tokens and adaptive thinking. They also added functionality for handling safety classifier refusals through a 'default' fallback mode and enabled mid-conversation tool changes.
Why It Matters
This update refines the accuracy of token usage reporting for developers using the Vercel AI SDK with Anthropic models. Accurate reporting of 'reasoning token usage' can assist in cost analysis and performance optimization for applications leveraging models that employ 'thinking tokens'.
What To Do
- Developers using the Vercel AI SDK should note the change in token reporting for Anthropic models.
- Review the updated documentation for
@ai-sdk/anthropicto understand the implications of 'reasoning token usage'. - Compare token usage reports before and after updating to
@ai-sdk/anthropic@4.0.21to assess any impact on billing or analytics. - Test applications with the Claude Opus 5 model to evaluate its 128k output tokens and other frontier-tier capabilities.
