Call language models, stream responses, execute tools, and serve AI-powered endpoints from Go. Use the SDK on its own or pair it with an AI SDK React frontend. Quick start · Documentation · Examples · API reference
Why
The SDK gives Go applications one API for model calls, streaming, tools, structured output, and multi-step agents across supported providers. It follows the design of Vercel's AI SDK and stays wire-compatible with its TypeScript frontend hooks. A Go endpoint can stream Server-Sent Events (SSE) directly to hooks such as useChat .
Go backend React frontend ────────── ────────────── aisdk.StreamText(...) ── SSE ──▶ useChat({ transport }) aisdk.WriteUIMessageStream(w, …) // same protocol
See How a request runs for the generation, tool, and streaming flow. Reuse an existing AI SDK React frontend or replace a TypeScript backend with Go without adding a protocol adapter.
Features
StreamText / GenerateText — stream a response or wait for the complete result, with retries and multi-step tool execution
— stream a response or wait for the complete result, with retries and multi-step tool execution React compatibility — serve useChat , useCompletion , and useObject
— serve , , and Composable tools — call plain Go functions from a model and require approval for consequential actions
— call plain Go functions from a model and require approval for consequential actions Structured output — generate schema-validated objects, arrays, and choices
... continue reading