ai-sdk

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

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/NarixHine/uni-chem --skill ai-sdk-narixhine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/NarixHine/uni-chem/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/NarixHine/uni-chem --skill ai-sdk-narixhine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers frequently write outdated AI SDK code from memory because the SDK's APIs change rapidly across versions, causing type errors and broken implementations. This Skill enforces verification against version-matched bundled documentation before writing any AI SDK code. ## Core Features & Use Cases - Version-Matched Documentation Lookup: Reads bundled docs and source from node_modules/ai/docs and node_modules/ai/src to guarantee API accuracy for the installed version. - AI Gateway Setup Guidance: Walks through Vercel AI Gateway authentication, AI_GATEWAY_API_KEY configuration, and fetching current model IDs via the gateway API. - Agent and App Building: Guides building agents with ToolLoopAgent, tool calling, structured output, embeddings, and React hooks like useChat with end-to-end type safety. - Use Case: A developer asks to add a streaming chatbot to a Next.js app. The Skill checks the installed ai package version, reads the bundled useChat docs, fetches current model IDs, and generates code that compiles against the actual installed SDK. ## Quick Start Ask the assistant to build a streaming chat endpoint with the AI SDK and have it verify every API against the bundled docs in node_modules before writing code.

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 rather than hand-rolling tool-calling loops. Check the bundled docs in node_modules/ai/docs for the current agent API, then consume the agent on the client with useChat for end-to-end type safety.

How do I set up the Vercel AI Gateway with the AI SDK?▼

Authenticate with OIDC on Vercel or obtain an AI Gateway API key, then set it as the AI_GATEWAY_API_KEY environment variable. Reference models with provider/model strings without installing separate provider packages.

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

The AI SDK renames and removes APIs frequently across versions, so code written from memory often breaks. Compare your installed version in node_modules/ai/package.json against npm view ai version, and consult the migration guides at ai-sdk.dev/docs/migration-guides.

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

Yes, the AI SDK provides a unified API across providers including OpenAI, Anthropic, and Google. The Vercel AI Gateway gives access to all of them through a single API key, or you can install individual provider packages like @ai-sdk/openai.

How do I find current 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 relying on memorized model IDs. Models are released and retired frequently, so never truncate the list when searching for the newest versions.