unstale

npm / @ai-sdk/anthropic

@ai-sdk/anthropic

What changed in @ai-sdk/anthropic 2 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

57 breaking2 security10 deprecations96 new APIs and options3 performance38 behavior and defaults62 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@ai-sdk/anthropic 761 changes

Breaking changes 40

  • OpenTelemetry span collection moved out of the ai package. Install this package and register an OpenTelemetry instance globally to receive OpenTelemetry traces.

    7.0.0upgrade guide

  • Set allowSystemInMessages to true to retain system messages in existing chat histories; the notes warn to use it only for trusted messages.

    7.0.0upgrade guide

  • Removed cacheCreationInputTokens from providerMetadata.

    4.0.0, 7.0.0release notesupgrade guide

  • The deprecated top-level LanguageModelUsage field was removed; use inputTokenDetails.cacheReadTokens instead.

    7.0.0upgrade guide

  • CallSettings is split into LanguageModelCallOptions and RequestOptions; replace usages with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>.

    7.0.0upgrade guide

  • AI SDK packages are ESM-only; replace require() with ESM imports and use type: module or .mjs files as needed.

    7.0.0upgrade guide

  • Replaces experimental_context in tool callbacks and is now stable. Tool-specific context is typed from contextSchema and supplied through toolsContext, rather than using one shared runtime context.

    7.0.0upgrade guide

  • The deprecated option is removed. Replace remaining usages with activeTools.

    7.0.0upgrade guide

  • The deprecated export was removed; use customProvider instead. Its options and behavior are unchanged.

    7.0.0upgrade guide

  • The deprecated export was removed; use generateImage instead.

    7.0.0upgrade guide

  • The deprecated result type export was removed; use GenerateImageResult instead.

    7.0.0upgrade guide

  • The deprecated generation option and result property were removed; use output for call options and result access.

    7.0.0upgrade guide

  • The deprecated option was removed; use prepareStep instead.

    7.0.0upgrade guide

  • The tracer property was removed. Pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.

    7.0.0upgrade guide

  • Move the deprecated top-level streamText includeRawChunks option to include.rawChunks.

    7.0.0upgrade guide

  • generateText and streamText no longer include request bodies in step results by default. Opt in with include.requestBody when your application reads those bodies.

    7.0.0upgrade guide

  • generateText no longer includes response bodies by default. Opt in with include.responseBody when your application reads those bodies.

    7.0.0upgrade guide

  • Use isStepCount in tool-loop stop conditions instead of stepCountIs.

    7.0.0upgrade guide

  • The deprecated function is removed. Replace remaining usages with isToolUIPart.

    7.0.0upgrade guide

  • The deprecated { type: 'media' } tool-result content part is removed. Use the file content part with tagged data for inline file content.

    7.0.0upgrade guide

  • Raised the minimum supported Node.js version to 22; supported versions are 22, 24, and 26.

    4.0.0, 7.0.0release notesupgrade guide

  • Replaces onEmbedFinish in telemetry integrations and tracing-channel events for individual embedding model calls.

    7.0.0upgrade guide

  • Replaces experimental_onFinish as the per-call completion callback for embed and embedMany operations.

    7.0.0upgrade guide

  • Replaces experimental_onFinish as the per-call completion callback for rerank operations.

    7.0.0upgrade guide

  • The onEnd callback follows the result changes: usage and content-related properties include all steps, while final-step-only properties are available on finalStep.

    7.0.0upgrade guide

  • Replaces onRerankFinish in telemetry integrations and tracing-channel events for individual reranking model calls.

    7.0.0upgrade guide

  • The generation start callback is now named onStart instead of experimental_onStart.

    7.0.0upgrade guide

  • The per-step start callback is now named onStepStart instead of experimental_onStepStart.

    7.0.0upgrade guide

  • Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.

    7.0.0upgrade guide

  • Messages returned from prepareStep now form the base for subsequent steps, together with the previous step's response messages.

    7.0.0upgrade guide

  • The deprecated top-level LanguageModelUsage field was removed; use outputTokenDetails.reasoningTokens instead.

    7.0.0upgrade guide

  • Register a telemetry integration globally at application startup to enable telemetry collection.

    7.0.0upgrade guide

  • Top-level content, tool, file, source, and warning properties on generateText and streamText results now accumulate values across every step; use finalStep for final-step-only values.

    7.0.0upgrade guide

  • Use runtimeContext for shared generation or agent state visible in prepareStep, events, and step results; it is separate from each tool's scoped context.

    7.0.0upgrade guide

  • Each StepResult now contains only the response messages produced by that step. Use result.responseMessages for the full response message history.

    7.0.0upgrade guide

  • onChunk now receives every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.

    7.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; move instructions to the top-level instructions option or opt in with allowSystemInMessages.

    7.0.0upgrade guide

  • The deprecated type is removed. Replace remaining usages with ToolExecutionOptions.

    7.0.0upgrade guide

  • Pass tool-specific context values through toolsContext, keyed by tool name. Tools with a contextSchema receive typed, scoped context; toolsContext is required when at least one tool declares contextSchema.

    7.0.0upgrade guide

  • generateText and streamText usage now reports token usage across all steps. Use finalStep.usage for the previous final-step-only value; totalUsage is deprecated.

    7.0.0upgrade guide

