Skip to content

The AI layer for building frameworks and agents on Vercel

A unified TypeScript SDK for building AI apps with modern streaming, multi-model, and provider-agnostic capabilities

See Docs
npm i ai
import { generateText } from 'ai';
const { text } = await generateText({
model: 'openai/gpt-5.5',
prompt: 'Explain the concept of quantum entanglement.',
});
console.log(text);

The Framework Agnostic AI Toolkit

The open-source AI toolkit designed to help developers build AI-powered applications and agents with React, Next.js, Vue, Svelte, Node.js, and more.

Multi-provider support. Switch providers with one line of code.
Streaming that just works. Real-time responses without custom parsing.
Built-in fallbacks.
Reliable production behavior by default.
Run it with
import { generateText } from 'ai';
const { text } = await generateText({
model: 'openai/gpt-5.5',
prompt: 'Explain the concept of quantum entanglement.',
});
console.log(text);
Go to playground

Supports

Scale with confidence

Plug the AI SDK into an entire ecosystem designed for the way modern AI applications that scale.

Vercel AI Gateway

Access 100+ models with no markup or having to manage multiple API keys.

npm i ai

Vercel Sandbox

Run agent generated code securely and at scale.

npm i @vercel/sandbox

Workflows New

Build long running AI agents and apps that can suspend, resume, and survive function timeouts.

npm i workflow

AI Elements

A UI component library and custom registry built to build AI-native applications faster.

npx ai-elements
We built a full AI agent with 40+ tools, resumable streams, and multi-step reasoning on AI SDK. Every hard problem we'd solved with duct tape before, streaming, tool call repair, message management, tool based UI, they already had a clean API for. It feels like their team hit every wall we did, just before us.
Adir DuchanSenior AI Engineer
ElementorLogotypeElementorLogotype
OpenCode uses AI SDK.
Dax RaadCEO & Founder, OpenCode
OpencodeOpencode

Build with the AiSdkAiSdk today

Get started with the AI SDK by using our cookbooks or templates.

Chatbot Starter Template

Learn how to build a full-featured AI chatbot with persistence, multi-modal chat, and more.

Copy install prompt

Build a Slackbot Agent

Learn how to build a Slackbot that responds to direct messages and mentions in channels.

Copy install prompt

Build a SQL Agent

Learn how to build an app that interacts with a PostgreSQL database using natural language.

Copy install prompt