vercel-ai-sdk

vercel-ai-sdk is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 59 tokens per session (3,574 once invoked), scanned A, original, MIT.

A decision guide for building AI features with the Vercel AI SDK, a TypeScript library for model calls, tools, streaming responses, and agent loops. It focuses on differences between SDK versions and common implementation traps.

In plain words
What is it for?
Use it when building or upgrading TypeScript code that uses the Vercel AI SDK, including agent loops, structured results, streaming, tool approval, and migrations between major versions.
Why use it?
SDK versions can rename functions and change result formats, so examples for the wrong version can produce broken code. The guide also covers limits, approvals for side effects, and testing without calling a real model in every test.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the frameworks-virtuoso plugin — 12 skills shipped together

Good fit Use it when building or upgrading TypeScript code that uses the Vercel AI SDK, including agent loops, structured results, streaming, tool approval, and migrations between major versions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add krzysztofsurdy/code-virtuoso --skill vercel-ai-sdk
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install frameworks-virtuoso, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vercel-ai-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk/github.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vercel-ai-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/vercel-ai-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,574 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.03574
Opus 5.5 $0.00024 $0.01430
Sonnet 5.5 $0.00012 $0.00715
Haiku 4.5 $0.00006 $0.00357

Measured 2d ago against content hash caaca753aa05, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

vercel-ai-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/frameworks/vercel/vercel-ai-sdk/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vercel AI SDK

The AI SDK ships a new major about every five to eight months, and each one renames APIs that earlier code and model memory still use. This skill therefore holds no API listings. It holds the version facts, the decisions the docs do not make for you, and the traps between majors. Fetch the current API for the installed major before writing code that calls it.

Core principles

Principle Meaning
Read the installed major first ai 5, 6, and 7 differ in names and result shapes. Docs for the wrong major mislead
Fetch, do not recall Treat any remembered import, option name, or model ID as stale until docs confirm it
Cap every loop Agents stop on conditions you set. Combine a step cap with a terminal tool
Gate side effects in code Use toolApproval for destructive tools. Do not rely on a prompt
Client history is untrusted A browser can send any message list, including tool results
Mock the model in unit tests Real-model calls belong in a small eval set, not in every test

Version matrix

Checked on 2026-10-21 against npm and Context7 /vercel/ai.

Package Current Notes
ai 7.0.148 v7.0.0 released 2026-06-25. Node 22 or later, ESM-only. Peer: zod ^3.25.76 || ^4.1.8
ai earlier majors 6.0.312 (ai-v6 tag), 5.0.279 (ai-v5 tag) v6.0.0 on 2025-12-22, v5.0.0 on 2025-07-31. Both still publish patches
@ai-sdk/react 4.0.152 Vue 4.0.148, Svelte 5.0.148. Majors follow their own numbering: ai 6 pairs with @ai-sdk/react 3, ai 5 with 2
Providers @ai-sdk/openai 4.0.99, @ai-sdk/anthropic 4.0.85, @ai-sdk/gateway 4.0.121 Install the version that matches your ai major
Add-ons @ai-sdk/mcp 2.0.81, @ai-sdk/workflow 2.0.80, @ai-sdk/otel 1.0.148 MCP client, durable WorkflowAgent, OpenTelemetry

Read what the project actually runs:

npm ls ai @ai-sdk/react --depth=0 2>/dev/null
pnpm list ai "@ai-sdk/*" --depth=0 2>/dev/null
grep -E '"(ai|@ai-sdk/[a-z-]+)"' package.json

Read the full file on GitHub · 185 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 185 lines · 59 tokens per session scan A caaca753aa05

Subscribe to this mod's changes

vercel-ai-sdk is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (36 stars, last pushed yesterday), licensed MIT. It adds 59 tokens to every session and 3,574 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-22.

Related

Other skills, from other repositories

developing-genkit-js

Develop AI-powered applications using Genkit in Node.js/TypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript/TypeScript, or when encountering Genkit errors, validation issues, type errors, or API problems.

google/skills · 60 tokens

ax-signature

This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.

ax-llm/ax · 57 tokens

ax-cpp-gepa

Use when writing C++ code with axllm for GEPA, Pareto tradeoffs, reflection clients, metric budgets, optimizer state, and artifacts.

ax-llm/ax · 39 tokens

aicore-sdk-js

Generate working TypeScript/JavaScript boilerplate for SAP GenAI Hub using @sap-ai-sdk/orchestration, @sap-ai-sdk/foundation-models, @sap-ai-sdk/openai (native OpenAI SDK), @sap-ai-sdk/langchain (LangChain), @sap-ai-sdk/document-grounding (RAG), @sap-ai-sdk/prompt-registry, @sap-ai-sdk/llm-batch (batch jobs)…

SAP/ai-skills-library · 246 tokens

qianwen-text

Generate text, have conversations, write code, reason, and call functions with Qwen models. TRIGGER when: user asks to chat with Qwen, generate text, write code with Qwen, use Qwen function calling, or explicitly invokes this skill by name (e.g. use qianwen-text). DO NOT TRIGGER when: general coding questions without…

QianWen-AI/qianwen-ai · 111 tokens

ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI…

pleaseai/claude-code-plugins · 155 tokens