Deprecations 8

  • Tool-result file and image content now has a canonical file variant with tagged data and a required mediaType; legacy variants are deprecated and auto-migrated at runtime.

    7.0.0upgrade guide

  • Top-level reasoning, reasoningText, request, response, and providerMetadata result properties are deprecated; use finalStep to read final-step reasoning and metadata.

    7.0.0upgrade guide

  • The { type: 'image', image, mediaType? } user-message content part is deprecated. Use a file part with an image mediaType instead.

    7.0.0upgrade guide

  • The tool() and dynamicTool() property is deprecated. Move approval logic to toolApproval on the call or agent to keep policy configurable per request.

    7.0.0upgrade guide

  • Replaces onFinish as the final lifecycle callback for generateText, streamText, agents, and ToolLoopAgent settings. onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.

    7.0.0upgrade guide

  • Replaces onStepFinish for per-step lifecycle callbacks across text and object generation, agents, workflow agents, and UI message stream helpers. The old name remains a deprecated alias for user-facing callbacks.

    7.0.0upgrade guide

  • Replaces StreamTextResult.fullStream as the property for accessing the full event stream. fullStream remains a deprecated alias.

    7.0.0upgrade guide

  • The result methods toUIMessageStream, toUIMessageStreamResponse, pipeUIMessageStreamToResponse, toTextStreamResponse, and pipeTextStreamToResponse are deprecated; use the stateless top-level helpers.

    7.0.0upgrade guide

New APIs and options 2

  • Declare tool-specific context fields with contextSchema so tool callbacks receive a typed context limited to those fields.

    7.0.0upgrade guide

  • The top-level system prompt option is now instructions across prompt- and messages-accepting functions and related callbacks; system remains a deprecated fallback, with instructions taking precedence.

    7.0.0upgrade guide

Behavior and default changes 10

  • The speech generation function graduated from experimental status and is available under the stable name generateSpeech; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces experimental_include for generateText, streamText, and ToolLoopAgent. The old name remains a deprecated alias, and include takes precedence if both are provided.

    7.0.0upgrade guide

  • Replaces experimental_onToolCallFinish as a tool execution callback for generateText and streamText. The old name remains a deprecated alias and is only used as a fallback.

    7.0.0upgrade guide

  • Replaces experimental_onToolCallStart as a tool execution callback for generateText and streamText. The old name remains a deprecated alias and is only used as a fallback.

    7.0.0upgrade guide

  • When using the top-level reasoning option, remove overlapping providerOptions reasoning settings; provider-specific settings take precedence and can bypass the top-level configuration.

    7.0.0upgrade guide

  • The speech result type has a stable name; Experimental_SpeechResult remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces experimental_telemetry as the stable telemetry configuration option. The old name remains a deprecated alias during the migration window.

    7.0.0upgrade guide

  • Once a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled to false to opt out of a specific call.

    7.0.0upgrade guide

  • The transcription API graduated from experimental status and is available under the stable name transcribe; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The transcription result type has a stable name; Experimental_TranscriptionResult remains a deprecated alias.

    7.0.0upgrade guide

