TanStack AI is a TypeScript SDK for building applications that stream AI responses, call tools, run agents, produce structured output, and handle multimodal or realtime interactions. Developers use it across frameworks and AI providers through shared typed interfaces and provider adapters. The catalogue entries are add-ons for working with this SDK.
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.
npx skills add TanStack/ai --skill tanstack-ai-migrationgit clone --depth 1 https://github.com/TanStack/aiWrote 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.
[](https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration)<a href="https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration"><img src="https://agentmods.dev/badge/skills/tanstack/ai/tanstack-ai-migration/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.
<a href="https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration"><img src="https://agentmods.dev/badge/skills/tanstack/ai/tanstack-ai-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00140 | $0.00683 |
| Opus 5.5 | $0.00056 | $0.00273 |
| Sonnet 5.5 | $0.00028 | $0.00137 |
| Haiku 4.5 | $0.00014 | $0.00068 |
Grade A, and why
tanstack-ai-migration 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migrating to TanStack AI
Two different jobs. Pick the one that matches the code in front of you.
Coming from another SDK
The name-by-name mapping lives in the docs, and it is longer than any summary that fits here:
https://tanstack.com/ai/latest/docs/migration/migration-from-vercel-ai
The shape of the change:
streamTextandgenerateTextbecome onechat()call with a streaming option.createOpenAI(...)becomes a tree-shakeable adapter, such asopenaiText()from@tanstack/ai-openai.onFinishand friends become middleware hooks.- Manual SSE wiring becomes the built-in response helpers.
generateObjectbecomes structured outputs onchat().
Read the guide, then load the target API's own skill with
npx @tanstack/intent@latest load @tanstack/ai#ai-core. Do not port from memory: a half-remembered mapping produces
code that type-checks in neither SDK.
Upgrading TanStack AI itself
Start with the version the app has, and the current release:
node -p "require('@tanstack/ai/package.json').version"
npm view @tanstack/ai version
Then read the guides for what changed:
- https://tanstack.com/ai/latest/docs/migration/migration
- https://tanstack.com/ai/latest/docs/migration/ag-ui-compliance
- https://tanstack.com/ai/latest/docs/migration/sampling-options-to-model-options
- https://tanstack.com/ai/latest/docs/migration/create-ui
Deprecated APIs keep working, so upgrade in steps rather than rewriting everything at once.
Codemods
Some renames have a jscodeshift transform. Run it straight from the repo, and
preview first with --dry --print:
npx jscodeshift \
-t https://raw.githubusercontent.com/TanStack/ai/main/codemods/ag-ui-compliance/transform.ts \
--dry --print src/
Each guide names the codemod that covers it, and what the codemod cannot reach. Server-side rewrites are usually manual.
After the port
Run the project's type checker. Most errors after a migration come from an API
that was remembered rather than read, so check the failing name against
node_modules/@tanstack/ai/src/ before changing it again.
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.
- 1mo ago First seen · 77 lines · 140 tokens per session scan A b73a1931b222
tanstack-ai-migration is a skill published in the GitHub repository TanStack/ai (3,210 stars, last pushed today), licensed MIT. It adds 140 tokens to every session and 683 once invoked, about $0.0006 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-09-09.
Other skills, from other repositories
claude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude…
claude-api-in-prototypes
Call Claude from your HTML artifacts via window.claude.complete.
duckbug-knowledge
Answer questions about the owner's services and domain using the approved DuckBug knowledge base through configured MCP tools.
openai-patterns
Production OpenAI API patterns — model selection, prompt engineering, function calling, streaming, error handling, cost control, and structured outputs.
mastra
Comprehensive Mastra framework guide. Teaches how to find current documentation, verify API signatures, and build agents and workflows. Covers documentation lookup strategies (embedded docs, remote docs), core concepts (agents vs workflows, tools, memory, RAG), TypeScript requirements, and common patterns. Use this…
llava
Vision-language chat: VQA, captioning, image dialogue.