← Back to Discover

Vercel AI SDK

Open-source TypeScript SDK from Vercel for building AI apps and agents, with one API across model providers, streaming, tool calls, structured output and UI hooks for React, Vue, Svelte and more.

Agent frameworksModel APIs

What it does

The AI SDK is a TypeScript SDK from Vercel for building AI applications and agents. It installs from npm as the ai package and is described as open source and framework agnostic, working with React, Next.js, Vue, Svelte, Node.js, Angular, Nuxt and Solid. AI SDK Core gives one API for generating text, structured objects and tool calls and for building agents. AI SDK UI adds hooks for chat and generative interfaces. Examples on the page cover text, image, speech, transcription and video generation, and switching providers takes a one-line change. Streaming and fallbacks are built in. It connects to the wider Vercel stack. The AI Gateway routes to more than 100 models through one endpoint with no markup, Vercel Sandbox runs agent-generated code, Workflows supports long-running agents that can suspend and resume, and AI Elements is a UI component library. The site also links recipes and templates, including a chatbot, a Slackbot and a SQL agent.

Capabilities

  • Unified API for text, structured objects and tool calls
  • Framework-agnostic UI hooks for chat and generative interfaces
  • Switch model providers with a one-line change
  • Built-in streaming and fallbacks
  • Image, speech, transcription and video generation
  • Works with an AI Gateway that routes to 100+ models

When to use it

  • You are adding a chat or agent feature to a TypeScript web app
  • You want to swap model providers without rewriting your integration
  • You need streaming responses and tool calling with ready-made UI hooks