Fixes and other changes 1

  • Models can return files in reasoning under a distinct reasoning-file content type; update exhaustive part handling to support it.

    7.0.0upgrade guide

@ai-sdk/anthropic 61 changes

New APIs and options 1

  • The Anthropic provider adds structuredOutputMode to control structured output generation, with outputFormat, jsonTool, and auto modes. auto uses native output_format when supported and otherwise falls back to jsonTool.

    6.0.0upgrade guide

@ai-sdk/anthropic 4130 changes

Breaking changes 14

  • MCP connector tools are disabled in specified structured-output fallback and tool-choice scenarios.

    3.0.140, 4.0.99release notesrelease notes

  • Rejects conflicting inline tool additions in specified fallback and internal JSON response tool scenarios, validating only definitions emitted in the request.

    3.0.139, 4.0.99release notesrelease notes

  • Adds a typed stream-part union variant; exhaustive stream-part switches must handle it even when ping emission is not opted into.

    4.0.97release notes

  • Anthropic streams that end cleanly without the provider completion signal now report interrupted, preserving partial output without emitting an error solely for the interruption. Applications must handle interrupted in finish-reason switches, mappings, and custom validation.

    4.0.86release notes

  • Renames evaluate to decide.

    4.0.72release notes

  • For Claude Sonnet 5.5, disabled thinking is replaced with between_tools, reasoning: 'none' maps to between_tools, and budget-based thinking is converted to adaptive thinking.

    4.0.67release notes

  • For models that always use adaptive thinking, unsupported disabled or budget-based thinking settings are dropped, reasoning: 'none' maps to effort: 'low', and a warning is emitted.

    4.0.60release notes

  • Unsupported batch request types are now rejected.

    4.0.53release notes

  • The package is ESM-only; consumers using require() must switch to ESM import syntax.

    4.0.0release notes

  • The Anthropic facade has been removed; use the anthropic object or the createAnthropic function instead.

    4.0.0upgrade guide

  • The baseUrl option has been removed from all providers; use baseURL instead.

    4.0.0upgrade guide

  • File part data is now tagged with a type, and the image part type was removed.

    4.0.0release notes

  • Rolled image-* tool output types into their equivalent file-* types.

    4.0.0release notes

  • The model-specific topK setting has been removed from the Anthropic provider; use the standard topK setting instead.

    4.0.0upgrade guide

Security 1

  • Actions are tied to the returned member name; disabled or unavailable members are rejected before tool calls, and member configuration is applied to local input validation.

    4.0.99release notes

Deprecations 1

  • Anthropic between_tools mappings now emit a compatibility warning.

    4.0.92release notes

