ai-sdk

Answers questions and builds AI features using the Vercel AI SDK documentation.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/jeje-it/template-projet --skill ai-sdk-jeje-it
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/jeje-it/template-projet/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/jeje-it/template-projet --skill ai-sdk-jeje-it

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? The Vercel AI SDK changes rapidly across versions, so code written from memory often uses outdated or removed APIs. This Skill grounds every answer in the version-matched documentation bundled inside node_modules, eliminating hallucinated APIs and deprecated patterns when building AI features. ## Core Features & Use Cases - Version-Matched Guidance: Reads the bundled docs at node_modules/ai/docs/ and source code so answers always match the installed SDK version. - Agent and App Building: Helps implement agents with ToolLoopAgent, tool calling, structured output, embeddings, and React hooks like useChat. - AI Gateway Setup: Guides configuration of the Vercel AI Gateway for multi-provider model access and fetches current model IDs instead of relying on memory. - Use Case: A developer asks to add a streaming chatbot to a React app; the Skill checks the installed ai package docs, verifies the current useChat API, and produces working, version-accurate code. ## Quick Start Ask the assistant to build a streaming chat endpoint with the AI SDK and have it verify every API against the bundled documentation first.

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 to add streaming text generation to a React app?▼

Use streamText on the server and the useChat hook from @ai-sdk/react on the client. Always verify the hook's current API in the bundled framework package docs, because useChat is among the most frequently changed APIs in the SDK.

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.

Does the AI SDK support multiple providers like OpenAI and Anthropic?▼

Yes, the AI SDK provides a unified API across providers through dedicated packages like @ai-sdk/openai, or through the AI Gateway for multi-provider access. Each provider package bundles its own docs at node_modules/@ai-sdk/<name>/docs/.

Why does my AI SDK code fail with 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 current available model IDs for the AI SDK?▼

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