npm / @ai-sdk/anthropic
@ai-sdk/anthropic
What changed in @ai-sdk/anthropic 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
5 breaking34 new APIs and options12 behavior and defaults27 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/anthropic 465 changes
Breaking changes 4
Renames evaluate to decide.
For Claude Sonnet 5.5, disabled thinking is replaced with
between_tools,reasoning: 'none'maps tobetween_tools, and budget-based thinking is converted to adaptive thinking.For models that always use adaptive thinking, unsupported disabled or budget-based thinking settings are dropped,
reasoning: 'none'maps toeffort: 'low', and a warning is emitted.Unsupported batch request types are now rejected.
New APIs and options 32
Forwards providerOptions.vertex.labels as a header.
A typed AnthropicCitation export is available for citation data.
A typed AnthropicTextProviderMetadata export is available for text provider metadata.
Adds Claude Haiku 5.5 as a known model with a 128k max output token limit, adaptive thinking, and all five effort levels. Thinking can be disabled up to high effort; xhigh and max are lowered to high with a warning…
Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and requiring exhaustive consumers to handle max.
Exposes message-start usage through custom stream parts.
Adds Claude Sonnet 5.5 as a supported model ID in @ai-sdk/anthropic.
Adds the
between_toolsthinking type, the lowest thinking setting on Claude Sonnet 5.5.Supports on-demand compaction and preserves signed compaction blocks.
Adds Claude Opus 5.5 as a supported model.
Adds the computer use toolset required for computer use on Claude Opus 5.5.
Adds the safeguards provider option for the dangerous tool use classifier.
Adds experimental Choice, Score, and Boolean evaluations through Messages structured output, with exact labels, validated score bounds, and prompted Boolean P(true) estimates validated to be in [0, 1].
Adds 20260318 web search and web fetch tools with response inclusion controls.
Image generation requests are now supported in batches.
Adds batch cancellation support.
Adds batch listing support.
Batch requests can now use per-request models, allowing developers to select a model for each request in a batch.
Adds support for Fable 5.1 in the Anthropic provider.
Upload results now expose byteSize.
Upload results now expose createdAt.
FilesV4 now optionally supports deleting files.
provider-utils adds deleteFromApi.
FilesV4 now optionally supports streaming file downloads.
Upload results now expose expiresAt.
FilesV4 call options now accept abortSignal.
FilesV4 call options now accept headers.
FilesV4 now optionally supports retrieving file metadata.
provider-utils adds streaming multipart uploads with deterministic part ordering and failure-path stream teardown.
Upload data now supports the
{ type: 'stream' }variant.Accepts webhookUrl for batch completions; the gateway provider registers it, while direct Anthropic and OpenAI batch providers return an unsupported warning when it is provided.
The gateway provider exports typed async-job metadata for batch completions.
Behavior and default changes 7
For Claude Haiku 5.5, an enabled thinking configuration with budgetTokens is converted to adaptive thinking with a warning because the model does not support thinking token budgets.
For Claude Sonnet 5.5,
structuredOutputMode: 'jsonTool'falls back to native structured outputs with a warning.For Claude Sonnet 5.5,
requiredand named tool choices fall back toautowith a warning because forced tool use is rejected.For models that reject forced tool use, requesting
jsonToolfalls back to native structured outputs with a warning.For models that reject forced tool use,
requiredand named tool choices fall back toautowith a warning.Preserved thinking support now covers prefix_mismatch_behavior: 'error'.
Batch requests support the full language-model option surface.
Fixes and other changes 22
Support provider-referenced files in tool results.
When manual thinking is enabled with a required or named tool choice, falls back to automatic tool choice with a warning to avoid an Anthropic API 400 error.
Named tool choices send only the selected tool.
Retrieved web-search sources are kept separate from normalized inline citations on text parts and text-end events.
Tools are preserved when tool calls are disabled.
Failed tool search results are preserved in conversation history.
Generation, streaming, and batch results preserve every supported web and document citation kind, with document source compatibility and web citation source fallbacks when retrieval results are unavailable.
Avoids unsupported strict mode warnings when tools set strict to false.
Uses the JSON tool fallback for structured output on Amazon Bedrock.
JSONL rows are limited to 64 MB during batch result downloads.
Adds the required beta when replaying server-side fallback blocks.
Preserves invalid toolset calls.
Preserves server-side fallback boundaries when replaying assistant messages.
The User-Agent header is now standards-compliant.
After pruning, missing source code execution caller metadata is omitted before a subsequent user message and a warning is emitted; active tool continuations retain caller metadata.
With
between_toolsthinking on Claude Sonnet 5.5,xhighandmaxeffort are lowered tohighwith a warning because the API rejects them.Empty compaction blocks are omitted from replay.
Uses the documented beta header for per-message effort.
Recognizes dated Google Vertex Claude 4 model IDs when selecting model capabilities.
The core uploadFile() helper now forwards abortSignal.
The core uploadFile() helper now forwards headers.
Provider metadata now preserves native message batch request counts.
@ai-sdk/anthropic 35 changes
Breaking changes 1
On Claude Sonnet 5.5, disabled thinking is replaced with
between_toolsthinking and budget-based thinking is converted to adaptive thinking.
New APIs and options 1
Adds the Claude Haiku 5.5 model ID to @ai-sdk/anthropic.
Behavior and default changes 1
For models that always use adaptive thinking, the provider drops unsupported disabled or budget-based thinking settings and emits a warning.
Fixes and other changes 2
After pruning conversation history, dangling caller metadata whose source code execution call is missing is omitted before a subsequent user message, with a warning; retained tool calls and results are preserved, and active tool continuations are unchanged.
Effort updates are preserved on empty system messages at the beginning of a conversation, including consecutive updates.
@ai-sdk/anthropic 28 changes
New APIs and options 1
Adds Claude Haiku 5.5 as a supported model, recognized with a 128k maximum output token limit and all five effort levels.
Behavior and default changes 4
When thinking is disabled, it is supported up to
higheffort;xhighandmaxare lowered tohighwith a warning.For claude-sonnet-5-5, budget-based thinking is converted to adaptive thinking.
For claude-sonnet-5-5, disabled thinking is replaced with between_tools thinking, with a warning.
For models that reject forced tool use, required and named tool choices fall back to auto, with a warning.
Fixes and other changes 3
Avoids forcing structured-output tools for incompatible Claude models on Amazon Bedrock.
Tool calls are preserved when using JSON structured output.
Client tool calls are ordered after provider-executed tool results.