New APIs and options 55

  • Adds experimental extraction models backed by structured language model output.

    4.0.104release notes

  • Adds support for creating and continuing message threads, with automatic beta headers and thread error details for application-managed recovery.

    4.0.98release notes

  • Supports adding tools by value in mid-conversation through toolChanges.

    3.0.139, 4.0.98release notesrelease notes

  • Adds support for deleting files, retrieving metadata, and streaming downloads of generated files; downloads remain restricted to files generated by tools or skills.

    4.0.97release notes

  • Enables Anthropic typed streaming heartbeat parts; they are disabled by default and do not require raw chunks.

    4.0.97release notes

  • Adds MiniMax support for standard and priority admission tiers and exposes the applied tier, when returned, in Anthropic-compatible generation, stream, and batch metadata.

    4.0.97release notes

  • Adds a Vertex Anthropic opt-in allowing auto to use native structured output for Claude 4.5 and newer when enabled by Google Cloud policy; tool emulation remains the default.

    4.0.97release notes

  • Supported Claude 5 models on Bedrock now support native structured output and strict tools.

    4.0.95release notes

  • Forwards providerOptions.vertex.labels as a header.

    4.0.80release notes

  • A typed AnthropicCitation export is available for citation data.

    4.0.79release notes

  • A typed AnthropicTextProviderMetadata export is available for text provider metadata.

    4.0.79release notes

  • 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…

    3.0.128, 4.0.75release notesrelease notes

  • Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and requiring exhaustive consumers to handle max.

    4.0.73release notes

  • Exposes message-start usage through custom stream parts.

    4.0.72release notes

  • Adds Claude Sonnet 5.5 as a supported model ID in @ai-sdk/anthropic.

    2.0.107, 3.0.125, 4.0.67release notesrelease notesrelease notes

  • Adds the between_tools thinking type, the lowest thinking setting on Claude Sonnet 5.5.

    2.0.107, 3.0.125, 4.0.67release notesrelease notesrelease notes

  • Supports on-demand compaction and preserves signed compaction blocks.

    4.0.63release notes

  • Adds Claude Opus 5.5 as a supported model.

    2.0.103, 3.0.120, 4.0.60release notesrelease notesrelease notes

  • Adds the computer use toolset required for computer use on Claude Opus 5.5.

    2.0.103, 3.0.120, 4.0.60release notesrelease notesrelease notes

  • Adds the safeguards provider option for the dangerous tool use classifier.

    3.0.127, 4.0.59release notesrelease notes

  • 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].

    4.0.56release notes

  • Adds 20260318 web search and web fetch tools with response inclusion controls.

    4.0.55release notes

  • Image generation requests are now supported in batches.

    4.0.53release notes

  • Adds batch cancellation support.

    4.0.52release notes

  • Adds batch listing support.

    4.0.52release notes

  • Batch requests can now use per-request models, allowing developers to select a model for each request in a batch.

    4.0.50release notes

  • Adds support for Fable 5.1 in the Anthropic provider.

    2.0.101, 3.0.116, 4.0.48release notesrelease notesrelease notes

  • Upload results now expose byteSize.

    4.0.47release notes

  • Upload results now expose createdAt.

    4.0.47release notes

  • FilesV4 now optionally supports deleting files.

    4.0.47release notes

  • provider-utils adds deleteFromApi.

    4.0.47release notes

  • FilesV4 now optionally supports streaming file downloads.

    4.0.47release notes

  • Upload results now expose expiresAt.

    4.0.47release notes

  • FilesV4 call options now accept abortSignal.

    4.0.47release notes

  • FilesV4 call options now accept headers.

    4.0.47release notes

  • FilesV4 now optionally supports retrieving file metadata.

    4.0.47release notes

  • provider-utils adds streaming multipart uploads with deterministic part ordering and failure-path stream teardown.

    4.0.47release notes

  • Upload data now supports the { type: 'stream' } variant.

    4.0.47release notes

  • 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.

    4.0.42release notes

  • The gateway provider exports typed async-job metadata for batch completions.

    4.0.42release notes

  • Sandbox command execution accepts optional abortSignal parameters.

    4.0.0release notes

  • Added the advisor tool.

    4.0.0release notes

  • Added support for claude-fable-5 and the fallbacks API parameter.

    4.0.0release notes

  • Added support for Opus 4.7 and relevant API enhancements.

    4.0.0release notes

  • Added support for the claude-opus-4-8 model.

    4.0.0release notes

  • Added the fallbacks API parameter.

    4.0.0release notes

  • Added the inference_geo provider option.

    4.0.0release notes

  • Added support for passing metadata.user_id.

    4.0.0release notes

  • Added provider references and support for uploading files and provider skills using the provider references abstraction.

    4.0.0release notes

  • Added readFile to the Experimental_Sandbox abstraction.

    4.0.0release notes

  • Added a top-level reasoning parameter to the provider spec, supported by generateText and streamText.

    4.0.0release notes

  • Added support for passing a provider instance to uploadFile as shorthand.

    4.0.0release notes

  • Added support for passing a provider instance to uploadSkill as shorthand.

    4.0.0release notes

  • Provider models can cross workflow step boundaries without serialization errors; provider config headers are optional, and serializeModel is available to third-party provider authors.

    4.0.0release notes

  • Added writeFile to the Experimental_Sandbox abstraction.

    4.0.0release notes

