Universal AI layer for every app
One SDK for building AI features, agents, and apps — with streaming, structured output, tools, and fallbacks across every major provider.
Works with every major provider
import { generateText } from 'ai-toolkit';
const { text } = await generateText({
model: 'openai/gpt-4o',
prompt: 'Explain the concept of quantum entanglement.',
});
console.log(text);18.3M
Weekly downloads
26.3K
GitHub stars
695+
Contributors
100+
Models supported
Explore
Everything you need to ship AI
Start from a recipe, wire in a tool, or fork a template. Then see what the community has built.
Recipes
Build AI features faster
Focused MDX recipes with runnable examples. Structured extraction, durable agents, RAG, and more.
85 recipes
Tools Registry
Give your agent superpowers
Community-built tools that add web search, extraction, code execution, and more. Install, define a schema, ship.
13 tools
AI Gateways
One API, every model
Gateways that unify hundreds of models behind a single integration — with routing, fallbacks, caching, and observability.
8 gateways
Playground
Compare models side-by-side
Tune prompts across models in real time, compare cost and latency, and export production-ready AI Toolkit code.
Try it on Studio
Templates
Start from a real app
Official app templates, examples, and framework integrations with the right primitives already wired up.
21 templates
Showcase
See what people are shipping
Popular products and projects built with the AI SDK — proof and inspiration for your next build.
12 projects
Featured recipes
Build with AI TOOLKIT today
FAQ
Questions, answered
Everything you need to know before you start building.
AI TOOLKIT is an open-source TypeScript SDK for building AI apps and agents. It gives you one unified interface for streaming, structured output, tools, fallbacks, and multi-model support across every major provider and framework.
Get started
Build with AI TOOLKIT today
Get started with the AI TOOLKIT by using our recipes or templates, or install the core package in seconds.
Install
$ npm install ai