Back to timeline

AI SDK 7 is now available

Vercel News·Gregor Martynus·

AI SDK 7 is a major release for building production agents in TypeScript. The SDK has grown from model calls and chat primitives into a broader agent platform for developing, running, integrating, and observing agents across text, audio, realtime, image, and video. Every major provider is supported out of the box.

AI SDK 7 introduces two breaking requirements:

Run the v7 codemods to automate the majority of import and rename changes before reviewing semantic migration items manually. See the .full v7 migration guide

AI SDK 7 adds the primitives agents need once they leave local demos.

AI SDK 7 introduces a harness layer for bringing established agents into the AI SDK ecosystem. Wrap harnesses such as Claude Code, Codex, Deep Agents, OpenCode, and Pi behind the same agent interface used by the rest of the SDK.

AI SDK 7 expands the SDK across realtime, video, speech, transcription, images, files, embeddings, and structured output.

The UI and streaming work in v7 focuses on making agent streams correct, composable, and reliable.

The MCP package grows from a tool transport layer into a richer integration surface for agent tools and app UIs.

Send this prompt to your AI coding agent to get started:

The following highlights cover the most impactful promotions:

The following highlights cover the most impactful renames:

The following highlights cover the most impactful deprecations:

Follow these steps to migrate an existing project to AI SDK 7:

For a guided migration, install the AI SDK v7 migration skill and ask your agent to apply it to your app:

Read more

At a Glance

Before You Upgrade

Develop Agents

Run Agents in Production

Integrate Agent Harnesses

Observe Agents

Build Beyond Text

UI, Streams, and Message Handling

Configure MCP

Configure Runtime and Packaging