Performance 1

  • Provider validation schemas and Anthropic provider option schemas are constructed on first use, reducing package import time.

    4.0.85release notes

Behavior and default changes 14

  • Known model ID suggestions are derived from provider model catalog declarations, so catalog updates automatically update autocomplete while preserving existing suggestions, endpoint-specific lists, and support for custom IDs.

    4.0.105release notes

  • Bedrock and Anthropic fall back when schemas use recursive references, open objects, or more than ten optional properties; JSON-tool fallback excludes disabled and unselected application tools.

    4.0.95release notes

  • Use native structured outputs for models that reject forced tool use even when the provider disables them by default; self-referencing schemas continue to use the JSON response tool.

    3.0.137, 4.0.94release notesrelease notes

  • Supports synchronous and asynchronous token providers, including workload identity federation helpers, and resolves tokens before each request while preserving existing authentication headers and beta-header behavior.

    4.0.90release notes

  • Provider-returned identifiers are now encoded in credentialed follow-up request paths.

    4.0.85release notes

  • 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.

    2.0.109, 3.0.128, 4.0.75release notesrelease notesrelease notes

  • For Claude Sonnet 5.5, structuredOutputMode: 'jsonTool' falls back to native structured outputs with a warning.

    2.0.107, 3.0.125, 4.0.67release notesrelease notesrelease notes

  • For Claude Sonnet 5.5, required and named tool choices fall back to auto with a warning because forced tool use is rejected.

    2.0.107, 3.0.125, 4.0.67release notesrelease notesrelease notes

  • For models that reject forced tool use, requesting jsonTool falls back to native structured outputs with a warning.

    2.0.103, 3.0.120, 4.0.60release notesrelease notesrelease notes

  • For models that reject forced tool use, required and named tool choices fall back to auto with a warning.

    3.0.120, 4.0.60release notesrelease notes

  • Preserved thinking support now covers prefix_mismatch_behavior: 'error'.

    3.0.118, 4.0.53release notesrelease notes

  • Batch requests support the full language-model option surface.

    4.0.46release notes

  • The bash tool now automatically uses a sandbox.

    4.0.0release notes

  • The extended thinking effort parameter is GA and no longer requires the effort-2025-11-24 beta header.

    4.0.0release notes

