ai
The AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents
What is ai?
The AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents
Overview of ai
What it is
The AI SDK is a provider-agnostic TypeScript toolkit for building AI-powered applications and agents. It is created by Vercel, the creators of Next.js, and is described as a free open-source library. It supports popular UI frameworks such as Next.js, React, Svelte, Vue, and Angular, as well as runtimes like Node.js.
Key features
- Provider-agnostic unified API for interacting with model providers including OpenAI, Anthropic, Google, and more.
- Can use the Vercel AI Gateway by default or connect directly via provider SDK packages like @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/google.
- Includes functions for generating text (
generateText), generating structured data (generateTextwithOutput.objectand Zod schemas), and building agents (ToolLoopAgent). - Provides UI integration hooks (e.g.,
@ai-sdk/react) for building chatbots and generative user interfaces, compatible with Next.js, React, Svelte, and Vue. - Offers templates for different use cases, providers, and frameworks.
- Supports a skill for coding agents via
npx skills add vercel/ai.
Use cases
Building AI-powered applications and agents, creating chatbots, generating structured data (e.g., recipes), implementing agents with tool access (e.g., shell environment), and building generative user interfaces with image generation capabilities.
Getting started
shell npm install ai Requires Node.js 22+ and npm (or another package manager). For coding agents, you can add the AI SDK skill: shell npx skills add vercel/ai
License and pricing
The AI SDK is described as a free open-source library. The license is not stated in the README (metadata shows NOASSERTION).
Based on the project's public README and repository metadata.