Skip to content
Dashboard

The AI layer for building frameworks and agents on Vercel

Read the docs
$npm i ai
A unified TypeScript SDK for building AI apps with modern streaming, multi-model, and provider-agnostic capabilities
import { generateText } from 'ai';
const { text } = await generateText({
model: 'openai/gpt-5.6-luna',
prompt: 'Explain the concept of quantum entanglement.',
});
console.log(text);

The framework agnostic AI toolkit

AI SDK features

  • Multi-provider supportSwitch providers with one line of code.
  • Streaming that just worksReal-time responses without custom parsing.
  • Built-in fallbacksReliable production behavior by default.
  • AI Gateway compatibleRoute to any model through one endpoint.

AI SDK code examples

AI Playground

generate-text.ts

Scale with confidence

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

OpencodeOpencode
OpenCode uses AI SDK.
Dax RaadCEO & Founder, OpenCode

Build with the AI SDK today