ai-sdk

Answers AI SDK questions and builds agents, chatbots, and streaming features with verified current APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai, @ai-sdk/react, @ai-sdk/gateway, @ai-sdk/devtools, and includes references (resource) components.

What problem does it solve? The Vercel AI SDK evolves rapidly, and outdated training data leads to deprecated APIs, wrong parameter names, and broken code. This Skill forces verification against bundled docs and source code so generated AI features actually compile and run. ## Core Features & Use Cases - Verified API Guidance: Searches node_modules/ai/docs and source code, falling back to ai-sdk.dev, instead of relying on memory. - Agent & Chatbot Building: Creates ToolLoopAgent-based agents with type-safe useChat consumption via InferAgentUIMessage. - Migration & Error Fixing: Resolves common breaking changes like maxTokens to maxOutputTokens, parameters to inputSchema, and useChat state management updates. - Use Case: A developer asks to add a streaming chatbot to a Next.js app; the Skill checks the installed ai package docs, fetches current model IDs from the Vercel AI Gateway, and generates type-safe server and client code that passes typecheck. ## Quick Start Ask the assistant to build a streaming chat endpoint using the AI SDK with the latest Anthropic model and have it verify the code against the installed package docs.

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 ToolLoopAgent class with a model, instructions, and a tools object. Search node_modules/ai/docs for current agent creation APIs, then consume the agent with useChat using InferAgentUIMessage for type-safe tool results.

How to fix deprecated AI SDK parameters like maxTokens or parameters?

Replace maxTokens with maxOutputTokens, maxSteps with stopWhen: isStepCount(n), and tool parameters with inputSchema. The common-errors reference documents each renamed property with before-and-after code examples.

Does useChat still manage input state automatically?

No, useChat no longer manages input state internally. You must manage input with useState, configure a DefaultChatTransport, and call sendMessage({ text: input }) on submit.

Which model ID should I use with the AI SDK?

Never use model IDs from memory. Fetch the current list with curl https://ai-gateway.vercel.sh/v1/models filtered by provider, and pick the highest version number, such as claude-sonnet-4.5 over claude-sonnet-4.

Why does my AI SDK code fail typecheck after upgrading?

Type errors usually come from renamed APIs documented in the common-errors reference, such as toDataStreamResponse becoming toUIMessageStreamResponse or tool-invocation parts becoming typed tool-{toolName} parts. Grep that file for the failing property before searching source.