ai-sdk

Answers questions and builds AI features using the Vercel AI SDK with version-matched documentation.

1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/Lento47/arcana --skill ai-sdk-lento47
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/Lento47/arcana/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/Lento47/arcana --skill ai-sdk-lento47

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai.

What problem does it solve? Developers frequently write AI SDK code from outdated memory, producing errors because APIs, model IDs, and hooks like useChat change between versions. This Skill forces verification against the documentation bundled inside node_modules so generated code matches the actually installed version. ## Core Features & Use Cases - Version-Matched Guidance: Reads docs and source from node_modules/ai/docs and node_modules/ai/src instead of relying on training data. - Agent and App Building: Helps build agents with ToolLoopAgent, chatbots with useChat, RAG systems, structured output, tool calling, and embeddings. - AI Gateway Setup: Configures the Vercel AI Gateway for multi-provider access and fetches the current model list via the gateway API. - Use Case: A developer asks to add streaming chat to a Next.js app; the Skill checks the installed ai package version, reads its bundled docs, and generates code using the current useChat and streamText APIs. ## Quick Start Ask the agent to add a streaming chat endpoint to your app using the AI SDK and have it verify every API against the docs bundled in node_modules.

Frequently Asked Questions about ai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an AI agent with the Vercel AI SDK?▼

Use the SDK's built-in agent abstraction such as ToolLoopAgent instead of hand-rolling tool-calling loops. Check the agents section of the bundled docs at node_modules/ai/docs for the current API, since agent interfaces change between versions.

How do I use useChat with the AI SDK in React?▼

useChat is a React hook from the @ai-sdk/react package for building chat interfaces, but it is among the most frequently changed APIs. Always read the bundled docs in node_modules/@ai-sdk/react/docs for your installed version before writing client code.

What is the Vercel AI Gateway and how do I set it up?▼

The AI Gateway provides access to models from OpenAI, Anthropic, Google, and others through a single API without installing provider packages. Authenticate via OIDC or an API key set as the AI_GATEWAY_API_KEY environment variable, then reference models with provider/model strings.

Why does my AI SDK code throw type errors after upgrading?▼

Most type errors come from APIs that were renamed or removed between versions. Compare your installed version in node_modules/ai/package.json against the latest with npm view ai version, then consult the migration guides at ai-sdk.dev/docs/migration-guides.

How do I find which AI models are currently available?▼

Fetch the live model list from the AI Gateway with curl https://ai-gateway.vercel.sh/v1/models instead of using model IDs from memory. Models are released and retired frequently, so prefer the highest version number when multiple variants exist.