Fixes and other changes 44

  • Ignored inline tool additions on the initial system message remain warning-only in specified fallback cases; tool-choice restrictions are validated only for inline definitions emitted in the outgoing request.

    4.0.99release notes

  • Metadata reads and uploads expose consistent media type, size, creation time, expiration, and provider metadata when available.

    4.0.97release notes

  • Omits foreign-provider empty signature text when replaying history through Anthropic or Bedrock, preserving Bedrock’s native reasoning-history handling.

    4.0.97release notes

  • Keeps provider metadata when converting results to response messages so it can be passed back in subsequent requests.

    4.0.97release notes

  • Tiers belonging to another known provider are omitted with an unsupported-setting warning instead of being forwarded as incompatible values.

    4.0.97release notes

  • Preserves text and complete function-call order, including standalone thought signatures on empty text or reasoning parts.

    4.0.97release notes

  • Avoids adding the structured-output beta header for providers without strict tool support.

    4.0.97release notes

  • Stream retries forward pings without storing them as generated content or sending them to UI message streams; typed pings do not flush partial words during stream smoothing.

    4.0.97release notes

  • Valid JSON string tool input is parsed, and BigInt values and cycles in tool results are safely serialized.

    2.0.112, 3.0.138, 4.0.95release notesrelease notesrelease notes

  • When the model responds in text without calling the JSON response tool, return that final answer instead of dropping it.

    3.0.137, 4.0.94release notesrelease notes

  • Keep the JSON response tool for schemas native structured outputs cannot represent, including open objects and schemas with more than 10 optional properties.

    3.0.137, 4.0.94release notesrelease notes

  • Schema sanitization keeps definitions and $defs next to a top-level $ref so the reference still resolves.

    3.0.137, 4.0.94release notesrelease notes

  • Fixes serialization of Anthropic models using API keys or synchronous auth tokens while preserving support for asynchronous token providers.

    4.0.91release notes

  • Empty streams continue to be rejected for interrupted responses.

    4.0.86release notes

  • Support provider-referenced files in tool results.

    4.0.81release notes

  • 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.

    3.0.131, 4.0.80release notesrelease notes

  • Named tool choices send only the selected tool.

    3.0.131, 4.0.80release notesrelease notes

  • Retrieved web-search sources are kept separate from normalized inline citations on text parts and text-end events.

    4.0.79release notes

  • Tools are preserved when tool calls are disabled.

    3.0.129, 4.0.79release notesrelease notes

  • Failed tool search results are preserved in conversation history.

    3.0.129, 4.0.79release notesrelease notes

  • 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.

    4.0.79release notes

  • Avoids unsupported strict mode warnings when tools set strict to false.

    4.0.77release notes

  • Uses the JSON tool fallback for structured output on Amazon Bedrock.

    4.0.75release notes

  • JSONL rows are limited to 64 MB during batch result downloads.

    4.0.73release notes

  • Adds the required beta when replaying server-side fallback blocks.

    4.0.72release notes

  • Preserves invalid toolset calls.

    4.0.71release notes

  • Preserves server-side fallback boundaries when replaying assistant messages.

    4.0.69release notes

  • The User-Agent header is now standards-compliant.

    4.0.68release notes

  • 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.

    4.0.67release notes

  • With between_tools thinking on Claude Sonnet 5.5, xhigh and max effort are lowered to high with a warning because the API rejects them.

    2.0.107, 3.0.125, 4.0.67release notesrelease notesrelease notes

  • Empty compaction blocks are omitted from replay.

    4.0.61release notes

  • Uses the documented beta header for per-message effort.

    2.0.103, 3.0.120, 4.0.60release notesrelease notesrelease notes

  • Recognizes dated Google Vertex Claude 4 model IDs when selecting model capabilities.

    4.0.49release notes

  • The core uploadFile() helper now forwards abortSignal.

    4.0.47release notes

  • The core uploadFile() helper now forwards headers.

    4.0.47release notes

  • Provider metadata now preserves native message batch request counts.

    4.0.46release notes

  • Stopped adding this beta header for claude-opus-4-7.

    4.0.0release notes

  • Unsupported JSON schema validation properties are sanitized before use.

    4.0.0release notes

  • Preserved the error code returned by the model.

    4.0.0release notes

  • The mutual-exclusivity check applies only to known Anthropic models; non-Anthropic models using the compatible API can send both parameters.

    4.0.0release notes

  • Propagated the providerOption to Anthropic tool results.

    4.0.0release notes

  • Aligned tool result output content file part types with top-level message file part types.

    4.0.0release notes

  • The provider now skips passing the beta header for tool search tools.

    4.0.0release notes

  • Fixed remaining errors from Anthropic code_execution tool dynamic calls following the latest web_fetch or web_search calls.

    4.0.0release notes

