AI Deck

TanStack AI — A Framework-Agnostic TypeScript AI SDK for Working with Multiple Providers Type-Safely

An open-source TypeScript SDK for building AI applications, developed by TanStack — the team behind TanStack Query and TanStack Router. Launched in November 2025, its defining feature is the ability to work with multiple AI providers such as OpenAI, Anthropic, Gemini, and Ollama through a single unified API. It offers the building blocks you need every time you add AI to an app — streaming chat, tool calling, structured output, and multimodal input and output — in a type-safe form, along with bindings for major UI frameworks including React, Vue, Svelte, and Solid. The design is deliberately “headless”: there is no hosted platform or proprietary stream format to lock into.

Key Features

  • Provider-agnostic unified API: More than ten official adapters are available, covering OpenAI, Anthropic, Gemini, Groq, Mistral, Ollama, and others, so you can switch model providers without rewriting your application code. A generic adapter for OpenAI-compatible endpoints makes it easy to reach services that are not on the official list
  • Type-safe TypeScript design: Define schemas with Zod, ArkType, Valibot, or plain JSON Schema, and the input and output types are inferred from them. Structured output builds on the same mechanism, which removes much of the manual parsing and type-casting of responses
  • Isomorphic tool calling: Define a tool’s contract once with toolDefinition(), then supply the implementation with .server() or .client(). Server-side and browser-side tools stay consistent because they share one type definition
  • Streaming and an agent loop: Token-by-token streaming is supported out of the box. The agent execution loop is exposed in a form you can read and replace, and human-in-the-loop interrupts let you require approval before a tool runs
  • Multi-framework support: Bindings ship for React, Vue, Svelte, Solid, Preact, and Angular, alongside a framework-free core package. React users get a useChat hook
  • Multimodal and MCP: Handles images, audio, video, and documents in addition to text. It also supports connecting to external tools via the Model Context Protocol (MCP), and ships with devtools for debugging

Pricing

PlanPriceHighlights
Open source$0 (MIT license)All features available. Install from npm and run it on your own infrastructure

TanStack AI itself is free, but actually running AI requires separate API usage fees from each provider such as OpenAI or Anthropic. Pricing information is current as of August 2026. Check the official site for the latest details.

Pros & Cons

Pros

  • Switching providers requires almost no changes to application code, so model choices stay easy to revisit later
  • TypeScript inference applies throughout, catching mismatched tool arguments and structured output at build time
  • No dependence on a hosted gateway or proprietary stream format, so you keep control of your infrastructure
  • MIT-licensed open source, which keeps the barrier to adoption low, including for commercial use
  • Shares design philosophy with existing TanStack libraries such as TanStack Query, making it familiar to teams already using them

⚠️ Cons

  • As of August 2026 it is at the release candidate stage, so the API may still change before a stable release
  • It is a developer library, not a no-code chat tool — TypeScript knowledge is a prerequisite
  • Because it is still new, Japanese-language explanations and production case studies are fewer than for other major SDKs
  • Peripheral concerns such as authentication, billing, and log management are not included, so you have to build them yourself for production

Comparison with Similar Services

CriteriaTanStack AIVercel AI SDKLangChain.jsMastra
ProviderTanStackVercelLangChainMastra
LicenseMIT (open source)Open sourceOpen sourceOpen source
Main focusType-safe primitivesUI integration and polished DXHigher-level chain/agent constructionAgent and workflow implementation
UI bindingsReact, Vue, Svelte, Solid, and moreReact, Vue, Svelte, Angular, and moreNone by defaultReact integration available
Hosted serviceNone (self-hosting assumed)Strong affinity with VercelRelated services such as LangSmithCloud operation option available

Who Is It For

  • Developers who want a setup where models can be swapped later, without being locked into one AI provider
  • Teams that value TypeScript type safety and want the AI integration layer guarded by types as well
  • People already using TanStack Query or TanStack Router who want to add AI features with the same design philosophy
  • Frontend engineers implementing AI chat outside React — in Vue, Svelte, or Solid
  • Organizations that want AI features to run entirely on their own infrastructure, without depending on a hosted service

Summary

TanStack AI provides the pieces you need for AI features as type-safe primitives, and leaves both the provider and the UI framework up to you. Its emphasis on running on the stack you bring, rather than pulling you onto a specific platform, suits products built with long-term operation in mind. That said, it is at the release candidate stage as of August 2026, so if you put it into production, be ready to track changes across version updates. A practical approach is to start with a small chat feature, confirm how tool calling and structured output feel, and then widen the scope.

← Blog