AI
Vercel AI SDK icon

Vercel AI SDK

One TypeScript API for streaming chat/completions across providers, plus ready-made React hooks so you're not wiring SSE by hand.

What is Vercel AI SDK?

The Vercel AI SDK is a TypeScript library for building AI-powered features, chat interfaces, streaming completions, tool calling, structured output, without writing separate integration code for every model provider. It abstracts over OpenAI, Anthropic, Google, and most other major providers behind one consistent API, plus ships React (and other framework) hooks that handle streaming state so you're not manually parsing server-sent events.

Key features

  • One unified API across many LLM providers, so switching models is mostly a config change, not a rewrite
  • useChat and similar React hooks manage streaming, message state, and loading states out of the box
  • Structured output generation with schema validation, useful for getting reliable JSON back from a model instead of parsing free text
  • Built-in tool calling support for building agents that can call functions and use external data
  • Works well with, but isn't limited to, Next.js and Vercel's own hosting

Who it's for

Any TypeScript app adding LLM-powered features, especially ones that want to stay flexible about which model or provider they use over time. If you're deeply committed to one provider's own SDK for advanced features it doesn't abstract well, a direct integration might still be worth it in places.

Pricing

The SDK itself is free and open source. You pay your model provider directly for API usage, the SDK doesn't add its own cost layer.