@ai-sdk/anthropic 352 changes

Breaking changes 2

  • By-value system-message tool additions now require request-level opt-in, preventing client UI history from introducing undeclared provider tools or replacing server-configured tool restrictions.

    3.0.142release notes

  • On Claude Sonnet 5.5, disabled thinking is replaced with between_tools thinking and budget-based thinking is converted to adaptive thinking.

    3.0.125release notes

Deprecations 1

  • Renames textEmbeddingModel to embeddingModel; textEmbeddingModel and textEmbedding are also marked deprecated aliases.

    3.0.0release notes

New APIs and options 26

  • Adds support for MiniMax M3.1 Flash, including reasoning effort, image detail, video input and frame sampling, prompt cache control, and sampling controls.

    3.0.134release notes

  • Adds the Claude Haiku 5.5 model ID to @ai-sdk/anthropic.

    3.0.128release notes

  • Adds support for Agent Skills.

    3.0.0release notes

  • Adds support for the ANTHROPIC_BASE_URL environment variable.

    3.0.0release notes

  • Adds support for the 2025-08-25 code execution tool.

    3.0.0release notes

  • Exposes the container from the response in provider metadata.

    3.0.0release notes

  • Adds support for Anthropic context_management.

    3.0.0release notes

  • Adds the effort provider option for Opus 4.5.

    3.0.0release notes

  • Adds extended token usage support.

    3.0.0release notes

  • Adds support for flexible tool output content.

    3.0.0release notes

  • Adds LanguageModelV3.

    3.0.0release notes

  • Adds Anthropic MCP connector support.

    3.0.0release notes

  • Adds the Anthropic memory tool.

    3.0.0release notes

  • Adds support for programmatic tool calling with Anthropic.

    3.0.0release notes

  • Allows custom names for Anthropic provider-defined tools.

    3.0.0release notes

  • Supports a custom provider name in the Anthropic provider.

    3.0.0release notes

  • Exposes the raw finish reason.

    3.0.0release notes

  • Exposes stop_sequence in provider metadata.

    3.0.0release notes

  • Adds Anthropic-native structured outputs.

    3.0.0release notes

  • Adds the text_editor_20250728 tool for Claude 4 models, with optional max_characters and no undo_edit command support.

    3.0.0release notes

  • Adds support for tool calling with structured output.

    3.0.0release notes

  • Adds support for tool execution approval.

    3.0.0release notes

  • Adds support for tool input examples.

    3.0.0release notes

  • Adds support for Anthropic's new tool search tools.

    3.0.0release notes

  • Adds strict mode that can be configured per tool.

    3.0.0release notes

  • Adds the Anthropic web fetch tool.

    3.0.0release notes

Performance 2

  • Construction of Anthropic provider option schemas is deferred until first use to reduce package import time.

    2.0.110, 3.0.135release notesrelease notes

  • Validation schema construction is deferred until first use to reduce provider import time.

    2.0.110, 3.0.135release notesrelease notes

Behavior and default changes 8

  • Supported Claude 5 models on Bedrock gain native structured output and strict tools. In automatic mode, Bedrock and Anthropic fall back for unsupported schemas; explicit outputFormat selection is unchanged.

    3.0.138release notes

  • For models that always use adaptive thinking, the provider drops unsupported disabled or budget-based thinking settings and emits a warning.

    2.0.103, 3.0.120release notesrelease notes

  • Enables fine grained tool streaming by default.

    3.0.0release notes

  • The Opus 4.5 maxOutputTokens limit increases from 32000 to 64000.

    3.0.0release notes

  • Defaults and limits maxTokens based on the selected model.

    3.0.0release notes

  • The provider version is added to the user-agent header.

    3.0.0release notes

  • Tool results can include PDF files, including PDFs and images supplied by URL.

    3.0.0release notes

  • Updates the Anthropic web search tools.

    3.0.0release notes

