vercel-ai-sdk

vercel-ai-sdk is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (528 once invoked), scanned A, original, MIT.

A TypeScript toolkit guide explains how to build applications and agents that use AI models from several providers. It also covers streamed responses, tool calls, and structured JSON output.

In plain words
What is it for?
It helps build chat endpoints, streaming interfaces, multi-step agent actions, and AI features backed by schema-checked output.
Why use it?
It reduces the need to learn a different interface for each AI provider and helps keep generated data in an expected shape.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps build chat endpoints, streaming interfaces, multi-step agent actions, and AI features backed by schema-checked output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/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 ashish7802/awesome-api-skills --skill vercel-ai-sdk
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

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/ashish7802/awesome-api-skills/vercel-ai-sdk/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/vercel-ai-sdk)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/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/ashish7802/awesome-api-skills/vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/vercel-ai-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 528 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.00000 $0.00528
Opus 5.5 $0.00000 $0.00211
Sonnet 5.5 $0.00000 $0.00106
Haiku 4.5 $0.00000 $0.00053

Measured yesterday against content hash 41179fe73f40, 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (examples/stream-text.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/vercel-ai-sdk/SKILL.md · 40 lines

How it starts

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

Vercel AI SDK Skill

Overview

The Vercel AI SDK (ai) is the standard TypeScript toolkit for building AI applications, agents, and streaming user interfaces across OpenAI, Anthropic, Google Gemini, DeepSeek, and Groq using a unified provider architecture.

Installation

npm install ai zod @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google

Authentication

Each model provider loads its corresponding environment variable automatically on the server:

  • OPENAI_API_KEY for @ai-sdk/openai
  • ANTHROPIC_API_KEY for @ai-sdk/anthropic
  • GOOGLE_GENERATIVE_AI_API_KEY for @ai-sdk/google

Core Concepts

  • generateText / streamText: Unified text generation and token streaming with multi-step tool calling (maxSteps).
  • generateObject / streamObject: Deterministic structured JSON generation validated against a zod schema.
  • useChat / useCompletion: React hooks for streaming UI states and tool invocations.

Common Workflows

  1. Define a route handler /api/chat using streamText.
  2. Configure tools with zod parameter schemas and execute async handlers.
  3. Return result.toDataStreamResponse() to stream text and tool calls to the frontend.

AI Pitfalls

  • Hallucinating v2/v3 APIs: Never import OpenAIStream or StreamingTextResponse. Those were removed in AI SDK v4. Always use streamText and result.toDataStreamResponse().
  • Missing maxSteps on agentic loops: When tools have an execute function, set maxSteps: 5 on streamText so the SDK automatically feeds tool outputs back to the model.
  • Unvalidated JSON: Use generateObject({ model, schema: z.object(...) }) rather than regex-parsing markdown code blocks.

Production Checklist

  • Using ai v4+ core primitives (streamText, generateObject)
  • Provider packages (@ai-sdk/openai, @ai-sdk/anthropic) installed and configured server-side
  • Route handlers return result.toDataStreamResponse()
  • maxDuration exported in serverless route files to prevent timeout on long streams

Read the full file on GitHub · 40 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 40 lines · 0 tokens per session scan A 41179fe73f40

Subscribe to this mod's changes

vercel-ai-sdk is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 528 tokens. 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

cost-aware-llm-pipeline

A planning guide for choosing language models and managing the amount of conversation context used by an AI coding workflow. It groups tasks by complexity and gives rules for avoiding context overflow during long sessions.

hashgraph-online/awesome-codex-plugins · 42 tokens

natural

Render the provided prompt template with Jinja context and send it to the active NPC's LLM. The rendered text becomes the user prompt; the LLM response is placed in context['output'].

NPC-Worldwide/npcpy · 41 tokens

awesome-chatgpt

Search this repository's awesome-ChatGPT-repositories list for open-source ChatGPT and LLM projects such as RAG frameworks, agents, chatbots, CLIs, prompts, and browser extensions. Use when the user asks to find tools, libraries, or repos related to ChatGPT, LLMs, or AI development; not for editing or adding list…

taishi-i/awesome-ChatGPT-repositories · 79 tokens

llm-integration

LLM integration patterns for function calling, streaming responses, local inference with Ollama, and fine-tuning customization. Use when implementing tool use, SSE streaming, local model deployment, LoRA/QLoRA fine-tuning, or multi-provider LLM APIs.

yonatangross/orchestkit · 58 tokens

happyhorse-prompter

A tool for writing short prompts for HappyHorse 1.0, an AI video generator that can create video with sound. Its prompts put the main subject first, specify the camera, and describe audible sound when needed.

cclank/lanshu-awesome-ai-video-kit · 116 tokens

kling-prompter

A prompt-writing guide for Kling 3.0, a video-generation model. It covers short videos, story-driven videos with dialogue or sound, and animating an existing reference image.

cclank/lanshu-awesome-ai-video-kit · 162 tokens