# AI SDK 7

> Source: <https://vercel.com/blog/ai-sdk-7>
> Published: 2026-06-25 13:00:00+00:00

AI SDK, with over 16 million weekly downloads, is the TypeScript SDK for building AI applications, features, frameworks, and agents across any model provider. It's the same layer [eve](https://vercel.com/eve), Vercel's open-source agent framework, is built on.

AI SDK 7 adds production depth for agent work across five areas:

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

**Run agents** with tool approvals, durability (`WorkflowAgent`

), timeouts, and sandbox support.

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

**Observe agents** with telemetry, Node.js tracing channel, lifecycle events, and performance statistics.

**Go beyond text agents** with provider-agnostic real-time support and video generation.

Building well-behaved agents requires fine-grained control over model reasoning, tool context, and file handling.

Most frontier models support configurable reasoning, but every provider API exposes it differently.

AI SDK 7 standardizes this with a `reasoning`

option for `generateText`

and `streamText`

. It maps to provider-native reasoning settings, letting you control reasoning effort in a single line. You can also still fall back to provider options when you need more detailed provider-specific reasoning configuration.

Learn more in the [reasoning documentation](https://ai-sdk.dev/docs/ai-sdk-core/reasoning).

Tools are increasingly developed independently of specific agents or applications. For example, third-party companies offer tools that enable agents to use their APIs. Therefore, tools require additional inputs that are not generated by LLMs, such as API keys or configuration settings.

AI SDK 7 adds a fully typed tool context that can be specified for each tool via a schema. The context is limited to the tool to prevent 3rd-party tools from accessing context they do not need.

Learn more about [Tool Context](https://ai-sdk.dev/docs/ai-sdk-core/runtime-and-tool-context#tool-context)

For more complex agentic loops, you often need variables that you can access and modify in `prepareStep`

to adjust prompts, model selection, and more.

AI SDK 7 introduces a typed runtime context available during step preparation and tool approval functions, with optional telemetry support. This enables you to encapsulate more logic in `ToolLoopAgent`

and share those agents with that internal logic.

Learn more about [Runtime Context](https://ai-sdk.dev/docs/ai-sdk-core/runtime-and-tool-context).

Many agent workflows require handling large inputs, such as PDFs, images, datasets, or other artifacts. Sending those files inline is slow and wasteful, especially for stateless inference, where they get sent over and over again.

AI SDK 7 adds a top-level `uploadFile`

API that lets you upload a file once and then pass a lightweight reference into subsequent model calls. This avoids re-uploading the same bytes repeatedly, making inference faster and saving bandwidth during repeated or multi-step runs.

`uploadFile`

can be used with any providers that offer a file uploading endpoint. The function returns a provider reference object that is portable across providers.

Learn more about [Provider File Uploads](https://ai-sdk.dev/docs/ai-sdk-core/file-uploads)

Sending skills inline on every request to provider-managed container environments has the same overhead problem as sending files inline.

AI SDK 7 adds a top-level `uploadSkill`

API that lets you upload a skill once and then use a reference to it in subsequent inference calls. Similar to `uploadFile`

, the function returns a provider reference object.

Learn more about [Provider Skill Uploads](https://ai-sdk.dev/docs/ai-sdk-core/skill-uploads).

MCP has become a common way to connect agents to tools and resources. But not every tool should be model-visible, and some MCP servers need to expose specialized UI alongside their tools.

AI SDK 7 adds support for MCP Apps. MCP servers can now separate model-visible tools from app-only tools, preserve app metadata, and render app UIs inside sandboxed iframes. A JSON-RPC bridge connects tools, resources, and display interactions.

This lets you build richer agent experiences where the model can use the tools it needs, while the user sees an app-specific interface for review, configuration, or interaction.

Start building your first [MCP App with AI SDK](https://ai-sdk.dev/docs/ai-sdk-core/mcp-apps) today.

When developing agents, you need to be able to quickly test them without writing a full app. AI SDK 7 adds a terminal UI (TUI) package that lets you run agents with just a few lines of code:

The TUI is interactive, supports reasoning and tools, and renders markdown as formatted text.

Learn more about [creating your own terminal agent](https://ai-sdk.dev/docs/ai-sdk-harnesses/terminal-ui).

As agents become more autonomous and longer running, the need for approvals, durability, sandboxing, and robustness increases.

AI SDK 7 supports agent-level tool approvals that can be automatic or involve a human in the loop, with these approval types:

Simple `user-approval`

for particular tools.

Tool approval function for a particular tool that can auto-approve, auto-deny, or forward to user approval.

Generic catch-all tool approval functions.

Tool approvals are defined on `ToolLoopAgent`

, `generateText`

, and `streamText`

, because the usage scenario of a particular tool drives the need for approvals.

For higher-risk workflows, AI SDK 7 introduces opt-in HMAC-signed tool approvals to prevent forged approvals. The SDK also hardens replay behavior by revalidating tool inputs and policies before continuing execution.

When an agent run spans multiple steps or waits for a human approval, a process restart or deployment in the middle of that run means starting over. AI SDK 7 introduces `@ai-sdk/workflow`

and `WorkflowAgent`

for durable, resumable agent execution that survives process restarts, deploys, interruptions, and delayed approvals.

`WorkflowAgent`

supports workflow-based streaming, tools, approvals, callbacks, `prepareCall`

, and provider model serialization across workflow step boundaries. It also supports typed runtime context for shared agent state and stable telemetry.

Callbacks now include richer execution data such as step numbers, previous results, duration, and success or failure information. Invalid tool calls are preserved without executing invalid tools, and tool `toModelOutput`

conversion can preserve raw outputs for UI and callbacks.

Learn how to [build an agent with WorkflowAgent](https://ai-sdk.dev/docs/agents/workflow-agent).

Agents can stall in more ways than a simple request can: a provider can open a stream and stop sending chunks, a tool can hang, or a multi-step run can exceed its total budget.

AI SDK 7 adds first-class timeout configuration across text generation and agent APIs, including total, per-step, per-chunk, and per-tool limits. Timeout aborts use `TimeoutError`

, and abort reasons propagate through stream and UI protocols.

Learn more about [timeouts](https://ai-sdk.dev/docs/ai-sdk-core/settings#timeout).

Agents that run shell commands, read and write files, or execute generated code need a consistent execution environment, but the underlying sandbox often changes across local dev, CI, and production. AI SDK 7 adds a first-class `SandboxSession`

abstraction for portable command execution in tools and agents. Tools can be developed independently of any particular sandbox, and you can use any sandbox-aware tool with any sandbox provider.

Sandboxed environments, such as [Vercel Sandbox](https://vercel.com/sandbox), are ideal for this purpose.

Agent runtimes are moving beyond a single application server. Teams want to run the same agent logic inside coding environments, hosted sandboxes, local sessions, and third-party harnesses.

AI SDK 7 introduces experimental harness abstractions and `HarnessAgent`

: one API to run fully configured, established agent harnesses such as Claude Code, Codex, and Pi. Harnesses are configurable with a sandbox to operate in, custom instructions, skills, and tools. Run established harnesses through a consistent interface, configure each one independently, and swap one out without changing your integration layer.

Under the hood, the abstraction consists of a v1 adapter spec, bridge support, and expanded sandbox session primitives for creating and resuming sessions. Harness sessions can be parked and resumed, and even individual turns can be interrupted and resumed mid-flight.

`HarnessAgent`

implements AI SDK's `Agent`

interface, so its `generate`

and `stream`

return values are fully compatible with existing AI SDK integrations, and `useChat()`

and the new TUI work without any additional wiring.

Learn more about [AI SDK Harnesses](https://ai-sdk.dev/v7/docs/ai-sdk-harnesses).

Understanding how your agents behave in production is challenging. AI SDK 7 makes observability a first-class part of building agents.

AI SDK 7 revamps telemetry around a single, extensible integration system. Instead of wiring lifecycle callbacks into every `generateText`

or `streamText`

call, register telemetry once at application startup:

The redesign includes:

Dedicated telemetry interfaces for 3rd-party provider integration

Global coverage of all AI SDK functions with a single registration

Optional OpenTelemetry integration using the latest GenAI semantic conventions

Node.js tracing channel support

Observability integrations: Datadog, Langfuse, Braintrust, Raindrop, Sentry, Laminar, Langsmith.

Traces now capture the full shape of an AI operation, including the root generation, each model call, individual steps, tool executions, embeddings, reranking, usage, errors, and selected runtime or tool context.

You can find more details in the [AI SDK Telemetry documentation](https://ai-sdk.dev/docs/ai-sdk-core/telemetry).

AI SDK 7 adds support for Node.js tracing channels via `node:diagnostics_channel`

. The SDK emits structured telemetry events on the `ai:telemetry`

channel for `generateText`

, `streamText`

, model calls, tool executions, embeddings, and reranking.

An observability provider can subscribe once via its instrumentation package and automatically convert AI SDK activity into traces, preserving async context across streaming responses and tool calls.

You can learn more in the [tracing channel documentation](https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tracing-channel).

AI SDK 7 adds per-step performance statistics for model output, streaming behavior, and tool execution. You can answer questions like: How long did it take the model to start responding? How fast did tokens arrive? Which tool took the most time?

Learn more about [performance statistics](https://ai-sdk.dev/docs/ai-sdk-core/generating-text).

Production agents need lifecycle hooks because recording state, billing, and debugging all depend on knowing exactly when runs, steps, and tools start and finish. AI SDK 7 makes callbacks fire consistently across model calls, agents, tools, and other functions, so you can observe when each started, which model ran, how many tokens it used, and how it finished.

You can find more details in the [Lifecycle Callbacks documentation](https://ai-sdk.dev/docs/ai-sdk-core/lifecycle-callbacks).

Realtime model APIs are powerful, but each provider exposes sessions, audio, tools, and browser authentication differently.

AI SDK 7 adds experimental provider-agnostic realtime support for direct browser WebSocket sessions. The SDK supports server-created ephemeral tokens, provider implementations for OpenAI, Google, and xAI, and a React realtime hook that returns `UIMessage[]`

.

Realtime sessions support audio transcription and client-driven tool calling, so you can build voice agents, collaborative copilots, and low-latency interactive interfaces without binding your UI to one provider's event format.

AI Gateway also supports normalized realtime sessions through `gateway.experimental_realtime()`

, including WebSocket subprotocol auth, model query selection, and validated provider options.

Learn more about [realtime](https://ai-sdk.dev/docs/ai-sdk-core/realtime).

AI applications are expanding beyond text and images. AI SDK 7 introduces experimental `generateVideo`

support with provider implementations for fal, Google AI Studio, Google Vertex, and Replicate.

Video generation in AI SDK 7 uses video-specific model resolution, supports string-based model lookup through the default provider, and includes safer bounded download handling with configurable size limits and abort support.

Learn more about [generating video](https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-video#experimental_generatevideo).

Install AI SDK 7 with one command.

AI SDK 7 is the result of the combined work of our core team at Vercel (Gregor, Lars, Felix, Aayush, Josh, Nico) and our amazing community of contributors:

[0xr3ngar](https://github.com/0xr3ngar), [31Carlton7](https://github.com/31Carlton7), [A-Vamshi](https://github.com/A-Vamshi), [Abdulwadood-zawity](https://github.com/Abdulwadood-zawity), [abhicris](https://github.com/abhicris), [adithya-tako](https://github.com/adithya-tako), [AhmadYasser1](https://github.com/AhmadYasser1), [ahmedrowaihi](https://github.com/ahmedrowaihi), [allenzhou101](https://github.com/allenzhou101), [anaclumos](https://github.com/anaclumos), [arnaugomez](https://github.com/arnaugomez), [auscaster](https://github.com/auscaster), [AVtheking](https://github.com/AVtheking), [B-Step62](https://github.com/B-Step62), [bb220](https://github.com/bb220), [ben-vargas](https://github.com/ben-vargas), [benyebai](https://github.com/benyebai), [bittere](https://github.com/bittere), [blurrah](https://github.com/blurrah), [bolaabanjo](https://github.com/bolaabanjo), [boylec](https://github.com/boylec), [BrianHung](https://github.com/BrianHung), [BrianP8701](https://github.com/BrianP8701), [chenxin-yan](https://github.com/chenxin-yan), [christian-bromann](https://github.com/christian-bromann), [Christian-Sidak](https://github.com/Christian-Sidak), [cipher416](https://github.com/cipher416), [CloudFaye](https://github.com/CloudFaye), [codewarnab](https://github.com/codewarnab), [codicecustode](https://github.com/codicecustode), [codylittle](https://github.com/codylittle), [cristiandrei1234](https://github.com/cristiandrei1234), [csidak](https://github.com/csidak), [ctate](https://github.com/ctate), [cyphercodes](https://github.com/cyphercodes), [defrex](https://github.com/defrex), [dflynn15](https://github.com/dflynn15), [dinmukhamedm](https://github.com/dinmukhamedm), [dnukumamras](https://github.com/dnukumamras), [DongSeonYoo](https://github.com/DongSeonYoo), [dukex](https://github.com/dukex), [edawerd](https://github.com/edawerd), [EdwardIrby](https://github.com/EdwardIrby), [edwardwc](https://github.com/edwardwc), [ellis-driscoll](https://github.com/ellis-driscoll), [embedder-dev](https://github.com/embedder-dev), [etairl](https://github.com/etairl), [EurFelux](https://github.com/EurFelux), [eyueldk](https://github.com/eyueldk), [fahe1em1](https://github.com/fahe1em1), [Falven](https://github.com/Falven), [fran3cc](https://github.com/fran3cc), [gdborton](https://github.com/gdborton), [genmin](https://github.com/genmin), [geraint0923](https://github.com/geraint0923), [Ghitahouir](https://github.com/Ghitahouir), [GidianB](https://github.com/GidianB), [grant0417](https://github.com/grant0417), [gsdv](https://github.com/gsdv), [guillemwilly](https://github.com/guillemwilly), [hank9999](https://github.com/hank9999), [harpreetarora](https://github.com/harpreetarora), [haydenbleasel](https://github.com/haydenbleasel), [he-yufeng](https://github.com/he-yufeng), [heiwen](https://github.com/heiwen), [hkd987](https://github.com/hkd987), [hntrl](https://github.com/hntrl), [http-samc](https://github.com/http-samc), [i5d6](https://github.com/i5d6), [ismaelrumzan](https://github.com/ismaelrumzan), [Jaaneek](https://github.com/Jaaneek), [jaderiverstokes](https://github.com/jaderiverstokes), [jakobhoeg](https://github.com/jakobhoeg), [Jaksenc](https://github.com/Jaksenc), [jarod](https://github.com/jarod), [jaydeep-pipaliya](https://github.com/jaydeep-pipaliya), [jeremyphilemon](https://github.com/jeremyphilemon), [jerilynzheng](https://github.com/jerilynzheng), [jerome-benoit](https://github.com/jerome-benoit), [jferrettiboke](https://github.com/jferrettiboke), [jlsandri](https://github.com/jlsandri), [JoanLaRosa](https://github.com/JoanLaRosa), [joaopedroassad](https://github.com/joaopedroassad), [JohnnyHBon](https://github.com/JohnnyHBon), [josh-williams](https://github.com/josh-williams), [jovanwongzixi](https://github.com/jovanwongzixi), [JulesGuesnon](https://github.com/JulesGuesnon), [Kage18](https://github.com/Kage18), [kagura-agent](https://github.com/kagura-agent), [kairosci](https://github.com/kairosci), [kaizen403](https://github.com/kaizen403), [karthik-idikuda](https://github.com/karthik-idikuda), [kimchnn](https://github.com/kimchnn), [kkawamu1](https://github.com/kkawamu1), [kkdawkins](https://github.com/kkdawkins), [leog25](https://github.com/leog25), [leothorp](https://github.com/leothorp), [liaoliaojun](https://github.com/liaoliaojun), [lihuimingxs](https://github.com/lihuimingxs), [Mahendradeokar](https://github.com/Mahendradeokar), [MarcACard](https://github.com/MarcACard), [marcusschiesser](https://github.com/marcusschiesser), [markmcd](https://github.com/markmcd), [max-programming](https://github.com/max-programming), [MaxwellCalkin](https://github.com/MaxwellCalkin), [mclenhard](https://github.com/mclenhard), [MehediH](https://github.com/MehediH), [Melkeydev](https://github.com/Melkeydev), [michael-han-dev](https://github.com/michael-han-dev), [michaelcummings12](https://github.com/michaelcummings12), [Mmartinrusso](https://github.com/Mmartinrusso), [monadoid](https://github.com/monadoid), [montyanderson](https://github.com/montyanderson), [more-by-more](https://github.com/more-by-more), [mrpaaradox](https://github.com/mrpaaradox), [msullivan](https://github.com/msullivan), [muniter](https://github.com/muniter), [muraliavarma](https://github.com/muraliavarma), [murataslan1](https://github.com/murataslan1), [mvanhorn](https://github.com/mvanhorn), [myprototypewhat](https://github.com/myprototypewhat), [Nezz](https://github.com/Nezz), [nicoloboschi](https://github.com/nicoloboschi), [nielskaspers](https://github.com/nielskaspers), [Nutlope](https://github.com/Nutlope), [nwalters512](https://github.com/nwalters512), [ohansFavour](https://github.com/ohansFavour), [ousugo](https://github.com/ousugo), [pablof7z](https://github.com/pablof7z), [Pash10g](https://github.com/Pash10g), [patrikdevlin](https://github.com/patrikdevlin), [paulelliotco](https://github.com/paulelliotco), [pavel-y-ivanov](https://github.com/pavel-y-ivanov), [PierreLeGuen](https://github.com/PierreLeGuen), [posva](https://github.com/posva), [Pranav-Wadhwa](https://github.com/Pranav-Wadhwa), [privatenumber](https://github.com/privatenumber), [quuu](https://github.com/quuu), [R-Taneja](https://github.com/R-Taneja), [raphaeleidus](https://github.com/raphaeleidus), [reynkonig](https://github.com/reynkonig), [Ricardo-M-L](https://github.com/Ricardo-M-L), [richardsolomou](https://github.com/richardsolomou), [robechun](https://github.com/robechun), [rubdos](https://github.com/rubdos), [samjbobb](https://github.com/samjbobb), [SamyPesse](https://github.com/SamyPesse), [seojcarlos](https://github.com/seojcarlos), [shaper](https://github.com/shaper), [shrey150](https://github.com/shrey150), [shubham-021](https://github.com/shubham-021), [shujanislam](https://github.com/shujanislam), [ShyamSathish005](https://github.com/ShyamSathish005), [sleitor](https://github.com/sleitor), [Subr1ata](https://github.com/Subr1ata), [syeddhasnainn](https://github.com/syeddhasnainn), [sylviezhang37](https://github.com/sylviezhang37), [szymonrybczak](https://github.com/szymonrybczak), [t-mdo](https://github.com/t-mdo), [techwraith](https://github.com/techwraith), [theQuert](https://github.com/theQuert), [thestonechat](https://github.com/thestonechat), [timvucina-soniox](https://github.com/timvucina-soniox), [tomdale](https://github.com/tomdale), [tresorama](https://github.com/tresorama), [tsuzaki430](https://github.com/tsuzaki430), [turisanapo](https://github.com/turisanapo), [Und3rf10w](https://github.com/Und3rf10w), [undo76](https://github.com/undo76), [ushiromiya-lion](https://github.com/ushiromiya-lion), [visyat](https://github.com/visyat), [wong2](https://github.com/wong2), [Xiang-CH](https://github.com/Xiang-CH), [xlianghang](https://github.com/xlianghang), [zapagenrevdale](https://github.com/zapagenrevdale), [Zawwarsami16](https://github.com/Zawwarsami16), [zirkelc](https://github.com/zirkelc), [zxuhan](https://github.com/zxuhan.).

Your feedback, bug reports, and pull requests on GitHub have been instrumental in shaping this release. We're excited to see what you'll build with these new capabilities!
