ai-sdk-core
Build backend AI with Vercel AI SDK v6 stable. Covers Output API (replaces generateObject/streamObject), speech synthesis, transcription, embeddings, MCP tools with security guidance. Includes v4→v5 migration and 15 error solutions with workarounds. Use when: implementing AI SDK v5/v6, migrating versions, troubleshooting AI_APICallError, Workers startup issues, Output API errors, Gemini caching issues, Anthropic tool errors, MCP tools, or stream resumption failures.
npx skills add majiayu000/claude-skill-registry --skill ai-sdk-core-brendadeeznuts1111-tier-1380-omega --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides backend AI development with Vercel AI SDK v5 and v6, covering installation, Output API usage (replacing generateObject/streamObject), speech, transcription, embeddings, MCP tools with security guidance, and migration from v4 to v5 alongside error solutions.
How it works
- Describes installation: run npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google zod.
- Documents the Output API: using generateText with Output.object/array/choice/text/json, and streaming via streamText with object streams and final object access.
- Introduces v6 features: AgentLoopAgent, ToolExecution with optional human-in-the-loop approval, MCP tools (experimental_createMCPClient) with security notes, static tool generation workflow, and notes on MCP streaming limitations.
- Shows usage for other capabilities: language model middleware, OpenTelemetry telemetry, speech synthesis (generateSpeech), transcription, image generation, embeddings, multi-modal prompts, and v5/v6 migration caveats.
- Lists compatibility notes: workers-ai-provider version requirements, zod versions, and startup fixes for Cloudflare Workers.
- Details v5 tool-calling changes (inputSchema, input/output renames) and v4→v5 migration steps.
When to use it
Use when implementing AI SDK v5/v6, migrating versions, troubleshooting AI_APICallError, Workers startup issues, Output API errors, Gemini caching issues, Anthropic tool errors, MCP tools, or stream resumption failures.
What it can touch
- Tool definitions and execution flows via ToolLoopAgent, agent class, and tool abstractions.
- MCP client via experimental_createMCPClient and tools().
- Generation APIs: generateText, streamText, generateSpeech, transcribe, generateImage, embed, embedMany.
- Telemetry via experimental_telemetry.
- Environment and runtime with npm packages and Zod schemas.
Caveats
- MCP tools carry significant production risks; security guidance emphasizes static, versioned tool definitions rather than dynamic tools.
- Dynamic MCP tools may not stream correctly; use generateText() for MCP tooling.
- Breaking changes from v4 to v5 include parameter and naming changes (maxTokens to maxOutputTokens, parameters to inputSchema, etc.).
- Output API replaces legacy generateObject/streamObject and introduces new Output APIs.
- Some sections reference external docs and security considerations; follow those sources for deeper guidance.
# AI SDK Core Backend AI with Vercel AI SDK v5 and v6. **Installation:** ```bash npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google zod ``` --- ## AI SDK 6 (Stable - January 2026) **Status:** Stable **Latest:** ai@6.0.26 (Jan 2026) ### BREAKING: Output API Replaces generateObject/streamObject ⚠️ **CRITICAL**: `generateObject()` and `streamObject()` are **DEPRECATED** and will be removed in a future version. Use the new Output API instead. **Before (v5 - DEPRECATED):** ```typescript // ❌ DEPRECATED - will be removed import { generateObject } from 'ai'; const result = await generateObject({ model: openai('gpt-5'), schema: z.object({ name: z.string(), age: z.number() }), prompt: 'Generate a person', }); ``` **After (v6 - USE THIS):** ```typescript // ✅ NEW OUTPUT API import { generateText, Output } from 'ai'; const result = await generateText({ model: openai('gpt-5'), output: Output.object({ schema: z.object({ name: z.string(), age: z.number() }) }), prompt: 'Generate a person', }); // Access the typed object console.log(result.object); // { name: "Alice", age: 30 } ``` ### Output Types ```typescript import { generateText, Output } from 'ai'; // Object with Zod schema outp
- AI SDK 6 (Stable - January 2026)
- BREAKING: Output API Replaces generateObject/streamObject
- Output Types
- Streaming with Output API
- v6 New Features
- Latest AI Models (2025-2026)
- OpenAI
- Anthropic
- Core Functions
- Text Generation
- Structured Output (v6 Output API)
- Multi-Modal Capabilities
- v5 Stream Response Methods
npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google zod npm install ai@^5.0.0 workers-ai-provider@^2.0.0 zod@^3.25.0 npm install ai@^4.0.0 workers-ai-provider@^2.0.0 npx ai migrate npm view ai version npm view ai dist-tags
What does the ai-sdk-core skill do?
Build backend AI with Vercel AI SDK v6 stable. Covers Output API (replaces generateObject/streamObject), speech synthesis, transcription, embeddings, MCP tools with security guidance. Includes v4→v5 migration and 15 error solutions with workarounds. Use when: implementing AI SDK v5/v6, migrating versions, troubleshooting AI_APICallError, Workers startup issues, Output API errors, Gemini caching issues, Anthropic tool errors, MCP tools, or stream resumption failures.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill ai-sdk-core-brendadeeznuts1111-tier-1380-omega --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