Fixes and other changes 13

  • Valid JSON string tool input is now parsed correctly.

    3.0.138release notes

  • 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.

    3.0.125release notes

  • Effort updates are preserved on empty system messages at the beginning of a conversation, including consecutive updates.

    2.0.106, 3.0.123release notesrelease notes

  • Retains beta features supplied by the user.

    3.0.0release notes

  • Returns file_id for code-execution-20250825 so output files can be downloaded.

    3.0.0release notes

  • Throws a 500 error when the first stream chunk is an error.

    3.0.0release notes

  • Does not limit maxTokens when the model ID is unknown.

    3.0.0release notes

  • Adds validation for Anthropic prompt caching.

    3.0.0release notes

  • Adds specificationVersion to ProviderV3.

    3.0.0release notes

  • Corrects raw usage information returned by the Anthropic provider.

    3.0.0release notes

  • Clamps temperature to the valid 0–1 range and emits warnings.

    3.0.0release notes

  • Uses the default thinking budget when none is specified.

    3.0.0release notes

  • Streaming tool calls without arguments now send {} as the tool input.

    3.0.0release notes

@ai-sdk/anthropic 224 changes

Breaking changes 1

  • Anthropic provider settings switch to providerOptions.

    2.0.0release notes

Security 1

  • Actions stay tied to the returned member name; disabled or unavailable members are rejected before tool calls are emitted, and member configuration is applied to local input validation, which rejects malformed streamed member input.

    2.0.113release notes

New APIs and options 12

  • Adds the Claude Fable 5.2 model ID with the same capabilities as Claude Fable 5.1, including 128k max output tokens, adaptive thinking, and native structured outputs by default.

    2.0.114release notes

  • Adds Claude Haiku 5.5 as a supported model, recognized with a 128k maximum output token limit and all five effort levels.

    2.0.109release notes

  • Adds cache control for tools.

    2.0.0release notes

  • Adds text support for citations.

    2.0.0release notes

  • Adds Claude v4 models to the provider.

    2.0.0release notes

  • Adds an option to disable parallel tool use.

    2.0.0release notes

  • Supports JSON response schemas via tool calls.

    2.0.0release notes

  • Adds raw chunk support, including support in streamText onChunk.

    2.0.0release notes

  • Adds the text_editor_20250429 tool for Claude 4 models.

    2.0.0release notes

  • Enables streaming tool calls.

    2.0.0release notes

  • Adds support for URL-based PDF documents in the Anthropic provider.

    2.0.0release notes

  • Adds support for server-side web search tool calls.

    2.0.0release notes

Behavior and default changes 6

  • Supported Claude 5 models on Bedrock can use native structured output. In automatic mode, Bedrock and Anthropic fall back when schemas contain recursive references, open objects, or more than ten optional properties.

    2.0.112release notes

  • When thinking is disabled, it is supported up to high effort; xhigh and max are lowered to high with a warning.

    2.0.109release notes

  • For claude-sonnet-5-5, budget-based thinking is converted to adaptive thinking.

    2.0.107release notes

  • For claude-sonnet-5-5, disabled thinking is replaced with between_tools thinking, with a warning.

    2.0.107release notes

  • For models that reject forced tool use, required and named tool choices fall back to auto, with a warning.

    2.0.103release notes

  • Provider metadata now includes raw Anthropic usage information.

    2.0.0release notes

Fixes and other changes 4

  • Final JSON text is preserved when a model does not call the JSON response tool, and tool preambles are kept out of structured output. Streaming buffers text until the message finishes.

    2.0.112release notes

  • Avoids forcing structured-output tools for incompatible Claude models on Amazon Bedrock.

    2.0.104release notes

  • Tool calls are preserved when using JSON structured output.

    2.0.100release notes

  • Client tool calls are ordered after provider-executed tool results.

    2.0.99release notes