ai-sdk

Build AI agents, chatbots, and text generation features using the Vercel AI SDK.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill ai-sdk-dsgalkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/dsgalkar/dnyaneshwar_portfolio/tree/main/.agents/plugins/vercel/skills/ai-sdk/upstream
Command: npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill ai-sdk-dsgalkar

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Developers working with the Vercel AI SDK often rely on outdated training knowledge, leading to deprecated API usage, type errors, and broken implementations. This Skill forces verification against current documentation and source code, ensuring correct usage of functions like generateText, streamText, ToolLoopAgent, and useChat. ## Core Features & Use Cases - Up-to-date API guidance: Searches bundled docs in node_modules/ai/docs/ and ai-sdk.dev instead of relying on stale internal knowledge. - Common error resolution: Maps deprecated patterns (maxTokens, maxSteps, parameters, generateObject) to their current replacements with corrected code examples. - Type-safe agent patterns: Provides end-to-end type safety between ToolLoopAgent definitions and useChat via InferAgentUIMessage. - Use Case: A developer building a chatbot with React asks how to stream responses; the Skill checks the installed ai package docs, applies the current useChat transport pattern, and avoids deprecated handleSubmit APIs. ## Quick Start Ask the assistant to build a streaming chat endpoint using the AI SDK with the latest Anthropic model via the Vercel AI Gateway.

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 pattern with a model, instructions, and tools defined via the tool function with inputSchema. Search node_modules/ai/docs/ for the current agent creation API, and export InferAgentUIMessage for type-safe useChat consumption.

How to fix deprecated maxSteps and maxTokens errors in the AI SDK?

Replace maxTokens with maxOutputTokens and maxSteps with stopWhen: stepCountIs(n). The common-errors reference documents these and other renames like parameters to inputSchema and generateObject to generateText with output.

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 }) instead of the deprecated handleSubmit and handleInputChange.

Which AI 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 select the model with the highest version number, such as claude-sonnet-4-5 over older variants.

How do I debug AI SDK calls locally?

Install @ai-sdk/devtools and wrap your model with devToolsMiddleware via wrapLanguageModel. All runs and steps are captured to .devtools/generations.json, which you can inspect directly or view in the web UI at localhost:4983.