Skip to content
Back to skills

Working With Vercel Ai Sdk

ASecurity

Use when working with the Vercel AI SDK (the `ai` package) — generateText, streamText, generateObject, streamObject, embeddings, tools/tool-calling, agents (ToolLoopAgent), AI SDK UI hooks (useChat, useCompletion), RSC, providers (OpenAI/Anthropic/Google/AI Gateway), and migrations. Provides comprehensive offline documentation fetched from ai-sdk.dev.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 13, 2026
ai-agentsgoreactnextjsnodegitapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 13, 2026

npx -y skills add joeblackwaslike/agent-skills --skill working-with-vercel-ai-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Working With Vercel Ai Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Working With Vercel Ai Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joeblackwaslike-working-with-vercel-ai-sdk/badge)](https://www.skillsdirectory.com/skills/joeblackwaslike-working-with-vercel-ai-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: working-with-vercel-ai-sdk
description: Use when working with the Vercel AI SDK (the `ai` package) — generateText, streamText, generateObject, streamObject, embeddings, tools/tool-calling, agents (ToolLoopAgent), AI SDK UI hooks (useChat, useCompletion), RSC, providers (OpenAI/Anthropic/Google/AI Gateway), and migrations. Provides comprehensive offline documentation fetched from ai-sdk.dev.
metadata:
  last_updated: "2026-06-11"
---

# Working with the Vercel AI SDK

Comprehensive offline documentation for the [Vercel AI SDK](https://ai-sdk.dev) (`ai` package), fetched verbatim from ai-sdk.dev and stored in [`references/`](references/). Use these files instead of guessing the API from memory.

## How to use this skill

1. **Read the bundled `references/` first.** Files are named by their doc path, with `/` replaced by `__` — e.g. `https://ai-sdk.dev/docs/ai-sdk-core/generating-text` → `references/docs__ai-sdk-core__generating-text.md`. Each file carries `source`/`fetched_at`/`sha256` frontmatter so you know exactly which page and when it was fetched.
2. **If something looks stale or missing**, fetch the live Markdown — append `.md` to any ai-sdk.dev page URL (e.g. `https://ai-sdk.dev/docs/agents/overview.md`) — or query the docs search API: `https://ai-sdk.dev/api/search-docs?q=your+query` (append `.md` to returned URLs).
3. **`grep` the `references/` directory** by topic (`generateText`, `useChat`, `ToolLoopAgent`, a provider name, an error message) to find the right page fast.

## Behavioral guidance (when writing AI SDK code)

- **Never rely on memory for model IDs.** Provider model identifiers change often. Fetch the current list before writing provider code — e.g. the relevant `references/providers__*.md` page, or the live provider doc.
- **Default to the Vercel AI Gateway provider** unless the user specifies a direct provider. See `references/providers__ai-sdk-providers__ai-gateway.md`.
- **Check the installed package version.** If the project has `node_modules/ai/`, prefer its docs and match its major version; the AI SDK has meaningful API changes across majors (see the migration guides).
- **Prefer streaming + typed output** patterns (`streamText`, `streamObject`, Zod schemas) where they fit, matching the surrounding codebase.

## Reference map

References are grouped by their path prefix:

- **`docs__getting-started__*`** — framework quickstarts (Next.js, Node, Svelte, Nuxt, Expo) and library navigation.
- **`docs__foundations__*`** — core concepts: providers/models, prompts, tools, streaming, agents.
- **`docs__ai-sdk-core__*`** — server-side generation: `generateText`, `streamText`, `generateObject`, `streamObject`, embeddings, image/speech, tool calling, middleware, provider/model management, error handling, telemetry.
- **`docs__ai-sdk-ui__*`** — client framework hooks: `useChat`, `useCompletion`, `useObject`, streaming, message persistence, transport.
- **`docs__ai-sdk-rsc__*`** — React Server Components streaming UI (`streamUI`, generative UI).
- **`docs__agents__*`** — building agents, `ToolLoopAgent`, loop control, memory, workflows, subagents.
- **`docs__advanced__*`** — caching, rate limiting, backpressure, stopping streams, rendering UI with language models.
- **`docs__reference__*`** — full API reference for AI SDK Core, UI, RSC, and provider utilities.
- **`docs__troubleshooting__*`** — common errors and fixes.
- **`docs__migration-guides__*`** — version-to-version migration (3.x → 6.0).
- **`providers__*`** — first-party and OpenAI-compatible/community provider docs (OpenAI, Anthropic, Google, AI Gateway, Bedrock, Groq, and more).
- **`cookbook__*`** — task-oriented recipes for Next.js, Node, and framework-agnostic guides (RAG, multi-modal chat, structured extraction, etc.).

## Keeping this current

The `references/` directory is regenerated by [`scripts/update_docs.js`](scripts/update_docs.js), which reads `ai-sdk.dev/sitemap.md`, filters to the `/docs`, `/providers`, and `/cookbook` sections, and re-fetches each page. A weekly GitHub Action (`.github/workflows/update-docs.yml`) runs it and commits any changes. To refresh locally: `make update-working-with-vercel-ai-sdk`.

## Note: official live-search skill

Vercel also ships an official, thinner skill (`npx skills add vercel/ai`, source `vercel/ai` → `skills/use-ai-sdk`) that performs *live* documentation search at runtime instead of bundling docs offline. This skill differs by bundling the full docs locally — prefer it for offline/grep-able access; use the official one if you want only live search.

Files in this skill

  • SKILL.md4.5 KB
  • references/cookbook__api-servers.md6.2 KB
  • references/cookbook__api-servers__express.md3.7 KB
  • references/cookbook__api-servers__fastify.md3.8 KB
  • references/cookbook__api-servers__hono.md3.9 KB
  • references/cookbook__api-servers__nest.md3.9 KB
  • references/cookbook__api-servers__node-http-server.md3.9 KB
  • references/cookbook__guides.md2.9 KB
  • references/cookbook__guides__agent-context-compaction.md5.7 KB
  • references/cookbook__guides__agent-skills.md10.3 KB
  • references/cookbook__guides__claude-4.md10.7 KB
  • references/cookbook__guides__computer-use.md10.6 KB
  • references/cookbook__guides__custom-memory-tool.md20.8 KB
  • references/cookbook__guides__deepseek-v3-2.md9.3 KB
  • references/cookbook__guides__gemini.md9.1 KB
  • references/cookbook__guides__google-gemini-image-generation.md4 KB
  • references/cookbook__guides__gpt-5.md11.9 KB
  • references/cookbook__guides__llama-3_1.md19 KB
  • references/cookbook__guides__multi-modal-chatbot.md13.8 KB
  • references/cookbook__guides__natural-language-postgres.md27.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.