ai-sdk

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

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/kausthubh-coder/kriyan-web --skill ai-sdk-kausthubh-coder
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/kausthubh-coder/kriyan-web/tree/main/.cursor/skills/ai-sdk
Command: npx skills add https://github.com/kausthubh-coder/kriyan-web --skill ai-sdk-kausthubh-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ai, and includes references (resource) components.

What problem does it solve? AI SDK documentation in training data is outdated, leading to deprecated APIs, wrong parameter names, and broken code. This Skill forces verification against bundled docs and source code so generated AI features use current, correct APIs. ## Core Features & Use Cases - Verified API Usage: Searches node_modules/ai/docs and source code before writing code, never relying on memory for functions like generateText, streamText, or ToolLoopAgent. - Migration Guidance: Resolves common breaking changes such as maxTokens to maxOutputTokens, parameters to inputSchema, and the reworked useChat hook via the common-errors reference. - Type-Safe Agents: Builds end-to-end type-safe agents using InferAgentUIMessage with useChat, typed tool parts, and per-tool UI components. - Use Case: A developer asks to add a streaming chatbot with tool calling to a Next.js app; the Skill checks the installed ai package docs, fetches current model IDs from the Vercel AI Gateway, and produces type-safe server and client code that passes typecheck. ## Quick Start Ask the assistant to build an AI agent or chat feature with the AI SDK and let it verify the current APIs from the installed package docs 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 ToolLoopAgent class with a model, instructions, and a tools object. Search node_modules/ai/docs for the current agent creation API, then consume the agent with useChat using InferAgentUIMessage for type-safe tool results.

How to fix useChat breaking changes in AI SDK 6?▼

useChat no longer manages input state or accepts an api option. Manage input with useState, pass a DefaultChatTransport instance as transport, and submit messages with sendMessage instead of handleSubmit.

Does the AI SDK support structured output without generateObject?▼

Yes, generateObject is deprecated. Use generateText with the output option, such as Output.object with a Zod schema, Output.array, Output.choice, or Output.json for typed structured results.

Which model ID should I use with the AI SDK?▼

Never use model IDs from memory since they become outdated. Fetch the live list from https://ai-gateway.vercel.sh/v1/models, filter by provider prefix, and pick the highest version number available.

Why does my AI SDK code fail typecheck after upgrading?▼

Most failures come from renamed APIs like maxTokens to maxOutputTokens, parameters to inputSchema, or tool-invocation to typed tool parts. Grep the common-errors reference for the failing property before searching source code.