# Go AI SDK sitemap

> Every documentation page with its type, a summary and prerequisites where the page states them.

Types: guide, reference, provider, migration, troubleshooting, recipe. Fetch a page as markdown by appending `.md` to its URL. Index: https://goaisdk.com/llms.txt

## Introduction

- [Go AI SDK](https://goaisdk.com/docs/introduction.md) (guide): The Go AI SDK is a powerful toolkit for building AI applications and agents with Go, featuring support for 49 providers.

## Announcing Go AI

- [Announcing the Go AI SDK](https://goaisdk.com/docs/announcing-go-ai.md) (guide): A comprehensive toolkit for building AI applications and agents with Go.

## Foundations

- [Foundations](https://goaisdk.com/docs/foundations.md) (guide): A section that covers foundational knowledge around LLMs and concepts crucial to the Go AI SDK
- [Overview](https://goaisdk.com/docs/foundations/overview.md) (guide): An overview of foundational concepts critical to understanding the Go AI SDK
- [Providers and Models](https://goaisdk.com/docs/foundations/providers-and-models.md) (guide): Explains the Go AI SDK's unified provider.Provider interface, listing supported providers, model capabilities, self-hosted models, and the provider registry.
- [Prompts](https://goaisdk.com/docs/foundations/prompts.md) (guide): Covers text, system, and message prompt formats in the Go AI SDK, including provider-specific options and multi-turn conversation context.
- [Tools](https://goaisdk.com/docs/foundations/tools.md) (guide): Introduces tools in the Go AI SDK: defining schemas, multi-step tool calling, tool choice, execution callbacks, and handling tool errors in Go.
- [Streaming](https://goaisdk.com/docs/foundations/streaming.md) (guide): Compares blocking and streaming interfaces for AI apps, then shows basic Go streaming, callbacks, accumulating text, and cancelling streams with StreamText.
- [Provider options](https://goaisdk.com/docs/foundations/provider-options.md) (guide): Documents ProviderOptions in the Go AI SDK: namespaced provider-specific settings for OpenAI, Anthropic, Google/Vertex, and xAI, with type-safe combining.

## Getting Started

- [Getting Started](https://goaisdk.com/docs/getting-started.md) (guide): Entry point for Go AI SDK docs, pointing to the quick start, installation, a first example application, and guidance for API servers and frameworks. Prerequisites: Go 1.26+ installed on your development machine; An API key from at least one AI provider (OpenAI, Anthropic, Google, etc.); Basic Go knowledge - Understanding of packages, error handling, and gorou...
- [Navigating the Library](https://goaisdk.com/docs/getting-started/navigating-the-library.md) (guide): Learn how to navigate the Go AI SDK and choose the right tools for your needs.
- [Go Quick Start](https://goaisdk.com/docs/getting-started/golang.md) (guide): Step-by-step quick start for building a first AI agent in Go, covering setup, provider choice, adding tools, and enabling multi-step tool calls. Prerequisites: Go 1.26+ installed on your local development machine; An API key from a supported provider (OpenAI, Anthropic, Google, etc.)
- [Use Go AI SDK with coding agents](https://goaisdk.com/docs/getting-started/using-go-ai-with-coding-agents.md) (guide): Point Claude Code, Cursor, Codex and other coding agents at the Go AI SDK docs, with a snippet for AGENTS.md or CLAUDE.md, an agent skill, and a docs MCP server.

## Agents

- [Agents](https://goaisdk.com/docs/agents.md) (guide): Landing page for the agents section of the Go AI SDK docs, linking guides on building agents, workflows, callbacks, and call-option configuration.
- [Overview](https://goaisdk.com/docs/agents/overview.md) (guide): Explains how agents combine LLMs and tools in a loop using ToolLoopAgent, covering execution flow, stopping conditions, callbacks, and structured workflows.
- [Building Agents](https://goaisdk.com/docs/agents/building-agents.md) (guide): Complete guide to creating agents with ToolLoopAgent in Go: configuration options, system instructions, callbacks, and human-in-the-loop tool approval.
- [Workflow Patterns](https://goaisdk.com/docs/agents/workflows.md) (guide): Learn workflow patterns for building reliable agents with the Go AI SDK.
- [Loop Control](https://goaisdk.com/docs/agents/loop-control.md) (guide): Control agent execution with stop conditions, PrepareCall, and manual loop patterns
- [Configuring Call Options](https://goaisdk.com/docs/agents/configuring-call-options.md) (guide): Shows how to pass runtime inputs to agents in Go using factory functions, so agent settings can be dynamically configured per request in HTTP handlers.
- [Agent Callbacks](https://goaisdk.com/docs/agents/callbacks.md) (guide): Reference for Go AI SDK agent lifecycle callbacks, covering both legacy and LangChain-style callback types, common use cases, data types, and run tracking.
- [WorkflowAgent](https://goaisdk.com/docs/agents/workflow-agent.md) (guide): Documents pkg/workflow's WorkflowAgent for durable, serializable Go workflows, covering the constructor, Generate, Stream, and chat transport.
- [Agent Callbacks](https://goaisdk.com/docs/agents/agent-callbacks.md) (guide): Legacy reference for Go AI SDK agent callback support, covering the OnStepFinish callback, other callbacks, a complete example, and TypeScript comparison.
- [Agent Skills](https://goaisdk.com/docs/agents/agent-skills.md) (guide): Explains agent skills in the Go AI SDK: reusable behaviors registered with agents, covering skill structure, the skill registry, and skills vs. tools.
- [Agent Subagents](https://goaisdk.com/docs/agents/agent-subagents.md) (guide): Covers hierarchical agent systems in the Go AI SDK where a main agent delegates to subagents, including the subagent registry and delegation tracking.

## AI SDK Core

- [AI SDK Core](https://goaisdk.com/docs/ai-sdk-core.md) (guide): Learn about AI SDK Core and how to work with Large Language Models in Go
- [Core API Overview](https://goaisdk.com/docs/ai-sdk-core/overview.md) (guide): Overview of the Go AI SDK Core API: core generation functions, context-based operations, error handling, middleware, telemetry, and Go-specific features.
- [Generating Text](https://goaisdk.com/docs/ai-sdk-core/generating-text.md) (guide): Shows how to generate and stream text with GenerateText and StreamText in Go, covering message-based generation, settings, and error-handling patterns.
- [Generating Structured Data](https://goaisdk.com/docs/ai-sdk-core/generating-structured-data.md) (guide): Explains generating structured JSON output with GenerateObject and StreamObject in Go, including the SchemaFor helper, output strategies, and schema naming.
- [Tool Calling](https://goaisdk.com/docs/ai-sdk-core/tools-and-tool-calling.md) (guide): Covers multi-step tool calling in the Go AI SDK: strict mode, response messages, tool choice, execution options, timeouts, and packaging complex tools.
- [Model Context Protocol (MCP)](https://goaisdk.com/docs/ai-sdk-core/mcp-tools.md) (guide): Learn how to connect to Model Context Protocol (MCP) servers and use their tools with Go AI SDK.
- [Prompt Engineering](https://goaisdk.com/docs/ai-sdk-core/prompt-engineering.md) (guide): Teaches prompt engineering for LLMs in Go, from a slogan-generator quick start to advanced techniques, Go-specific schema patterns, and debugging prompts.
- [Settings](https://goaisdk.com/docs/ai-sdk-core/settings.md) (guide): Reference for configuring the Go AI SDK: common settings, provider configuration headers, provider-specific options, and checking generation warnings.
- [Reasoning](https://goaisdk.com/docs/ai-sdk-core/reasoning.md) (guide): Learn how to control reasoning across providers with the top-level Reasoning parameter.
- [Upload File and Upload Skill](https://goaisdk.com/docs/ai-sdk-core/upload-file-and-skill.md) (guide): Upload provider files and multi-file skills for later reference in model calls.
- [Embeddings](https://goaisdk.com/docs/ai-sdk-core/embeddings.md) (guide): Explains embedding single and multiple values with the Go AI SDK's Embed and EmbedMany functions, plus similarity, token usage, and embedding middleware.
- [Reranking](https://goaisdk.com/docs/ai-sdk-core/reranking.md) (guide): Covers reranking documents by relevance with the Go AI SDK's Rerank function, including structured documents, settings, and reranking provider options.
- [Image Generation](https://goaisdk.com/docs/ai-sdk-core/image-generation.md) (guide): Shows how to generate images in Go with ai.GenerateImage, covering settings, error handling, supported image models, and advanced generation features.
- [Transcription](https://goaisdk.com/docs/ai-sdk-core/transcription.md) (guide): Shows how to transcribe audio in Go with ai.Transcribe, covering supported audio input formats, accessing results, settings, and transcription models.
- [Speech Generation](https://goaisdk.com/docs/ai-sdk-core/speech.md) (guide): Shows how to generate speech from text in Go with ai.GenerateSpeech, covering audio data access, settings, supported formats, and performance tips.
- [Video Generation](https://goaisdk.com/docs/ai-sdk-core/video-generation.md) (guide): Covers text-to-video and image-to-video generation across multiple providers in the Go AI SDK, including async polling with DoStart and DoStatus.
- [Realtime Sessions](https://goaisdk.com/docs/ai-sdk-core/realtime.md) (guide): Documents provider-neutral realtime session helpers in the Go AI SDK, exposing provider.Experimental_RealtimeModelV4 through ai.ConnectRealtime.
- [Language Model Middleware](https://goaisdk.com/docs/ai-sdk-core/middleware.md) (guide): Learn how to use middleware to enhance the behavior of language models
- [Provider & Model Management](https://goaisdk.com/docs/ai-sdk-core/provider-management.md) (guide): Explains centrally managing multiple providers and models in Go using the provider registry, custom providers with middleware, and registry utilities.
- [Error Handling](https://goaisdk.com/docs/ai-sdk-core/error-handling.md) (guide): Covers Go AI SDK error handling: regular and streaming errors, context cancellation, specific error types, and a comprehensive error-handling example.
- [Testing](https://goaisdk.com/docs/ai-sdk-core/testing.md) (guide): Describes strategies for testing Go code that calls non-deterministic, slow, and costly language models, with examples and integration-testing tips.
- [Telemetry](https://goaisdk.com/docs/ai-sdk-core/telemetry.md) (guide): Shows how to enable OpenTelemetry tracing in the Go AI SDK Core, covering telemetry settings, setup in Go, collected data, and semantic conventions.
- [Development Tools & Debugging](https://goaisdk.com/docs/ai-sdk-core/devtools.md) (guide): Covers debugging, profiling, and testing Go AI SDK applications, including debug mode, request/response inspection, token usage, and performance profiling.
- [Event callbacks](https://goaisdk.com/docs/ai-sdk-core/event-callbacks.md) (guide): Subscribe to lifecycle events in GenerateText, StreamText, Embed, EmbedMany, and Rerank calls.
- [MCP Tool Serialization](https://goaisdk.com/docs/ai-sdk-core/mcp-serialization.md) (guide): Documents GetSerializableTools() in the Go AI SDK for retrieving MCP tool definitions in a storable, transmittable format, with pagination support.

## Advanced

- [Advanced](https://goaisdk.com/docs/advanced.md) (guide): Landing page for advanced Go AI SDK topics, covering concurrency primitives, caching, rate limiting, deployment, and other production-oriented guides.
- [Coding Agents](https://goaisdk.com/docs/advanced/coding-agents.md) (guide): How to build AI agents that generate, review, and iteratively refine code using the Go AI SDK.
- [Advanced Guides](https://goaisdk.com/docs/advanced-guides.md) (guide): In-depth guides for advanced AI application patterns using the Go AI SDK.
- [Memory Management](https://goaisdk.com/docs/advanced/memory-management.md) (guide): Patterns for managing conversation history in long-running AI applications.
- [Prompt Engineering](https://goaisdk.com/docs/advanced/prompt-engineering.md) (guide): Advanced guide to prompt engineering for LLMs in Go, covering what a prompt is, a slogan-generator example, advanced techniques, and common pitfalls.
- [Provider Architecture](https://goaisdk.com/docs/advanced/provider-architecture.md) (guide): How the Go AI SDK's provider abstraction layer works, and how to implement your own provider.
- [Stopping Streams](https://goaisdk.com/docs/advanced/stopping-streams.md) (guide): Shows how to cancel streaming AI responses in Go using context cancellation, timeouts, HTTP request cancellation, and graceful shutdown patterns.
- [Backpressure](https://goaisdk.com/docs/advanced/backpressure.md) (guide): How to handle backpressure and cancellation when working with the Go AI SDK
- [Caching](https://goaisdk.com/docs/advanced/caching.md) (guide): Explains caching AI responses in the Go AI SDK using language model middleware, different storage backends, the OnFinish callback, and streaming caches.
- [Multiple Concurrent Streams](https://goaisdk.com/docs/advanced/multiple-streamables.md) (guide): Patterns for managing multiple concurrent AI streams in Go with goroutines and channels, including fan-out/fan-in and rate-limited streaming approaches.
- [Rate Limiting](https://goaisdk.com/docs/advanced/rate-limiting.md) (guide): Shows how to rate limit Go AI SDK applications using a token bucket, a Redis sliding window, middleware, and per-user versus global strategies.
- [Language Models as Routers](https://goaisdk.com/docs/advanced/model-as-router.md) (guide): Use language models to dynamically route requests to appropriate handlers
- [Sequential Generations](https://goaisdk.com/docs/advanced/sequential-generations.md) (guide): Learn how to implement sequential generations ("chains") with the Go AI SDK
- [Deployment Guide](https://goaisdk.com/docs/advanced/deployment-guide.md) (guide): Guide to deploying Go AI SDK applications to production, covering binary compilation, Docker containerization, cloud deployment, and health checks.
- [Memory Optimization](https://goaisdk.com/docs/advanced/memory-optimization.md) (guide): Explains how retention settings in the Go AI SDK reduce memory consumption by 50-80%, covering usage, streaming support, and performance impact.
- [MLflow Observability](https://goaisdk.com/docs/advanced/mlflow-observability.md) (guide): Shows how to track and debug Go AI SDK operations with MLflow Tracing over OpenTelemetry, covering configuration, telemetry settings, and troubleshooting.

## Providers

- [Providers](https://goaisdk.com/docs/providers.md) (provider): Complete guide to the 49 AI providers supported by the Go AI SDK, covering provider categories, comparison, selection guidance, and configuration patterns.
- [Provider System Overview](https://goaisdk.com/docs/providers/overview.md) (provider): Complete guide to the Go AI SDK provider architecture and capabilities
- [OpenAI Provider](https://goaisdk.com/docs/providers/openai.md) (provider): Setup and usage guide for OpenAI models (GPT-6, GPT-5, o-series) with Go AI SDK
- [Anthropic Provider](https://goaisdk.com/docs/providers/anthropic.md) (provider): Setup and usage guide for Anthropic Claude models (Sonnet, Opus, Haiku) with Go AI SDK
- [Google Provider](https://goaisdk.com/docs/providers/google.md) (provider): Setup and usage guide for Google's Gemini models in the Go AI SDK, covering available models, multimodal features, video generation, and configuration.
- [Azure OpenAI Provider](https://goaisdk.com/docs/providers/azure.md) (provider): Setup guide for Azure OpenAI Service in the Go AI SDK, covering deployment names as model IDs, Entra ID authentication, and regional/private endpoints.
- [AWS Bedrock Provider](https://goaisdk.com/docs/providers/bedrock.md) (provider): Setup and usage guide for AWS Bedrock multi-model platform with Go AI SDK
- [Cohere Provider](https://goaisdk.com/docs/providers/cohere.md) (provider): Setup and usage guide for Cohere Command and Embed models with Go AI SDK
- [Mistral AI Provider](https://goaisdk.com/docs/providers/mistral.md) (provider): Setup and usage guide for Mistral AI models in the Go AI SDK, covering available models, provider-specific features, rate limits, and pricing.
- [Groq Provider](https://goaisdk.com/docs/providers/groq.md) (provider): Setup and usage guide for Groq ultra-fast LPU inference with Go AI SDK
- [xAI Provider](https://goaisdk.com/docs/providers/xai.md) (provider): Setup and usage guide for xAI's Grok models in the Go AI SDK, covering the Responses API, provider options, image/video generation, and speech support.
- [DeepSeek Provider](https://goaisdk.com/docs/providers/deepseek.md) (provider): Setup and usage guide for DeepSeek's reasoning models in the Go AI SDK, covering available models, provider-specific features, and May 2026 parity updates.
- [Perplexity Provider](https://goaisdk.com/docs/providers/perplexity.md) (provider): Setup guide for Perplexity's Agent API in the Go AI SDK, covering model selection, image input, embeddings, and migrating from the Chat Completions API.
- [Together AI Provider](https://goaisdk.com/docs/providers/together.md) (provider): Setup and usage guide for Together AI open-source model hosting with Go AI SDK
- [Fireworks AI Provider](https://goaisdk.com/docs/providers/fireworks.md) (provider): Setup and usage guide for Fireworks AI's fast inference models in the Go AI SDK, covering available models, async models, and production best practices.
- [Replicate Provider](https://goaisdk.com/docs/providers/replicate.md) (provider): Setup and usage guide for Replicate's model marketplace in the Go AI SDK, covering available models, workflow serialization, and example API calls.
- [HuggingFace Provider](https://goaisdk.com/docs/providers/huggingface.md) (provider): Setup and usage guide for HuggingFace Router Responses API with Go AI SDK
- [Ollama Provider](https://goaisdk.com/docs/providers/ollama.md) (provider): Setup and usage guide for Ollama local model deployment with Go AI SDK
- [Google Vertex AI Provider](https://goaisdk.com/docs/providers/google-vertex.md) (provider): Setup and usage guide for Google Vertex AI enterprise platform with Go AI SDK
- [Stability AI Provider](https://goaisdk.com/docs/providers/stability.md) (provider): Setup and usage guide for Stability AI image generation with Go AI SDK
- [Black Forest Labs Provider](https://goaisdk.com/docs/providers/bfl.md) (provider): Setup and usage guide for Black Forest Labs FLUX image models with Go AI SDK
- [FAL Provider](https://goaisdk.com/docs/providers/fal.md) (provider): Setup and usage guide for FAL fast image and video generation with Go AI SDK
- [Luma Provider](https://goaisdk.com/docs/providers/luma.md) (provider): Setup guide for Luma AI's asynchronous Photon image generation in the Go AI SDK, covering reference-image-guided generation and workflow serialization.
- [ElevenLabs Provider](https://goaisdk.com/docs/providers/elevenlabs.md) (provider): Setup guide for ElevenLabs text-to-speech in the Go AI SDK, covering the provider.SpeechModel interface, generating speech, provider options, and models.
- [Deepgram Provider](https://goaisdk.com/docs/providers/deepgram.md) (provider): Setup guide for Deepgram speech-to-text in the Go AI SDK, covering the provider.TranscriptionModel interface, timestamps, models, and speech synthesis.
- [AssemblyAI Provider](https://goaisdk.com/docs/providers/assemblyai.md) (provider): Setup guide for AssemblyAI transcription in the Go AI SDK, covering the provider.TranscriptionModel interface, timestamps, supported models, and usage.
- [Cartesia Provider](https://goaisdk.com/docs/providers/cartesia.md) (provider): Setup and usage guide for Cartesia speech synthesis and transcription with Go AI SDK
- [Fish Audio Provider](https://goaisdk.com/docs/providers/fishaudio.md) (provider): Setup and usage guide for Fish Audio speech synthesis and transcription with Go AI SDK
- [Hume Provider](https://goaisdk.com/docs/providers/hume.md) (provider): Setup guide for Hume's expressive text-to-speech in the Go AI SDK, noting it only supports speech synthesis, with workflow serialization details.
- [Rev.ai Provider](https://goaisdk.com/docs/providers/revai.md) (provider): Setup guide for Rev.ai's asynchronous, job-based transcription in the Go AI SDK, noting only TranscriptionModel is supported, plus provider options.
- [Baseten Provider](https://goaisdk.com/docs/providers/baseten.md) (provider): Setup and usage guide for Baseten Model APIs and custom deployments with Go AI SDK
- [Cerebras Provider](https://goaisdk.com/docs/providers/cerebras.md) (provider): Setup and usage guide for Cerebras ultra-fast wafer-scale inference with Go AI SDK
- [DeepInfra Provider](https://goaisdk.com/docs/providers/deepinfra.md) (provider): Setup and usage guide for DeepInfra serverless GPU inference with Go AI SDK
- [GMI Cloud Provider](https://goaisdk.com/docs/providers/gmicloud.md) (provider): Setup and usage guide for GMI Cloud OpenAI-compatible inference with Go AI SDK
- [Z.AI Provider](https://goaisdk.com/docs/providers/zai.md) (provider): Setup guide for Z.AI's GLM chat models over an OpenAI-compatible API in the Go AI SDK, covering available models, provider options, and basic usage.
- [MiniMax Provider](https://goaisdk.com/docs/providers/minimax.md) (provider): Setup and usage guide for MiniMax chat and video models with Go AI SDK
- [Moonshot AI Provider](https://goaisdk.com/docs/providers/moonshot.md) (provider): Setup guide for Moonshot AI's Kimi and legacy Moonshot v1 chat models in the Go AI SDK, covering provider options, metadata, and workflow serialization.
- [Alibaba Cloud Provider](https://goaisdk.com/docs/providers/alibaba.md) (provider): Setup and usage guide for Alibaba Cloud Qwen and Wan models with Go AI SDK
- [KlingAI Provider](https://goaisdk.com/docs/providers/klingai.md) (provider): Setup guide for KlingAI's video generation in the Go AI SDK, covering text-to-video, image-to-video, motion control, async polling, and error handling.
- [AI Gateway](https://goaisdk.com/docs/providers/gateway.md) (provider): Use Vercel's AI Gateway for unified multi-provider access, automatic failover, and cost optimization.
- [Vercel AI Provider](https://goaisdk.com/docs/providers/vercel.md) (provider): Setup and usage guide for the Vercel AI OpenAI-compatible endpoint with Go AI SDK
- [Gladia Provider](https://goaisdk.com/docs/providers/gladia.md) (provider): Setup and usage guide for Gladia speech-to-text transcription with Go AI SDK
- [QuiverAI Provider](https://goaisdk.com/docs/providers/quiverai.md) (provider): Covers generating SVGs and vectorizing raster images with QuiverAI through the Go AI SDK image model interface, including provider options and setup.
- [LMNT Provider](https://goaisdk.com/docs/providers/lmnt.md) (provider): Setup and usage guide for LMNT text-to-speech synthesis with Go AI SDK
- [Prodia Provider](https://goaisdk.com/docs/providers/prodia.md) (provider): Setup and usage guide for Prodia image and video generation with the Go AI SDK.
- [Voyage Provider](https://goaisdk.com/docs/providers/voyage.md) (provider): Setup guide for Voyage embedding and reranking models in the Go AI SDK, covering model IDs, retrieval-optimized usage, and May 2026 parity updates.
- [TypeSafe AI Provider](https://goaisdk.com/docs/providers/typesafeai.md) (provider): Setup and usage guide for TypeSafe AI evaluation models with Go AI SDK
- [OpenAI-compatible providers](https://goaisdk.com/docs/providers/openai-compatible.md) (provider): Configure OpenAI-compatible endpoints with Go AI SDK provider options and warnings.
- [OpenResponses Provider](https://goaisdk.com/docs/providers/openresponses.md) (provider): Explains the OpenResponses provider for Responses-compatible APIs like LMStudio, Ollama, and LocalAI, covering custom tools and streaming text parts.
- [Topaz Provider](https://goaisdk.com/docs/providers/topaz.md) (provider): Setup and usage guide for Topaz Labs image and video enhancement with the Go AI SDK.
- [You.com Tools](https://goaisdk.com/docs/providers/youcom-tools.md) (provider): Reference for pkg/providers/youcom, a Go port of the You.com AI SDK plugin providing search, research, and content-extraction tools for agents.
- [Alibaba Video Generation](https://goaisdk.com/docs/providers/alibaba-video-generation.md) (provider): Guide to image-to-video generation using the Alibaba DashScope provider in the Go AI SDK, covering available models, image formats, and limitations.
- [Anthropic Advanced Features](https://goaisdk.com/docs/providers/anthropic-advanced-features.md) (provider): Covers advanced Claude model features in the Go AI SDK, including Fast Mode, adaptive thinking, combining features, and AWS Bedrock support.
- [ByteDance Video Generation](https://goaisdk.com/docs/providers/bytedance-video-generation.md) (provider): Guide to text-to-video and image-to-video generation with the ByteDance Volcengine provider in the Go AI SDK, covering start/end frames and resolution.
- [FAL Video Generation](https://goaisdk.com/docs/providers/fal-video-generation.md) (provider): Guide to image-to-video generation using the FAL provider in the Go AI SDK, covering supported image formats, parameters, and memory considerations.
- [Fireworks Kimi K2.5: Extended Reasoning](https://goaisdk.com/docs/providers/fireworks-kimi-k2-5.md) (provider): Explains extended reasoning and thinking options for Fireworks AI's Kimi K2.5 model in the Go AI SDK, covering model IDs, token budgets, and history modes.
- [OpenAI Responses API: Custom Tools & Shell Container Tools](https://goaisdk.com/docs/providers/openai-responses-tools.md) (provider): Covers Custom Tool, Tool Search, and Shell Container Tool types in the OpenAI Responses API, and how to use PrepareTools with them in the Go AI SDK.
- [XAI Advanced Usage Reporting](https://goaisdk.com/docs/providers/xai-usage-reporting.md) (provider): Explains advanced token usage tracking for xAI models in the Go AI SDK, covering cached tokens, reasoning tokens, and cost tracking.

## Reference

- [API Reference](https://goaisdk.com/docs/reference.md) (reference): Complete API reference index for the Go AI SDK, linking core functions, tool and helper APIs, type definitions, provider interfaces, and middleware.
- [Agent UI Stream Helpers](https://goaisdk.com/docs/reference/ai/agent-ui-stream-helpers.md) (reference): API reference for pkg/agent UI stream helpers that bridge ToolLoopAgent streams to UI-transport-friendly forms, including CreateAgentUIStream.
- [Agent](https://goaisdk.com/docs/reference/ai/agent.md) (reference): API reference for agent.Agent, the Go AI SDK interface implemented by autonomous agents that use tools and make decisions to complete tasks.
- [Batch API](https://goaisdk.com/docs/reference/ai/batch.md) (reference): Reference for the experimental batch functions in the Go AI SDK: start, status, results, cancel and list, with their option and result types.
- [Callback Events](https://goaisdk.com/docs/reference/ai/callback-events.md) (reference): Structured lifecycle events for observability in GenerateText, StreamText, and ToolLoopAgent
- [Code Mode](https://goaisdk.com/docs/reference/ai/code-mode.md) (reference): API reference for pkg/codemode, a Go port of @ai-sdk/code-mode letting a model write JavaScript that calls host tools instead of per-call tool use.
- [CosineSimilarity](https://goaisdk.com/docs/reference/ai/cosine-similarity.md) (reference): API reference for CosineSimilarity, a Go AI SDK function that measures similarity between two embedding vectors, returning a value from -1 to 1.
- [Dynamic Tools](https://goaisdk.com/docs/reference/ai/dynamic-tool.md) (reference): API reference for dynamic tools in the Go AI SDK: registering tools at runtime with types.Tool.Type set to types.ToolTypeDynamic instead of a static, typed definition.
- [EmbedMany](https://goaisdk.com/docs/reference/ai/embed-many.md) (reference): API reference for EmbedMany, a Go AI SDK function that generates vector embeddings for multiple text inputs in a single batched operation.
- [Embed](https://goaisdk.com/docs/reference/ai/embed.md) (reference): API reference for Embed, the Go AI SDK function that generates a single vector embedding for one text input using an embedding model.
- [Files and skills](https://goaisdk.com/docs/reference/ai/files-and-skills.md) (reference): Reference for the Go AI SDK functions that upload, inspect, download and delete provider files and upload skills.
- [GenerateID / CreateIDGenerator](https://goaisdk.com/docs/reference/ai/generate-id.md) (reference): API reference for GenerateID and CreateIDGenerator, Go AI SDK helpers that create unique identifier strings for tool calls and requests.
- [GenerateImage](https://goaisdk.com/docs/reference/ai/generate-image.md) (reference): API reference for GenerateImage, the Go AI SDK function that generates images from text prompts using a configured image model and provider.
- [GenerateObject](https://goaisdk.com/docs/reference/ai/generate-object.md) (reference): API reference for GenerateObject, the Go AI SDK function that generates structured JSON objects conforming to a schema using language models.
- [GenerateSpeech](https://goaisdk.com/docs/reference/ai/generate-speech.md) (reference): API reference for GenerateSpeech, the Go AI SDK function that generates speech audio from text using a configured speech model and provider.
- [GenerateText](https://goaisdk.com/docs/reference/ai/generate-text.md) (reference): API reference for GenerateText, the Go AI SDK function that generates text with support for tool calling, streaming, and multi-step conversations.
- [Harness Sandbox: Vercel](https://goaisdk.com/docs/reference/ai/harness-sandbox-vercel.md) (reference): API reference for pkg/harness/sandbox/vercel, a Go port of the Vercel Sandbox harness provider
- [HasToolCall](https://goaisdk.com/docs/reference/ai/has-tool-call.md) (reference): Built-in StopCondition that stops the tool-calling loop when a specific tool is called
- [LlamaIndex Adapter](https://goaisdk.com/docs/reference/ai/llamaindex.md) (reference): API reference for pkg/llamaindex, a Go port of @ai-sdk/llamaindex that adapts LlamaIndex chat-engine responses into AI SDK UI message stream chunks.
- [Middleware Aliases](https://goaisdk.com/docs/reference/ai/middleware-aliases.md) (reference): Reference for the middleware type aliases, wrapper functions, and built-in middleware constructors that pkg/ai re-exports for discoverability.
- [Rerank](https://goaisdk.com/docs/reference/ai/rerank.md) (reference): API reference for Rerank, the Go AI SDK function that reorders documents by relevance to a query using a specialized reranking model.
- [IsStepCount](https://goaisdk.com/docs/reference/ai/step-count-is.md) (reference): API reference for IsStepCount (formerly StepCountIs), a built-in StopCondition that stops the Go AI SDK's tool-calling loop once a given number of steps completes.
- [StopCondition](https://goaisdk.com/docs/reference/ai/stop-condition.md) (reference): Type reference for StopCondition and StopConditionState in the Go AI SDK, covering the function type, evaluation order, and usage with StopWhen.
- [StreamObject](https://goaisdk.com/docs/reference/ai/stream-object.md) (reference): API reference for StreamObject, the Go AI SDK function that streams structured object generation, parsing and validating partial JSON as it arrives.
- [StreamText](https://goaisdk.com/docs/reference/ai/stream-text.md) (reference): API reference for StreamText, the Go AI SDK function that streams text generation, returning tokens incrementally as the model produces them.
- [Stream Transport Helpers](https://goaisdk.com/docs/reference/ai/stream-transport-helpers.md) (reference): Reference for Go AI SDK stream transport helpers that convert stream results into HTTP-friendly payloads, including CreateUIMessageStreamResponse.
- [Streaming transcription and translation](https://goaisdk.com/docs/reference/ai/streaming-audio.md) (reference): Reference for the experimental Go AI SDK functions that stream audio to a model for live transcription and speech translation, with stream part types.
- [Tool approval helpers](https://goaisdk.com/docs/reference/ai/tool-approvals.md) (reference): Reference for the Go AI SDK tool approval functions: signing, verification, collecting, validating and resuming approvals, with their option and result types and errors.
- [Tool call parsing and repair](https://goaisdk.com/docs/reference/ai/tool-call-repair.md) (reference): Reference for the Go AI SDK functions that parse, repair and refine model tool calls, and the tool definition fingerprints that detect drift.
- [ToolLoopAgent](https://goaisdk.com/docs/reference/ai/tool-loop-agent.md) (reference): API reference for agent.ToolLoopAgent, the Go AI SDK type that creates an agent continuously using tools in a loop until the task completes.
- [Tool search and tool callers](https://goaisdk.com/docs/reference/ai/tool-search-and-callers.md) (reference): Reference for ai.ToolSearch, deferred tool loading and the experimental tool caller routing helpers in the Go AI SDK.
- [Tool](https://goaisdk.com/docs/reference/ai/tool.md) (reference): API reference for the Tool type in the Go AI SDK, defining tools that language models can call to perform actions or retrieve information.
- [Transcribe](https://goaisdk.com/docs/reference/ai/transcribe.md) (reference): API reference for Transcribe, the Go AI SDK function that converts audio to text using a transcription model, including URL and base64 input.
- [UI message chunks](https://goaisdk.com/docs/reference/ai/ui-message-chunks.md) (reference): Reference for every chunk type the Go AI SDK UI message stream emits, with fields, matching the AI SDK UIMessageChunk union.
- [UI messages](https://goaisdk.com/docs/reference/ai/ui-messages.md) (reference): Reference for the Go AI SDK UI message types, part types, type guards, validation, conversion to model messages and stream reading.
- [Utilities](https://goaisdk.com/docs/reference/ai/utilities.md) (reference): Reference for Go AI SDK utility types and functions: message pruning, timeouts, stream adapters, partial output parsing, evaluation, realtime sessions, sandboxes and warnings.
- [Video operations](https://goaisdk.com/docs/reference/ai/video-operations.md) (reference): Reference for the experimental Go AI SDK functions that start a video generation and check its status later, with option and result types.
- [Harness adapters](https://goaisdk.com/docs/reference/harness/adapters.md) (reference): Reference for the Harness adapter interface, sessions and prompt controls in the Go AI SDK, and for the Claude Code, Codex and other built-in adapters.
- [Harness agent](https://goaisdk.com/docs/reference/harness/agent.md) (reference): Reference for harness.Agent, AgentSettings and AgentSession in the Go AI SDK: running coding-agent runtimes such as Claude Code and Codex as an agent, with sessions, approvals and lifecycle state.
- [Harness sandboxes](https://goaisdk.com/docs/reference/harness/sandbox.md) (reference): Reference for harness sandbox configuration, the SandboxProvider interface, bootstrap recipes and templates, network policy, request transformations and the local and Vercel providers.
- [Harness stream parts](https://goaisdk.com/docs/reference/harness/stream-parts.md) (reference): Reference for the stream part types a harness adapter emits during a prompt turn, how they map to AI SDK stream chunks, and the JSON helpers.
- [MCP client](https://goaisdk.com/docs/reference/mcp/client.md) (reference): Reference for the Go AI SDK MCP client in pkg/mcp: client creation, transports, tool conversion, resources, prompts, completions, elicitation, MCP Apps and errors.
- [MCP OAuth](https://goaisdk.com/docs/reference/mcp/oauth.md) (reference): Reference for the Go AI SDK MCP OAuth helpers: the Auth flow, client provider interfaces, discovery, registration, token exchange, PKCE and OAuth errors.
- [MCP protocol types](https://goaisdk.com/docs/reference/mcp/protocol-types.md) (reference): Reference for the Go AI SDK MCP protocol types: JSON-RPC messages, capabilities, initialize and discover, tool, resource and prompt payloads, and logging.
- [Built-in Middleware](https://goaisdk.com/docs/reference/middleware/built-in-middleware.md) (reference): Catalog of built-in Go AI SDK middleware, including DefaultSettingsMiddleware, DefaultInstructionsMiddleware, ExtractJSONMiddleware, ExtractReasoningMiddleware, SimulateStreamingMiddleware, and AddToolInputExamplesMiddleware.
- [Middleware Interface](https://goaisdk.com/docs/reference/middleware/middleware-interface.md) (reference): API reference for LanguageModelMiddleware, EmbeddingModelMiddleware, and ImageModelMiddleware, the Go AI SDK structs for implementing custom model-behavior middleware.
- [WrapLanguageModel](https://goaisdk.com/docs/reference/middleware/wrap-language-model.md) (reference): API reference for WrapLanguageModel, the Go AI SDK function that wraps a language model with middleware to add default settings, logging, or other behavior.
- [Anthropic configuration](https://goaisdk.com/docs/reference/providers/anthropic-config.md) (provider): Reference for the Anthropic provider Config struct and model option types, generated from the Go source.
- [Custom Provider Guide](https://goaisdk.com/docs/reference/providers/custom-provider.md) (provider): Guide for implementing custom AI providers for the Go AI SDK, covering the provider interface, a custom language model, and streaming support.
- [EmbeddingModel Interface](https://goaisdk.com/docs/reference/providers/embedding-model.md) (provider): API reference for the EmbeddingModel interface in the Go AI SDK, defining the methods every embedding model implementation must satisfy.
- [Google configuration](https://goaisdk.com/docs/reference/providers/google-config.md) (provider): Reference for the Google Generative AI provider Config struct and model option types, generated from the Go source.
- [ImageModel Interface](https://goaisdk.com/docs/reference/providers/image-model.md) (provider): API reference for the ImageModel interface in the Go AI SDK, defining the methods and ImageGenerateOptions every image model implementation must satisfy.
- [LanguageModel Interface](https://goaisdk.com/docs/reference/providers/language-model.md) (provider): API reference for the LanguageModel interface in the Go AI SDK, defining the methods and GenerateOptions every language model implementation must satisfy.
- [OpenAI configuration](https://goaisdk.com/docs/reference/providers/openai-config.md) (provider): Reference for the OpenAI provider Config struct and model option types, generated from the Go source.
- [SpeechModel Interface](https://goaisdk.com/docs/reference/providers/speech-model.md) (provider): API reference for the SpeechModel interface in the Go AI SDK, defining the methods every text-to-speech model implementation must satisfy.
- [TranscriptionModel Interface](https://goaisdk.com/docs/reference/providers/transcription-model.md) (provider): API reference for the TranscriptionModel interface in the Go AI SDK, defining the methods every speech-to-text model implementation must satisfy.
- [Provider Registry](https://goaisdk.com/docs/reference/registry/provider-registry.md) (reference): API reference for the Go AI SDK's provider registry, which lets you register and access multiple AI providers globally through string IDs.
- [JSON Schema](https://goaisdk.com/docs/reference/schema/json-schema.md) (reference): API reference for JSON Schema types in the Go AI SDK, covering the Schema and Validator interfaces, creating schemas, constraints, and circular refs.
- [Error Types](https://goaisdk.com/docs/reference/types/errors.md) (reference): API reference for Go AI SDK error types, covering common errors returned by SDK functions and recommended error-handling patterns for applications.
- [Message Types](https://goaisdk.com/docs/reference/types/messages.md) (reference): API reference for Go AI SDK message types, covering MessageRole, Message, and ContentPart implementations like TextContent, ImageContent, and FileContent.
- [Tool Types](https://goaisdk.com/docs/reference/types/tools.md) (reference): API reference for Go AI SDK tool-related types, covering Tool, ToolCall, ToolResult, ToolChoice, and the ToolExecutor function signature.
- [Usage Types](https://goaisdk.com/docs/reference/types/usage.md) (reference): API reference for Go AI SDK usage types that track token counts and costs across API calls, including input and output token detail breakdowns.
- [Workflow](https://goaisdk.com/docs/reference/workflow.md) (reference): Reference for pkg/workflow in the Go AI SDK: WorkflowAgent, its options and results, the chat transports, serializable tools, step iteration and the durable harness runner.
- [Download API Reference](https://goaisdk.com/docs/reference/download-api.md) (reference): API reference for the Go AI SDK's Download API, which fetches files securely with built-in size limits that prevent memory-exhaustion attacks.

## Migration Guides

- [Migrating from v0.1.x to v0.2.0](https://goaisdk.com/docs/migration-guides/from-v0.1-to-v0.2.md) (migration): Breaking changes in Go AI SDK v0.2.0, the TypeScript AI SDK v6.0 parity release.
- [Migrating from the TypeScript AI SDK](https://goaisdk.com/docs/migration-guides/from-typescript-ai-sdk.md) (migration): Map Vercel AI SDK (ai@7.0.x) calls to their Go SDK equivalents, and see where the Go port has to diverge.
- [Migrating from v0.3.x to v0.4.0](https://goaisdk.com/docs/migration-guides/from-v0.3-to-v0.4.md) (migration): Runtime behavior changes in Go AI SDK v0.4.0 — deferred streaming tool execution, xAI's Responses API default, and stricter MCP redirect handling.
- [Migrating from v0.4.x to v0.5.0](https://goaisdk.com/docs/migration-guides/from-v0.4-to-v0.5.md) (migration): Migration guide for upgrading Go AI SDK apps from v0.4.x to v0.5.0, covering runtime context changes, tool approval, provider updates, and breaking changes.
- [Known differences from the TypeScript AI SDK](https://goaisdk.com/docs/migration-guides/known-differences.md) (migration): Behavior that is intentionally different in Go, and features that only exist in the TypeScript SDK.
- [Token usage differentiation](https://goaisdk.com/docs/migration-guides/token-usage-differentiation.md) (migration): Explains the TextTokens and ImageTokens fields added to types.InputTokenDetails in v0.2.0, letting you cost multimodal requests accurately in Go.

## Troubleshooting

- [Troubleshooting](https://goaisdk.com/docs/troubleshooting.md) (troubleshooting): Landing page for Go AI SDK troubleshooting guides, covering common issues, a quick diagnostic guide, debug mode, and where to get further help.
- [Common Errors](https://goaisdk.com/docs/troubleshooting/common-errors.md) (troubleshooting): Covers the most frequent Go AI SDK errors and fixes, including API key issues, nil pointer errors, channel/streaming errors, and import/type errors.
- [Provider Errors](https://goaisdk.com/docs/troubleshooting/provider-errors.md) (troubleshooting): Troubleshooting guide for provider-specific Go AI SDK errors across OpenAI, Anthropic, Google Gemini, Azure OpenAI, and AWS Bedrock integrations.
- [Rate Limit Issues](https://goaisdk.com/docs/troubleshooting/rate-limits.md) (troubleshooting): Covers handling rate limiting and quota exhaustion in the Go AI SDK, including client-side rate limiting, concurrent request management, and monitoring.
- [Context Cancellation](https://goaisdk.com/docs/troubleshooting/context-cancellation.md) (troubleshooting): Debugging guide for Go context timeout and cancellation issues in the Go AI SDK, covering propagation, goroutines, and streaming context problems.
- [Streaming Issues](https://goaisdk.com/docs/troubleshooting/streaming-issues.md) (troubleshooting): Solves common Go AI SDK streaming problems, covering channel-related issues, stream interruption, concurrent streaming, and buffer and memory issues.
- [Tool Calling Errors](https://goaisdk.com/docs/troubleshooting/tool-calling-errors.md) (troubleshooting): Debugging guide for Go AI SDK tool execution and schema issues, covering tool definition errors, tool choice problems, and async tool execution.
- [Schema Validation Errors](https://goaisdk.com/docs/troubleshooting/schema-validation.md) (troubleshooting): Fixes JSON schema validation errors when generating structured data with the Go AI SDK, covering type mismatches, nested structures, and arrays.
- [Performance Optimization](https://goaisdk.com/docs/troubleshooting/performance.md) (troubleshooting): Covers optimizing slow Go AI SDK operations, including slow response times, memory issues, caching for performance, and concurrent processing patterns.
- [Debugging Guide](https://goaisdk.com/docs/troubleshooting/debugging.md) (troubleshooting): Comprehensive debugging techniques for Go AI applications, covering debug logging, goroutine debugging, pprof profiling, and stream debugging tools.
- [Timeout Errors](https://goaisdk.com/docs/troubleshooting/timeout-errors.md) (troubleshooting): Explains timeout errors in the Go AI SDK, covering how to detect, handle, and prevent them, plus recommended timeouts and async processing patterns.

## Build A Chat App

- [Build a chat app](https://goaisdk.com/docs/build-a-chat-app.md) (guide): Guides for building a chat product with a useChat frontend, a Go backend, approval-gated tools and coding agents, based on the Shipyard reference app.
- [Serve a useChat frontend from Go](https://goaisdk.com/docs/build-a-chat-app/serve-usechat-from-go.md) (guide): Build a Go HTTP endpoint that the stock useChat hook talks to, with validation, keep-alive, CORS, proxy settings and custom data parts.
- [Tool approval end to end](https://goaisdk.com/docs/build-a-chat-app/tool-approval.md) (guide): Let a model ask and a user decide. Mark tools as approval-gated, sign approval requests, and run the full round trip with useChat and a Go backend.
- [Coding agents with the harness](https://goaisdk.com/docs/build-a-chat-app/coding-agents-harness.md) (guide): Run Claude Code or Codex from Go with harness.NewAgent. Covers sandboxes, sessions, permission modes, seeding files, streaming activity into a chat UI and reading changes back.

## Recipes

- [Recipes](https://goaisdk.com/docs/recipes.md) (recipe): Short, complete programs for common tasks with the Go AI SDK, each with a runnable example in the repository.
- [Serve a useChat frontend](https://goaisdk.com/docs/recipes/usechat-backend.md) (recipe): Stream a Go agent to the stock useChat hook with validation, keep-alive and the right headers.
- [Ask before running a tool](https://goaisdk.com/docs/recipes/tool-approval.md) (recipe): Pause a tool call until a user approves it, with signed approval requests and the useChat round trip.
- [Use tools from an MCP server](https://goaisdk.com/docs/recipes/mcp-tools.md) (recipe): Connect to a Model Context Protocol server over HTTP and give its tools to a model.
- [Get typed data from a model](https://goaisdk.com/docs/recipes/structured-output.md) (recipe): Generate a validated Go struct with GenerateText and ObjectOutput.
- [Switch providers](https://goaisdk.com/docs/recipes/switch-providers.md) (recipe): Resolve models from provider:model strings so one program runs on Anthropic, OpenAI or Google.
- [Use Claude with reasoning](https://goaisdk.com/docs/recipes/claude-reasoning.md) (recipe): Turn on reasoning for Claude with the portable Reasoning setting and read the reasoning blocks.
- [Run Claude Code or Codex](https://goaisdk.com/docs/recipes/harness-coding-agent.md) (recipe): Drive Claude Code or Codex from Go with the harness, in a sandbox, and read the changed files back.
- [Retrieve context with embeddings](https://goaisdk.com/docs/recipes/rag-embeddings.md) (recipe): Embed documents, rank them by cosine similarity and answer a question from the best matches.
- [Handle rate limits and retries](https://goaisdk.com/docs/recipes/rate-limits-retries.md) (recipe): Set retries and timeouts, and inspect the error when the SDK gives up.
- [Test code that calls a model](https://goaisdk.com/docs/recipes/mock-model-tests.md) (recipe): Test model-calling code with testutil.MockLanguageModel, with no API key and no network.
- [Run a tool loop with an agent](https://goaisdk.com/docs/recipes/agent-with-tools.md) (recipe): Give an agent a tool and let it call the tool and answer, with a step limit.
- [Stream text as it arrives](https://goaisdk.com/docs/recipes/stream-text.md) (recipe): Read a streaming response chunk by chunk with StreamText and the Next() loop.

## Changelog

- [Changelog](https://goaisdk.com/docs/changelog.md) (guide): Release history of the Go AI SDK, generated from CHANGELOG.md in the repository.

## Guides

- [Streaming in Go AI SDK](https://goaisdk.com/docs/guides/STREAMING.md) (guide): Explains the Go AI SDK's Next()-based streaming pattern, covering chunk types, advanced patterns, error handling, and migrating from io.Reader.
- [Download Security and Size Limits](https://goaisdk.com/docs/guides/download-security.md) (guide): Explains built-in protection against memory-exhaustion attacks when the Go AI SDK downloads files from URLs, covering default limits and customization.
- [Tool Reference (Anthropic)](https://goaisdk.com/docs/guides/tool-reference.md) (guide): Explains Anthropic tool references in the Go AI SDK, which let you reuse previously defined tool definitions to reduce token usage and improve performance.
- [Tool Result Content Arrays](https://goaisdk.com/docs/guides/tool-result-content-arrays.md) (guide): Explains the content array feature for tool results in the Go AI SDK, letting tools return rich structured content like text, images, and files.

## Security

- [Security Advisory: Unbounded Download DoS Prevention](https://goaisdk.com/docs/security/ADVISORY-Download-DoS.md) (guide): Security advisory describing an unbounded download denial-of-service vulnerability in the Go AI SDK, its fix, mitigation steps, and impact assessment.
