npm / @ai-sdk/amazon-bedrock
@ai-sdk/amazon-bedrock
What changed in @ai-sdk/amazon-bedrock 3 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
139 breaking1 security20 deprecations40 new APIs and options1 performance25 behavior and defaults1 tooling46 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/amazon-bedrock 772 changes
Breaking changes 40
The package is ESM-only; consumers using require() must switch to ESM import syntax.
OpenTelemetry span collection is no longer built into the ai package; install this package and register an OpenTelemetry instance globally to receive traces.
CallSettings is split into LanguageModelCallOptions and RequestOptions; replace usages with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>.
Top-level generateText and streamText content now accumulates values across every step; use finalStep.content for final-step-only values.
Stabilizes the tool callback option formerly named experimental_context. Tool-specific context is now scoped and typed from contextSchema, with values supplied through toolsContext.
The deprecated experimental_customProvider export is removed; use customProvider instead. Its options and behavior are unchanged.
The deprecated option has been removed; replace remaining usages with activeTools.
The deprecated experimental_prepareStep option is removed; use prepareStep instead.
Removes the tracer property; pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.
Tool-result file content uses a canonical file variant with a tagged data union and a required mediaType, replacing image-* and file-* variants.
Top-level files and other step result collections now accumulate values across every step; use finalStep for final-step-only values.
The deprecated experimental_generateImage export is removed; use generateImage instead.
The deprecated Experimental_GenerateImageResult type export is removed; use GenerateImageResult instead.
Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody.
generateText no longer includes response bodies by default; opt in with include.responseBody.
Rename stepCountIs imports and usage to isStepCount in tool-loop stop conditions.
The deprecated function has been removed; use isToolUIPart instead.
Removes the deprecated top-level cachedInputTokens field; use inputTokenDetails.cacheReadTokens instead.
Removes the deprecated top-level reasoningTokens field; use outputTokenDetails.reasoningTokens instead.
The redirect option now defaults to error instead of follow, rejecting HTTP redirects by default to prevent SSRF.
The deprecated tool-result content part type has been removed; use the file variant for inline tool-result file content.
Raises the minimum supported Node.js version to 22; supported versions are 22, 24, and 26.
Renames the telemetry integration callback and tracing-channel event type from onEmbedFinish to onEmbedEnd.
Renames the per-call callback for completed embed and embedMany operations from experimental_onFinish to onEnd.
Renames the per-call callback for completed rerank operations from experimental_onFinish to onEnd.
The onEnd callback follows the result shape changes: usage and collection properties cover all steps, while final-step-only properties are available on finalStep.
Renames the telemetry integration callback and tracing-channel event type from onRerankFinish to onRerankEnd.
The generation start callback is renamed from experimental_onStart to onStart for generateText, streamText, and agents.
The per-step start callback is renamed from experimental_onStepStart to onStepStart for generateText, streamText, and agents.
The deprecated experimental_output option and generateText result property are removed; use output for both call options and result access.
Messages returned by prepareStep become the base for subsequent steps, combined with the previous step's response messages.
Shared generation and agent runtime data now flows through runtimeContext, separately from tool-specific context.
Each step's response.messages now contains only messages produced by that step, rather than the accumulated history; use result.responseMessages for the full history.
onChunk now receives every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.
System messages in prompt or messages are rejected by default; use the top-level instructions option or opt in with allowSystemInMessages for trusted existing messages.
Approval policy can be configured on a generation call or agent, allowing it to vary by request.
The deprecated type has been removed; replace remaining usages with ToolExecutionOptions.
Top-level toolCalls and related step result collections now accumulate values across every step; use finalStep for final-step-only values.
Pass per-tool context values through toolsContext, keyed by tool name; contextual tools declare their fields with contextSchema.
generateText and streamText usage now reports total token usage across all steps; use finalStep.usage for final-step-only usage.
Deprecations 18
The Chat class exported from @ai-sdk/vue is deprecated in favor of the useChat composable.
The user-message image content part is deprecated; use a file part with an image mediaType instead.
Moves the raw chunk inclusion option from top-level includeRawChunks into include.rawChunks; the old option continues to work as a deprecated alias.
The top-level system prompt option and related prepareStep, repair, and lifecycle fields are renamed to instructions; system remains a deprecated fallback, with instructions taking precedence.
The needsApproval property on tool() and dynamicTool() is deprecated; move approval logic to toolApproval on the call or agent.
Renames the final lifecycle callback for text generation, streaming, and agents from onFinish to onEnd. onFinish remains a deprecated alias; onEnd takes precedence when both are provided.
Renames the per-step lifecycle callback from onStepFinish to onStepEnd. The old name remains a deprecated alias for user-facing callbacks; onStepEnd takes precedence.
Renames experimental_onToolCallFinish to onToolExecutionEnd; the old name remains a deprecated fallback.
Renames experimental_onToolCallStart to onToolExecutionStart; the old name remains a deprecated fallback.
The top-level final-step providerMetadata property is deprecated; use result.finalStep.providerMetadata.
Top-level final-step result properties, including reasoning, are deprecated; use result.finalStep for final-step reasoning or metadata.
The top-level final-step reasoningText property is deprecated; use result.finalStep.reasoningText.
The top-level final-step request property is deprecated; use result.finalStep.request.
The top-level final-step response property is deprecated; use result.finalStep.response.
Renames the full event stream property to stream; fullStream remains available as a deprecated alias.
totalUsage is deprecated; use usage, which now includes token usage across all steps.
The streamText result method is deprecated; use the stateless top-level helper with a stream.
The streamText result method is deprecated; use stateless top-level helpers to transform and respond to streams.
New APIs and options 5
Declare tool-specific context fields with contextSchema; tool callback context types are inferred from that schema.
Models can return files in reasoning traces as a distinct content type; update exhaustive part handling to support it.
The top-level reasoning option is the provider-agnostic way to control reasoning effort; remove overlapping reasoning settings from providerOptions when migrating.
Register a telemetry integration globally at application startup to receive OpenTelemetry traces.
The Vue composable exposes reactive refs and automatically recreates the underlying chat when its init object changes.
Behavior and default changes 9
Speech generation has graduated from experimental status and is now named generateSpeech; the former name remains as a deprecated alias.
Renames experimental_include to include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias and include takes precedence.
The file variant accepts a full IANA type or a top-level segment; a subtype is auto-detected from inline bytes where possible.
Instructions returned from prepareStep persist into future steps until prepareStep returns another instructions or system override.
Experimental_SpeechResult is renamed to SpeechResult; the old name remains as a deprecated alias.
After a telemetry integration is registered, calls emit telemetry events by default; set isEnabled to false to opt out per call.
Renames experimental_telemetry to telemetry. The old name remains a deprecated alias during the migration window.
The transcription API has graduated from experimental status and is now named transcribe; the former name remains as a deprecated alias.
Experimental_TranscriptionResult is renamed to TranscriptionResult; the old name remains as a deprecated alias.
@ai-sdk/amazon-bedrock 5169 changes
Breaking changes 94
The thinking block binding field was renamed for Bedrock.
LangChainAdapter moved to this package, whose API uses UI message streams.
LlamaIndexAdapter moved to this package and follows the UI message stream pattern.
The deprecated ai/react export has been removed in favor of @ai-sdk/react.
The ai/rsc export has been extracted to the separate @ai-sdk/rsc package.
The package has been removed and its exports moved to the main ai package.
append has been replaced with sendMessage for sending messages through useChat.
The useChat configuration body is captured at first render and stays static; pass changing values at request time or use function configuration.
The Vue integration replaces the useChat composable with a Chat class.
The Svelte constructor now takes a function returning configuration, with transport configured through that return value.
The allowEmptySubmit option has been removed from chat request options.
The data option has been removed; move its contents to body.
RequestOptions has been renamed to CompletionRequestOptions; update type imports.
convertToCoreMessages has been renamed to convertToModelMessages.
Requires size to be supplied when creating the generator; the generated ID uses that fixed size when the generator is called.
CreateMessage has been renamed to CreateUIMessage.
The data stream protocol is replaced by UI message streams, which write typed message parts through the stream writer.
The data property has been removed from the useCompletion hook.
The data role has been removed from UI messages; use UI message streams with custom data parts instead.
Text delta chunks now use the delta property instead of textDelta.
Check the dynamic flag before narrowing toolCalls or toolResults; dynamic tool inputs are typed as unknown.
UI messages now include a dynamic-tool part type for rendering dynamic tool invocations.
The property has been replaced by file parts in the message parts array.
The experimental_continueSteps option has been removed from generateText().
File stream parts are flattened: read mediaType and data directly from the chunk instead of from chunk.file.
File parts now use url instead of data and mimeType.
The step completion stream event is renamed from step-finish; update stream event handlers.
The finish event exposes totalUsage instead of usage.
The option moves from streamText configuration to toUIMessageStreamResponse and no longer uses the experimental prefix.
The type name is updated from IDGenerator to IdGenerator.
The Svelte integration no longer manages input; applications must manage input state and send messages themselves.
The deprecated helper has been removed in favor of status.
Replaces DataStreamToSSETransformStream as the renamed stream transform function.
The option has been removed because it is no longer needed.
Import LanguageModelV3 from @ai-sdk/provider instead of ai.
Replaces LanguageModelV1Middleware and is imported from @ai-sdk/provider.
Image model settings have moved out of model settings; maxImagesPerCall is now passed to generateImage().
The generateText and streamText parameter maxTokens has been renamed to maxOutputTokens.
Core functions such as generateText and streamText replace maxSteps with stopWhen for multi-step execution control.
The parameter has been removed from Chat and useChat; use server-side stopWhen conditions for multi-step tool execution.
Use mediaType instead of mimeType for image and file types in model messages.
Usage data is attached as metadata to individual messages using messageMetadata in toUIMessageStreamResponse.
Svelte chat properties are readonly; update messages using setter methods such as setMessages.
CoreMessage has been renamed to ModelMessage.
The callback now receives new streaming chunk types with IDs and the start/delta/end pattern; update handlers to use the revised chunk properties and types.
Replaces getErrorMessage in toUIMessageStreamResponse and controls what error information is forwarded; by default, error messages are not sent to the client.
The callback has been removed from useChat and useCompletion.
Returning values from onToolCall no longer automatically submits tool results; call addToolOutput explicitly.
Vue messages now expose a parts array instead of a content string.
Replaces pipeDataStreamToResponse for piping a stream to a server response.
This transport configuration option replaces experimental_prepareRequestBody for preparing chat request bodies.
The function was removed; use readUIMessageStream or the Chat/useChat APIs to process UI message streams.
The input parameter providerMetadata has been renamed to providerOptions; returned result metadata remains named providerMetadata.
Pass pollIntervalMillis under providerOptions instead of in the image model settings.
Embedding model settings now belong in providerOptions instead of model parameters.
The reasoning property on reasoning UI parts has been renamed to text.
In generateText() and streamText() results, reasoning now contains an array of reasoning details rather than reasoning text.
Reasoning content now supports start, delta, and end chunks with IDs, in addition to a single reasoning chunk containing the full text.
Amazon Bedrock provider options now use camelCase, so replace reasoning_config with reasoningConfig.
Use reasoningText for reasoning text in multi-step generations and generateText() or streamText() results.
regenerate replaces reload and can regenerate either the last message or a specific message by ID.
reload has been renamed to regenerate.
The embed result property rawResponse has been renamed to response.
Provider response objects use response instead of rawResponse.
Resume functionality is now configured with resumeStream instead of experimental_resume.
The option has been removed because sending extra message fields is now the default behavior.
sendMessage replaces append and accepts structured message formats.
Source stream parts are flattened: read sourceType, id, title, and url directly from the part instead of from part.source.
The stepType property has been removed from step results; determine step roles from index and toolResults instead.
StreamData has been removed; use UI message streams for custom data.
Temperature is no longer set to 0 by default; set it explicitly to retain that value.
Streaming now uses a start/delta/end pattern with unique IDs for each content block.
experimental_toToolResultContent has been renamed to toModelOutput and is no longer experimental.
Tool call args has been renamed to input.
Tool call streaming is always enabled by default.
Tool definitions use inputSchema instead of parameters.
Tool result result has been renamed to output.
Tool UI parts use input-streaming, input-available, output-available, and output-error states instead of the previous lifecycle states.
The option has been removed because tool call streaming is always enabled by default.
ToolExecutionError has been removed; tool execution errors appear as tool-error content parts in result steps and streams.
Use totalUsage for token usage across all steps; usage now reports only the final step.
Replaces toDataStreamResponse with the UI message stream response helper.
Message has been renamed to UIMessage.
The UI message reasoning property has moved into parts as a reasoning part.
UI tool parts use typed names in the form tool-${toolName} instead of generic tool-invocation types.
Token usage properties are renamed from promptTokens and completionTokens to inputTokens and outputTokens; totalTokens is now required.
The hook has been removed; use useChat configured for the route instead.
Share chat state by passing the same Chat instance to useChat hooks instead of reusing an id.
useChat no longer manages input state internally; applications must manage input state manually.
useChat no longer accepts maxSteps; use server-side stopWhen or configure client-side tool-result submission.
The initialMessages option has been renamed to messages.
Configure chat requests through transport objects instead of direct API options.
DataStreamWriter.writeData has been removed; use custom data parts with UI message streams.
DataStreamWriter.writeMessageAnnotation has been removed; use custom data parts with UI message streams.
Security 1
Sanitizes document filenames before sending them to Bedrock.
Deprecations 1
Use addToolOutput instead of addToolResult, passing output and a tool name; addToolResult remains available but is deprecated.
New APIs and options 25
Adds Claude Haiku 5.5 support on Amazon Bedrock, with a 128k max output token limit, adaptive thinking, and all five effort levels.
Adds the US-prefixed Claude Haiku 5.5 model ID for Amazon Bedrock.
Portable reasoning now supports max, with native provider mappings, compatibility coercions, and budget-based fallback support.
Adds per-request metadata to the Converse and ConverseStream APIs for tagging Amazon Bedrock invocation logs for cost attribution.
Adds the 20260318 web search and web fetch tools with response inclusion controls.
Claude Fable 5.1 model IDs were added to the Bedrock provider.
Adds a provider option to choose between native structured output and the JSON tool fallback for Anthropic models.
Anthropic reasoning budgets are enabled for application inference profile ARNs.
A model family setting is available for embeddings to support ARN models.
Adds a Bedrock Mantle provider.
Adds support for the claude-opus-4-8 model.
Defines tools whose input and output types are not known at compile time, supporting tools defined at runtime.
Use getToolName as a fallback helper when rendering all tool invocations with a catch-all pattern.
Use isToolUIPart as a fallback for catch-all rendering of tool invocations.
embedMany now makes parallel requests and lets you configure their maximum number with maxParallelCalls.
Supports native structured output for Anthropic models without reasoning.
Adds support for provider references and uploading files as supported per provider.
Adds a top-level reasoning parameter supported by generateText and streamText.
Use this option with lastAssistantMessageIsCompleteWithToolCalls for automatic tool result submission.
Adds support for a service tier for model inference.
Use stopWhen with step-count, tool-call, array, or custom conditions to control multi-step execution; conditions are evaluated only when the last step contains tool results.
The streaming protocol adds text-end chunks to finalize text blocks.
Streams tool input JSON as it is generated.
Signals that a streamed tool input is complete.
Streams the beginning of generated tool input, including the tool name and ID.
Performance 1
Update the peer dependency to Zod 4.1.8 or later; the notes recommend this to avoid TypeScript performance issues.
Behavior and default changes 11
Bedrock uses native structured output and strict tools only for known supported Claude models; future Claude model IDs omit unsupported fields and use JSON instructions for structured output by default.
Top-level embedding dimensions are now mapped to provider settings.
Capability declarations now use confirmed model IDs, advertise file and mask support where applicable, and allow asynchronous lookups and middleware overrides to resolve to unknown.
Structured output defaults to the JSON tool fallback for Claude Sonnet 4.6 and Claude Haiku 4.5, while strict tool support is preserved.
Amazon Bedrock streaming responses now accept citation deltas.
The option is no longer experimental; use activeTools instead of experimental_activeTools.
The stream part type adds lifecycle events, IDs, start/delta/end patterns for text and reasoning, and streamed tool input.
MCP tools that do not provide schemas are automatically treated as dynamic tools.
The option is promoted from experimental_prepareStep to prepareStep and can configure the model, active tools, tool choice, and system message for a step.
Message persistence is handled through the UI message stream response method, whose onFinish callback receives messages and responseMessage in UIMessage format.
The stable export replaces experimental_wrapLanguageModel.
Tooling 1
If TypeScript performance issues persist after upgrading, set moduleResolution to nodenext.
Fixes and other changes 35
SigV4 signing is skipped for non-ASCII header values.
Structured output for Claude Haiku 5.5 on Amazon Bedrock uses the JSON tool fallback.
Partial configurations continue to preserve explicit values and derive missing fields; explicit effort or budget overrides and disabled thinking no longer emit warnings for portable mappings that are not sent.
Nova 2 calls using portable xhigh now send maxReasoningEffort: 'high' instead of the unsupported 'max', and return a compatibility warning.
Hostname parts are validated using isValidHostnamePart.
The User-Agent header now follows standards, improving compatibility with systems that inspect it.
The provider omits max output tokens for Nova 2 Lite high reasoning.
Unsupported OpenAI sampling settings are omitted from Converse requests.
Supported Mantle models are routed through the OpenAI endpoint.
Unsupported sampling parameters are omitted for newer Claude models.
Avoids forcing structured-output tools for incompatible Claude models.
API error messages are preserved when the error type is omitted.
Open tool schemas no longer use strict mode.
Anthropic features are enabled for application inference profile chat models.
Bedrock endpoints now support non-standard AWS regions and service-specific overrides.
Returns text from citation content responses.
Preserves provider-executed tool results when replaying messages.
Assistant messages are omitted when filtering unsigned reasoning leaves only cache points.
Amazon Bedrock now forwards the Anthropic option for disabling parallel tool use without sending conflicting tool choice fields.
Modeled event-stream exceptions are now surfaced by the Amazon Bedrock provider.
Handles empty string tool call IDs.
Supports reasoningContent.redactedContent from the Converse API and replays it on subsequent turns.
AWS_SESSION_TOKEN is no longer used when keys are explicitly defined.
Preserves cache points on message content parts.
Detects Cohere embedding models behind cross-region inference profile IDs.
Extracts Cohere embedding token usage from the response header.
Adds support for document files in tool results.
Transforms Bedrock Anthropic error responses to Anthropic format.
createAmazonBedrock() no longer captures fetch at initialization, so fetch patches applied after provider creation are respected.
Disables native structured output for claude-opus-4-7.
Preserves reasoning text when a signature is present.
Fixes Anthropic reasoning behavior related to Opus 4.7.
Custom reasoning configuration properties are merged when the top-level reasoning parameter is set.
Tool specs omit strict for Claude Opus 4.7 and 4.8 on Bedrock because the Messages API rejects that field.
Adds the tool search beta for Anthropic.
@ai-sdk/amazon-bedrock 423 changes
Breaking changes 4
Amazon Bedrock event stream frame decoding and processing failures are surfaced instead of silently completing the stream.
Amazon Bedrock event streams ending with an incomplete buffered frame are rejected instead of completing normally with partial output.
The baseUrl option has been removed from all providers; use baseURL instead.
The embedding model API is now embeddingModel('my-model-id') instead of textEmbeddingModel('my-model-id').
Deprecations 1
textEmbeddingModel is retained as a deprecated alias; use embeddingModel instead.
New APIs and options 8
Adds a structured output mode option.
The Amazon Bedrock provider now supports citations.
The Amazon Bedrock provider adds support for the Claude Sonnet 4.5 model.
Bedrock supports the maxReasoningEffort field for Nova 2 extended reasoning.
Bedrock responses now expose the stop sequence that halted generation as providerMetadata.bedrock.stopSequence; it is null when no stop sequence matched.
The provider adds support for reranking models.
Bedrock now supports combining tool calls with structured JSON output schemas, enabling workflows with tools and structured final outputs.
The Amazon Bedrock provider now supports user-provided filenames.
Behavior and default changes 2
Native structured output is used for known supported Claude models; future Claude model IDs use JSON instructions for structured output by default.
Claude Sonnet 4.6 and Claude Haiku 4.5 default to the JSON tool fallback while preserving strict tool support.
Fixes and other changes 8
Strict-tool fields are omitted for future Claude model IDs that do not support them.
Generated text is now returned from citation content blocks.
Amazon Bedrock now handles channel-qualified JSON response tool names.
Raw usage metadata now preserves complete Amazon Bedrock Converse usage objects.
The Bedrock provider now handles empty tool descriptions gracefully.
Reasoning with Bedrock now works when additionalModelRequestFields is used.
Streaming tool calls without arguments now send {} as their tool input.
Bedrock temperature values are clamped to the valid 0–1 range, with warnings.
@ai-sdk/amazon-bedrock 39 changes
Breaking changes 1
For claude-sonnet-5-5, disabled thinking is replaced with between_tools thinking, and budget-based thinking is converted to adaptive thinking; disabled thinking emits a warning.
New APIs and options 2
Adds Claude Haiku 5.5 as a supported Amazon Bedrock model.
Adds the between_tools thinking type, the lowest thinking setting for claude-sonnet-5-5.
Behavior and default changes 3
For claude-sonnet-5-5, jsonTool falls back to native structured outputs with a warning.
For claude-sonnet-5-5, required and named tool choices fall back to auto with a warning because the model rejects forced tool use.
Claude Sonnet 4.6 and Claude Haiku 4.5 now default to the JSON tool fallback.
Fixes and other changes 3
For claude-sonnet-5-5, xhigh and max effort are lowered to high with a warning because the API rejects them with between_tools.
Resolves endpoints for non-standard AWS partitions and endpoint overrides.
Non-streaming citation responses now return text.