AI
Own the path between your interface and every model.
TanStack AI is a typed, composable SDK for streaming model output, tools, structured data, media, and realtime experiences through infrastructure you control.
Typed tools
One contract. Two execution boundaries.
Define the input and output once, then choose where the work belongs. Client tools can touch local UI state. Server tools can reach private systems. Isomorphic tools share the same definition and can still pause for approval.
const lookupInvoice = toolDefinition({
name: 'lookup_invoice',
inputSchema: z.object({ id: z.string() }),
outputSchema: invoiceSchema,
needsApproval: true,
})
lookupInvoice.server(readPrivateLedger)
Runs behind your server boundary with private credentials and data.
selected model
gpt-5
Adapter-specific types expose the options and outputs available for this model.
Provider types
The adapter changes. The capability surface stays honest.
Providers share a common SDK shape without pretending every model is identical. Model names, options, tool support, and modality-specific results remain typed at the adapter boundary.
AG-UI both ways
The protocol is the seam, not a hosted middleman.
Headless clients send AG-UI-compatible requests and consume AG-UI events. Your runtime can live in TypeScript or interoperate with another AG-UI server while your application keeps control of transport, auth, and deployment.
UI
headless client
AG-UI
request + events
Runtime
your server
Provider
typed adapter
Beyond chat
Different media. The same observable runtime.
Text and structured output sit beside image generation, speech, transcription, realtime voice, and video. Middleware, hooks, devtools, and OpenTelemetry can observe work at the activity level.
Text + objects
chat · outputSchema
Speech + transcription
generateSpeech · generateTranscription
Realtime voice
realtimeToken · RealtimeClient
Images + video
generateImage · generateVideo