Upgrade Path

  • with reasoning control, tool and runtime context, provider files and skills support, MCP Apps, and a terminal UI.Develop agents

  • with tool approvals, durable execution, first-class timeouts, and sandbox support.Run agentsWorkflowAgent

  • such as Codex, Claude Code, Deep Agents, OpenCode, or Pi.Integrate any agent harness

  • with redesigned telemetry, , Node.js tracing channel support, lifecycle callbacks, and step performance statistics.Observe agent behavior@ai-sdk/otel

  • with stable speech/transcription APIs, richer file parts, image generation and editing, multimodal embeddings, reranking, realtime voice (experimental), and video generation (experimental).Build beyond text

  • through the new migration skill, codemods, and migration paths for ESM, Node.js 22, , , , , , and .Upgrade with clearer APIsinstructionstelemetrystreamfinalStepruntimeContexttoolsContext

  • : Node 22 is required because the SDK depends on APIs (including the native implementation and improved semantics) that are not backported to earlier LTS lines.Node.js 22 minimumfetchAsyncLocalStorage

  • : AI SDK 7 requires ESM imports ( syntax or files). CommonJS is not supported. Update your to include or migrate individual files to .ESM imports requiredimport.mjsrequire()package.json"type": "module".mjs

  • : and now support a top-level option that maps to provider-native settings across OpenAI, Anthropic, Google, Groq, xAI, Bedrock, Fireworks, DeepSeek, Open Responses, and OpenAI-compatible providers. Note that exact behavior and available parameters vary by provider.Provider-agnostic reasoning controlgenerateTextstreamTextreasoning

  • : Shared orchestration state lives in and flows through , approval functions, lifecycle callbacks, telemetry, , and .Typed runtime contextruntimeContextprepareStepToolLoopAgentWorkflowAgent

  • : Tools can declare a , and callers provide per-tool values through , so third-party tools only receive the secrets or config they need.Scoped tool contextcontextSchematoolsContext

  • : uploads large inputs once and reuses provider references in later calls, reducing redundant uploads in repeated PDF, dataset, image, and multi-step workflows.Provider file uploadsuploadFile

  • : brings the same pattern to provider-managed skill environments.Provider skill uploadsuploadSkill

  • : MCP support now includes model-visible versus app-only tools, app metadata, sandboxed iframe rendering, and JSON-RPC communication for tools, resources, logs, and display updates.MCP Apps

  • : runs AI SDK agents in an interactive terminal UI, letting you test reasoning, tools, and markdown output before building a full app.Terminal agent development@ai-sdk/tui

  • : , , and can define approval policies at the call or agent level. Policies can require user approval, auto-approve, auto-deny, or delegate to typed approval functions.Tool approvalsgenerateTextstreamTextToolLoopAgent

  • : Higher-risk approval flows can revalidate tool inputs and policies before continuation, use WorkflowAgent approval validation, and opt into HMAC signing. HMAC signing cryptographically binds the original tool inputs to the approval token, preventing tampering with tool arguments between the approval request and resumption.Hardened approval replay

  • : introduces for long-running agents. Execution state is persisted to durable storage between steps, so agents survive deploys, process restarts, interruptions, and delayed approvals. To learn more, see the .Durable execution@ai-sdk/workflowWorkflowAgentWorkflowAgent docs

  • : supports streaming, tools, approvals, typed runtime and tool context, lifecycle callbacks, stable telemetry, provider-executed approval resumption, and tool result conversion.Workflow-aware agent featuresWorkflowAgent

  • : Text generation and agent APIs can define total, per-step, per-chunk, default tool, and per-tool timeout budgets. Timeout aborts use , and abort reasons flow through stream and UI protocols.First-class timeoutsTimeoutError

  • : The sandbox abstractions support command execution, streaming output, working directories, environment variables, abort signals, and step-level sandbox overrides.Sandboxed execution

  • : Run external agent harnesses through the AI SDK interface, with standard and results.HarnessAgentAgentgeneratestream

  • : Claude Code, Codex, Deep Agents, OpenCode, and Pi harness adapters let teams plug existing agent runtimes into AI SDK apps.Adapters for agents

  • : Harness agents can receive sandboxes, instructions, custom skills, and tools, so the same runtime can be shaped for different products and workflows.Configurable harness runs

  • : Workflow utilities, session bridging, and APIs for interrupted-turn continuation make harness runs suitable for longer tasks.Durable, resumable sessions

  • : Harness adapters support Vercel OIDC for AI Gateway, simplifying hosted and sandboxed agent execution.Gateway-ready authentication

  • : Register telemetry once and receive structured events across model calls, steps, tools, embeddings, reranking, and agent execution.Global telemetry integrations

  • : OpenTelemetry support now lives in , with GenAI-semantic convention spans and metrics, supplemental AI SDK attributes, and span-enrichment hooks. To learn more, see the .Dedicated OpenTelemetry package@ai-sdk/otel@ai-sdk/otel docs

  • : AI SDK 7 emits structured telemetry through the Node.js tracing channel, allowing observability providers to subscribe once while preserving async context across streaming and tool execution.Node.js tracing channel

  • : Runtime and tool context can be deliberately included in telemetry, with controls to prevent secrets from being exposed by default.Sensitive context controls

  • : Callbacks are more consistent across core functions, agents, tools, embeddings, reranking, structured output, and UI streams. Callback payloads carry richer data for step, usage, content, file, source, warning, tool, model-call, and error events.Lifecycle callbacks

  • : Step results expose timing and throughput metrics, including response time, total step time, tool execution time, time to first output, and output tokens per second.Performance statistics

  • : Browser-to-provider WebSocket sessions for OpenAI, Google, and xAI, with audio/text conversations, client-driven tool calls, and normalized routing through AI Gateway.Realtime (experimental)

  • : Video generation works across AI Gateway, Google AI Studio, Google Vertex, fal, Replicate, ByteDance Seedance, Kling AI, Prodia, and xAI, with support for long-running SSE responses and safer bounded downloads.Video generation (experimental)

  • : , , , and are stable exports.Stable speech and transcriptiongenerateSpeechtranscribeSpeechResultTranscriptionResult

  • : Image parts move toward the same canonical file model as other media. Tool outputs can use a single shape for inline data, URLs, provider references, and text-backed content.Images as filesfile

  • : Providers add image generation, image editing, multimodal embeddings, speech, transcription, reranking, file references, reasoning files, and provider-specific media metadata.Richer media and model support

  • : JSON Schema post-processing is stricter for Zod and Standard Schema inputs, malformed JSON extraction and repair is available for structured outputs and tool calls, and array output mode preserves transforms, coercions, defaults, and pipes.Structured output reliability

  • : can call an directly from UI code.Direct agent transportDirectChatTransportAgent

  • : UI messages support automatic approval responses and improved approval replay behavior.Tool approval in UI flows

  • : React callbacks update with current props/state; supports async conditions; Vue gains an idiomatic composable; and Angular APIs are aligned with current AI SDK patterns.Framework improvementsuseChatsendAutomaticallyWhenuseChat

  • : Provider streams that end before a finish chunk are treated as errors, tool execution errors are emitted and cleaned up predictably, and streaming reasoning edge cases are handled more consistently.More reliable streams

  • : Provider metadata is retained across text generation, UI streams, tool invocations, and multi-turn provider ID mapping.Provider metadata preservation

  • : Top-level , tool calls/results, , , , and now represent the full run. Final-step-only details are available through .Multi-step resultscontentfilessourceswarningsusagefinalStep

  • : MCP clients support protocol version , server metadata, server instructions, ping responses, negotiated protocol headers, and public .Protocol and metadata2025-11-25listTools()

  • : MCP tools can expose and , and tool definitions can be separated from executable tools.Typed tool outputsoutputSchemastructuredContent

  • : Tool results and prompt messages can include MCP content.Resource contentresource_link

  • : MCP Apps use tool metadata to render app-specific UI inside sandboxed iframes while keeping model-visible and app-only tools separate.App rendering

  • : HTTP, SSE, and OAuth transports support custom , redirect configuration, OAuth refresh deduplication, state validation, asynchronous client authentication, richer errors, and better SSE frame handling.Transport reliabilityfetch

  • : AI SDK packages require Node.js 22 or later.Node.js 22 minimum

  • : AI SDK 7 requires ESM imports ( syntax or files). Update your to include or migrate individual files to .ESM imports requiredimport.mjspackage.json"type": "module".mjs

  • : A dedicated migration skill is available that developers can install and ask their agent to use for AI SDK v6-to-v7 upgrades. Migration skill available

  • : The v7 codemods cover the majority of renames and cleanup migrations.Codemods available

  • becomes experimental_customProvidercustomProvider

  • becomes experimental_generateImagegenerateImage

  • becomes experimental_outputoutput

  • becomes experimental_prepareStepprepareStep

  • becomes experimental_telemetrytelemetry

  • option becomes systeminstructions

  • System messages inside or require promptmessagesallowSystemInMessages: true

  • becomes onFinishonEnd

  • becomes StreamTextResult.fullStreamstream

  • is split into model generation options and request/transport optionsCallSettings

  • : on and is deprecated. Move approval logic to on , , or .Tool approvalneedsApprovaltool()dynamicTool()toolApprovalgenerateTextstreamTextToolLoopAgent

  • : Result methods like and are deprecated. Use top-level helpers like and .Stream response helpersresult.toUIMessageStreamResponse()result.toTextStreamResponse()createUIMessageStreamResponsecreateTextStreamResponse

  • : The Vue class is deprecated. Use the composable instead.Vue chatChatuseChat

  • : The top-level option replaces overlapping provider-specific reasoning settings unless a provider-specific override is intentional.Reasoning configuration is centralizedreasoning

  • : OpenTelemetry span collection is no longer built into the package. Telemetry is registered globally, and custom tracers move into the constructor.OpenTelemetry moved to@ai-sdk/otelaiOpenTelemetry

  • : Text generation results exclude request and response bodies by default.Request and response body retention is opt-in

  • : Top-level , , tool calls/results, files, sources, and warnings accumulate across all steps; final-step-only data lives under .Multi-step results now represent the full runusagecontentfinalStep

  • : Legacy media and image-specific parts move toward parts with media types.Message parts are more canonicalfile

  • : MCP HTTP/SSE redirects are treated as errors, OpenAI Responses reasoning summaries default to detailed, and Anthropic cache creation token metadata moves into standard usage fields.Package-specific behavior changed

Coming Out of Experimental

Renamed APIs

Deprecated APIs

Other Migration Themes

  1. : Verify your runtime and CI environments meet the minimum requirement before upgrading packages.Update Node.js to 22+

  2. : Bump and all packages to their v7 releases in your .Update packagesai@ai-sdk/*package.json

  3. : The codemods automate the majority of renames, import changes, and API moves. Review the diff before committing.Run the v7 codemods

  4. : If you use tracing, move your setup to and register telemetry globally. Refer to the and the for attribute details.Migrate OpenTelemetry@ai-sdk/otel@ai-sdk/otel docsOpenTelemetry span schema

  5. : Codemods cannot fully decide runtime requirements, ESM imports, instruction/message behavior, runtime/tool context separation, approval policy placement, stream helper usage, and multi-step result shapes. See the .Review semantic changes manuallyfull v7 migration guide