ai-sdk

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

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/dhanushreddy291/durable-workflow-on-neon-functions --skill ai-sdk-dhanushreddy291
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/dhanushreddy291/durable-workflow-on-neon-functions/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/dhanushreddy291/durable-workflow-on-neon-functions --skill ai-sdk-dhanushreddy291

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? The Vercel AI SDK changes rapidly across versions, so code written from memory often uses renamed, removed, or deprecated APIs. This Skill forces verification against the documentation bundled inside the installed ai package, eliminating errors caused by outdated knowledge of functions like generateText, streamText, ToolLoopAgent, and useChat. ## Core Features & Use Cases - Version-Matched Guidance: Reads docs and source from node_modules/ai/docs/ and node_modules/ai/src/ so every answer matches the actually installed SDK version. - Agent and App Building: Helps build agents, chatbots, RAG systems, tool calling, structured output, and embeddings using the SDK's built-in abstractions like ToolLoopAgent. - AI Gateway Setup: Guides setup of the Vercel AI Gateway for multi-provider model access and fetches the current model list instead of relying on memorized model IDs. - Use Case: A developer asks to add a streaming chatbot with tool calling to a Next.js app; the Skill checks the installed SDK version, reads the bundled useChat and agent docs, and produces code that compiles against that exact version. ## Quick Start Ask the assistant to build a streaming chat endpoint with tool calling using the AI SDK version installed in this project.

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 in node_modules/ai/docs/ for the current API, since agent interfaces change between versions.

How do I use generateText and streamText in the AI SDK?▼

generateText and streamText are core AI SDK functions for text generation, but their options change across versions. Read the bundled documentation at node_modules/ai/docs/ or append .md to pages at ai-sdk.dev/docs to verify the exact signatures for your installed version.

Does the AI SDK support OpenAI, Anthropic, and Google models?▼

Yes, the AI SDK provides a unified API across providers including OpenAI, Anthropic, and Google, either through provider packages like @ai-sdk/openai or through the Vercel AI Gateway. The Gateway lets you reference models with provider/model strings using a single API key.

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, especially UI hooks like useChat. Compare your installed version in node_modules/ai/package.json against npm view ai version, then consult the migration guides at ai-sdk.dev/docs/migration-guides.

How do I get the current list of available AI models?▼

Fetch the model list from the AI Gateway with curl -s https://ai-gateway.vercel.sh/v1/models and extract IDs with jq. Never use model IDs from memory, since models are released and retired frequently.