ai-sdk

Guide Vercel AI SDK v5 to v6 migrations and integration patterns.

1|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/Moisesjr20/gueclaw --skill ai-sdk-moisesjr20
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/Moisesjr20/gueclaw/tree/main/.agents/skills/ai-sdk
Command: npx skills add https://github.com/Moisesjr20/gueclaw --skill ai-sdk-moisesjr20

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides authoritative, up-to-date guidance for implementing and migrating AI features using the Vercel AI SDK so developers avoid deprecated APIs, incorrect patterns, and insecure provider usage.

Core Features & Use Cases

  • Migration guidance: Convert v5 patterns (generateObject, toDataStreamResponse, parameters) to v6 equivalents (generateText + Output.object, toUIMessageStreamResponse, inputSchema).
  • Integration patterns: Authoritative examples for building chat interfaces, streaming responses, structured output, tool calling, ToolLoopAgent agents, embeddings, reranking, and image generation with the Vercel AI Gateway.
  • Diagnostics & safety: Validation rules, upgrade recommendations, and guidance to route provider calls through the AI Gateway for auth, failover, and observability.
  • Use Case: Migrate a legacy chat API that imports openai directly to a production-ready v6 implementation using DefaultChatTransport, Output schemas, and the gateway provider.

Quick Start

Use the ai-sdk skill to migrate your project's useChat implementation to the v6 transport pattern and route models through 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 migrate deprecated Vercel AI SDK v5 patterns to v6?

Migrate Vercel AI SDK v5 patterns by converting generateObject to generateText with Output.object, updating toDataStreamResponse to toUIMessageStreamResponse, and replacing parameters with inputSchema for v6 usage.

What is the best way to implement streaming chat with Vercel AI SDK?

Implement streaming chat using the v6 transport pattern with DefaultChatTransport and useChat hooks to handle streaming responses through API routes efficiently.

Does Vercel AI SDK support building agents with tool calling?

Vercel AI SDK supports building agents with tool calling through ToolLoopAgent patterns and inputSchema definitions to structure and execute tool interactions.

How do I route provider calls through the Vercel AI Gateway?

Route provider calls through the Vercel AI Gateway to centralize authentication, enable provider failover, and add observability for model routing across AI features.

Why should I use Vercel AI Gateway instead of importing OpenAI directly?

Use the Vercel AI Gateway instead of importing OpenAI directly to gain built-in auth, failover capabilities, observability, and secure model routing for production environments.

Can I generate structured output with Vercel AI SDK?

Generate structured output with Vercel AI SDK using the Output.object schema alongside generateText to return typed, structured data from your model calls.