The AI SDK is a provider-agnostic TypeScript library for building AI-powered applications and agents with popular UI frameworks and Node.js runtimes.
Overview
The AI SDK is a free open-source library from the Vercel and Next.js team for building AI-powered applications and agents in TypeScript. It targets popular UI frameworks such as Next.js, React, Svelte, Vue, and Angular, and runtimes like Node.js.
It provides a unified API to interact with model providers including OpenAI, Anthropic, Google, and others. By default it can use the Vercel AI Gateway, or you can connect to providers directly with their SDK packages using a model string.
Core capabilities include generating text, generating structured data, building agents, and UI integration. The AI SDK UI module offers framework-agnostic hooks for chatbots and generative user interfaces, with separate packages per framework.
Templates are available for different use cases, providers, and frameworks. Documentation covers API reference, agents, and UI integration patterns.
Key features
- Unified provider API
- Vercel AI Gateway support
- Text and structured output
- Agent building
- UI hooks for chat and generative UI
- Framework packages for Next.js, React, Svelte, Vue
- Starter templates
- Direct provider SDK packages
Use cases
- AI chatbots in web apps
- Generative user interfaces
- Multi-provider LLM apps
- Agent workflows
- Structured data from models