Tools / TypeScript agent development

Vercel AI SDK

sdk

Vercel's open-source TypeScript toolkit - one API across model providers, tool-calling agents, and UI hooks for chat apps.

Role TypeScript AI and agent toolkitMaintained by VercelLanguages TypeScript, JavaScriptLicense Apache-2.0First release Jun 2023

What it is

The AI SDK is Vercel's free, open-source TypeScript library for building AI-powered apps and agents. AI SDK Core gives one API for generating text, structured objects and tool calls across dozens of model providers, and AI SDK UI adds framework-agnostic hooks (React, Next.js, Vue, Svelte, Node) for streaming chat interfaces. Version 6 (December 2025) added a reusable Agent abstraction with tool approval; version 7 (June 2026) added durable WorkflowAgent and HarnessAgent, which wraps harnesses such as Claude Code or Codex behind the same interface. Vercel reports it as its fastest-growing open-source project.

How it works

You call generateText or streamText with a model id from any provider package and a set of tools, each defined with a description, a Zod input schema and an execute function. For agents, ToolLoopAgent runs the call-model, run-tools, repeat loop for you until a stop condition (stopWhen) is met, and prepareStep lets you adjust settings between steps. On the front end, hooks like useChat stream the agent's messages and tool results into your UI.

Key concepts

AI SDK Core
The unified API for generating text, structured objects and tool calls across providers.
AI SDK UI
Framework-agnostic hooks such as useChat for building streaming chat and generative interfaces.
ToolLoopAgent
The recommended agent class - an LLM that calls tools in a loop until a stopping condition is met.
stopWhen / prepareStep
Loop controls that decide when the agent stops and let you change settings between steps.
Tool approval (needsApproval)
A flag that pauses a tool call until a human approves or denies it.
WorkflowAgent
AI SDK 7's durable agent that survives process restarts, deploys and delayed approvals.

Use it when

  • You build in TypeScript/JavaScript, especially a Next.js or React front end with streaming chat.
  • You want to switch model providers by changing one string.
  • You want agents and UI from one toolkit, with optional durability via WorkflowAgent.

Look elsewhere when

  • Your stack is Python-first; Python frameworks have deeper data and ML ecosystems.
  • You need older Node.js or CommonJS-only projects - AI SDK 7 requires Node.js 22 and ESM.

Who uses it

  • Thomson Reuters

    Built CoCounsel, its AI assistant for attorneys, accountants and audit teams, with the AI SDK.

    Evidence: vercel.com

  • Clay

    Built Claygent, its AI web-research agent, with the AI SDK.

    Evidence: vercel.com

Milestones

  1. AI SDK 7 released with durable WorkflowAgent, HarnessAgent and unified telemetry (vercel.com)
  2. AI SDK 6 released with the Agent interface, ToolLoopAgent, tool approval and stable MCP support (vercel.com)
  3. AI SDK 5 released (vercel.com)

Start learning