AI SDK
Open-source TypeScript toolkit for adding LLMs and agents to apps through one provider-neutral API.
- Tool type
- Open-source TypeScript SDK
- Made for
- Developers
- Runs on
- Your own app code (Node.js and web frameworks)
- Runs inside your project with React, Next.js, Vue, Svelte, Node.js and similar; models are called via AI Gateway or provider APIs.
What it does
The AI SDK is a TypeScript library from Vercel. Developers pass it prompts, messages, tool definitions and files, and it returns generated text, structured objects, tool calls, images, speech or transcriptions, depending on the model used. It also includes framework-agnostic hooks for chat and generative interfaces, and a harness abstraction for running existing agent harnesses such as Claude Code or Codex.
A developer installs the ai package, picks a model by string such as an Anthropic, OpenAI or Google model ID, and calls functions like generateText inside a Next.js, React, Vue, Svelte or Node.js project. The same call works across providers, so switching models is a one-line change. By default model strings route through Vercel's AI Gateway, which offers one API key with usage and cost tracking. Alternatively, install a provider package such as @ai-sdk/anthropic for direct access to provider-specific features. Streaming and fallbacks are built in.
It suits JavaScript and TypeScript developers building chatbots, agents or AI features into web applications. It is a code library, not a no-code app. You need an AI Gateway key or each provider's own API key, and model usage is billed separately by those services. Gateway and direct providers do not expose identical features, so check support for any provider-specific option before relying on it.
What it can do
- Generate text from a single API across providers
- Produce structured objects and tool calls from model output
- Stream responses in real time
- Build chat and generative UIs with framework-agnostic hooks
- Run established agent harnesses via HarnessAgent
- Route requests through AI Gateway with usage and cost tracking
Works with
- Vercel AI Gateway
- Anthropic
- OpenAI
- Google Generative AI
- Next.js
- React
- Vue
- Svelte
- Node.js
Example workflows
- Add a text-generation call to a Next.js app
- Inputs: a prompt and a model string. Steps: install ai, set AI_GATEWAY_API_KEY, call generateText with the model and prompt. Output: generated text to display or process.
- Call a provider directly for provider-specific options
- Inputs: provider API key and prompt. Steps: install ai and @ai-sdk/anthropic, set ANTHROPIC_API_KEY, create the model with the provider instance and pass provider options. Output: a model response using features the Gateway may not expose.
Before you choose
- The SDK is free open-source code, but model calls cost money through AI Gateway or the provider you connect.
- AI Gateway does not expose every provider API; use the direct provider package for provider-specific features or custom connection settings.
- Feature support varies by model and provider, so verify options such as reasoning effort or caching for your chosen model.
Listed under
Get started
Run npm install ai, then set an AI Gateway key or a provider API key.
- Install the core package with npm install ai (pnpm, yarn or bun also work).
- Set AI_GATEWAY_API_KEY, or install a provider package like @ai-sdk/openai and set that provider's API key.
- Call generateText with a model string in your project and log or render the result.
Plans and prices
The SDK is installed via npm. Model usage is charged by AI Gateway or the chosen provider; a rate table was not confirmed.
We couldn’t find published prices for AI SDK. See their pricing page ↗
Sources for this overview
Product pages, documentation, and pricing checked 29 Oct 2026. Each source supports part of the overview; availability and prices can change.
- Anthropic | AI SDK ↗ai-sdk.dev
- OpenAI | AI SDK ↗ai-sdk.dev
- Google | AI SDK ↗ai-sdk.dev
- AI SDK ↗ai-sdk.dev
- AI SDK by Vercel | AI SDK ↗ai-sdk.dev
Ratings and reviews
No ratings for AI SDK yet.
What’s changed
Free accountSignals
Free accountData and security
Free accountCompare with similar tools
Free accountWhere this comes from
How we research- Company website
- ai-sdk.dev: product, pricing and policy pages
- YC directory mirror
- Batch and company name
- Social accounts
- Accounts the company links, and its posts on X
- Human review
- Checked by a person
- knowledge_base
Last checked 29 Oct 2026. Every field keeps its source and date; unknown means we couldn’t confirm it.