vercel-ai-sdk
Use when integrating AI/LLM features with the Vercel AI SDK — streaming responses, tool calling, multi-provider support, or building chat interfaces. Also use when building AI-powered features in Next.js or React applications.
| Model | Source |
|---|---|
| sonnet | pack: ai |
Full Reference
┏━ 🔧 vercel-ai-sdk ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when integrating AI/LLM features with the … ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Vercel AI SDK
Section titled “Vercel AI SDK”SDK version 6.x (2026). Package ai with provider adapters (@ai-sdk/anthropic, @ai-sdk/openai, @ai-sdk/google, etc.) and React hooks via @ai-sdk/react. Providers auto-read their env vars — no explicit initialization config needed for basic use.
Quick Reference
Section titled “Quick Reference”| Fact | Value |
|---|---|
| Install | npm install ai @ai-sdk/anthropic @ai-sdk/openai @ai-sdk/google @ai-sdk/react |
| Docs | https://ai-sdk.dev |
| Anthropic env var | ANTHROPIC_API_KEY |
| OpenAI env var | OPENAI_API_KEY |
| Google env var | GOOGLE_GENERATIVE_AI_API_KEY |
| Deprecated | generateObject, streamObject — use Output.* API instead |
| v6 breaking change | useChat requires DefaultChatTransport; sendMessage({ text }) replaces handleSubmit; isLoading removed |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Install, set env vars, and set up a route handler | reference/setup.md |
| Stream text or handle full stream events | reference/streaming.md |
| Call tools, run multi-step agents, or render tool UI | reference/tool-use.md |
| Generate structured output with Output.object(), arrays, or classification | reference/structured-output.md |
| Build a chat UI with useChat or useCompletion | reference/chat-ui.md |
| Configure multiple providers, custom aliases, or edge runtime | reference/provider-config.md |
| Handle errors, catch by type, or retry with backoff | reference/error-handling.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.