Skip to content
Docs

AI SDK

The unified TypeScript SDK for building AI apps with modern streaming, fallbacks, and multi-model support.

Back to Knowledge Base

Build with AI SDK 7

Add skills to your AI SDK agents

Use uploadSkill and provider references in the AI SDK to bundle a SKILL.md and supporting files, then attach the skill to generateText, streamText, or a ToolLoopAgent call on Anthropic or OpenAI.

Upload provider files with AI SDK

Use uploadFile in the AI SDK to upload an image, PDF, or document to a provider, get a ProviderReference, and reference it in generateText and streamText messages, including across multiple providers.

Add MCP Apps to your AI SDK application

Build an MCP Apps host with the AI SDK using @ai-sdk/mcp and @ai-sdk/react to filter model-visible tools, read ui:// resources, and render interactive tool UIs in a sandboxed iframe with experimental_MCPAppRenderer.

Pass state to AI SDK tools and agents with context

Use runtimeContext, toolsContext, and contextSchema in the AI SDK to pass tenant data, credentials, and other server-side state through a generation or agent loop without putting it in the prompt.

Run your AI SDK agent in the terminal

Use the @ai-sdk/tui package and runAgentTUI to run a ToolLoopAgent in an interactive terminal, with tool cards, reasoning, response statistics, and tool approval prompts.

Generate videos with AI SDK

Use experimental_generateVideo in the AI SDK to generate videos from a text prompt or an image, set aspect ratio, resolution, duration, FPS, and seed, and handle long-running generation with timeouts and polling.

How to migrate from DurableAgent to WorkflowAgent

Switch your app from DurableAgent (@workflow/ai) to WorkflowAgent (@ai-sdk/workflow) by updating imports, stream output, message conversion, stop conditions, tool approval, and context.

Investigate GitHub issues with HarnessAgent and Vercel Sandbox

Use HarnessAgent to run coding agent harness like Claude Code or Codex against untrusted code inside Vercel Sandbox. Reproduce GitHub issues with agent harness and generate report for the maintainer.