Vercel AI SDK

Vercel AI SDK

AI-first web app toolkit

Coding Dev Framework

What it's used for

Vercel AI SDK is a TypeScript toolkit for building AI-powered web applications with streaming chat interfaces, generative UI, and tool calling. It provides React hooks and server functions that handle the complexity of streaming LLM responses to the browser.

Key use cases include:

  • Building streaming chat interfaces in Next.js, Nuxt, and SvelteKit
  • Generative UI — rendering React components streamed from the server based on LLM decisions
  • Tool calling — LLMs invoking server-side functions and returning results to the frontend
  • Multi-provider support — switch between OpenAI, Anthropic, Google, and more
  • Structured data extraction with Zod schema validation
  • Building AI features into existing web applications

The Vercel AI SDK is used by frontend and full-stack developers building AI-native web applications. It is the standard way to add AI to Next.js apps and provides the best developer experience for streaming UI patterns.

The SDK includes AI SDK Core (provider-agnostic LLM calls), AI SDK UI (React/Vue/Svelte hooks), and AI SDK RSC (React Server Components integration).

Getting started

  1. Install in your Next.js project:
    npm install ai @ai-sdk/openai
  2. Set your API key in .env.local:
    OPENAI_API_KEY=sk-...
  3. Create an API route (app/api/chat/route.ts):
    import { openai } from '@ai-sdk/openai'
    import { streamText } from 'ai'
    
    export async function POST(req: Request) {
      const { messages } = await req.json()
      const result = streamText({
        model: openai('gpt-4o'),
        messages
      })
      return result.toDataStreamResponse()
    }
  4. Use the useChat hook in your component:
    import { useChat } from 'ai/react'
    export default function Chat() {
      const { messages, input, handleSubmit, handleInputChange } = useChat()
    }

Pricing: The AI SDK is free and open source (Apache 2.0). Deploying on Vercel has its own pricing tiers. You pay only for LLM API calls.

Case studies

Real Vercel AI SDK projects

4 hours to production Market Research

Streaming AI Chat with Tool Use — Built in 4 Hours

B2B market research SaaS

Challenge

A market research SaaS needed to add a conversational AI interface supporting streaming responses, tool calls (web search, chart generation, data queries), and session history — estimated at 2 weeks of work.

Solution

Built the complete chat interface using Vercel AI SDK's useChat hook with streaming, tool call rendering, and optimistic UI. SDK abstracted the Claude API integration, streaming state, and error handling into a few hundred lines.

Results

Production-ready streaming chat with tool use shipped in 4 hours. Feature drove 34% increase in daily active users within 2 weeks of launch. NPS improved from 41 to 67.

Used Vercel AI SDK professionally?

Add your case study and get discovered by clients.

Submit a case study

Thought leaders

AI leaders using Vercel AI SDK

Follow for insights, tutorials, and thought leadership

S(

Swyx (Shawn Wang)

Latent Space / Smol AI

Editor of Latent Space, the leading AI engineering newsletter and podcast. Popularized the term 'AI Engineer.' Previously led developer tooling at AWS, Two Sigma, and three devtool unicorns (Netlify, Temporal, Airbyte). Former currency options trader. Curates the AI Engineer Summit, the top conference for AI Engineers. Founded Smol AI for LLM data pipelines.

Anthropic ClaudeOpenAILangChainVercel AI SDK
San Francisco Leader
GR

Guillermo Rauch

Vercel

Founder and CEO of Vercel, the platform behind Next.js. Created Socket.io. Under his leadership, Vercel launched the AI SDK and v0.dev, making AI a first-class citizen in web development. v0 became one of Vercel's fastest-growing products.

Vercel AI SDKv0 by Vercel
San Francisco Leader
JP

Jared Palmer

Vercel

VP of AI at Vercel, leading development of the Vercel AI SDK. Previously created Formik and TSDX. Architected the AI SDK for building streaming AI applications with React Server Components.

Vercel AI SDKv0 by Vercel
San Francisco Leader
TB

Theo Browne

T3 Chat (Ping.gg)

Creator of the T3 Stack (Next.js + tRPC + Tailwind + Prisma) and CEO of T3 Chat, a YC-backed AI chat application. Former software engineer at Twitch. YouTube channel with 500k+ subscribers covering software development and AI tools. Investor in Cursor. Known for rapid prototyping demonstrations using Cursor and modern AI tools.

CursorAnthropic ClaudeOpenAIVercel AI SDK
San Francisco Leader
GR

Guillermo Rauch

Vercel

Created Next.js and Socket.io. Built v0, Vercel's AI-powered text-to-app generator that won a 2025 Webby Award. On a mission to expand the pool of builders from 5M developers to 100M people. Started coding at age 10 in Argentina.

v0Vercel AI SDK
San Francisco Leader

Related tools in Coding

Need a Vercel AI SDK expert?

Submit a brief and we'll match you with vetted specialists who have proven Vercel AI SDK experience.

Submit a brief — it's free