# Documentation - [Introduction](/docs): AI features for iOS and macOS apps, in plain Swift. - [Getting started](/docs/getting-started): Add the package and stream a first response. - [Agent skill](/docs/agent-skill): Teach your coding agent to build with swift-ai-sdk. - Guides - [Guides](/docs/guides): Build real things, step by step, with the final code included. - [Your first request](/docs/guides/first-request): Generate, stream, and swap providers in five minutes. - [A chat screen](/docs/guides/chat-screen): ChatSession plus SwiftUI, against your route or fully local. - [An agent with tools](/docs/guides/agent-with-tools): Give the model functions, bound the loop, delegate to subagents. - [Structured data](/docs/guides/structured-data): Typed Codable output, streamed partials, and the Schema DSL. - [Vision and files](/docs/guides/vision-and-files): Send photos and PDFs, tune sampling, stream reasoning. - [Human-in-the-loop approvals](/docs/guides/approvals): Dangerous tools pause until the user says yes. - [Search and server tools](/docs/guides/search-and-server-tools): Combine your Swift tools with provider-hosted search, files, and code execution. - [A voice assistant](/docs/guides/voice-assistant): Live speech both ways, with a client-side tool. - [Transcribe and summarize audio](/docs/guides/transcribe-and-summarize): Turn a recording into timestamped text, typed notes, and optional speech. - [Generate images and video](/docs/guides/image-and-video-pipeline): Create a still, edit it, animate it, and persist the generated media. - [Build semantic search](/docs/guides/semantic-search): Embed a knowledge base, rerank candidates, and answer from retrieved context. - [Use custom endpoints and gateways](/docs/guides/custom-endpoints): Connect a company gateway, self-hosted server, or OpenAI-compatible proxy. - [Production reliability](/docs/guides/production-reliability): Add retries, caching, telemetry, typed errors, cancellation, and safe fallback. - [Offline first](/docs/guides/offline-first): Apple Intelligence on device, cloud as the fallback. - [Serving and testing](/docs/guides/server-and-testing): Build UI message streams by hand, and test without a network. - [Media and embeddings](/docs/guides/media-and-embeddings): Images, speech, transcription, video, search, and reranking. - **Core** - [Generating text](/docs/generating-text): generateText, streamText, and the agentic loop underneath them. - [Messages and multimodal](/docs/messages): Message construction, content parts, vision input, and JSONValue. - [Structured output](/docs/structured-output): Get typed Codable values back instead of parsing prose. - [Tools](/docs/tools): Typed tools, execution context, approvals, and client-side calls. - [Agents](/docs/agents): The Agent abstraction, subagents, and agents as chat transports. - [Reasoning](/docs/reasoning): One portable parameter for thinking across every provider. - Providers: Every pack, its setup, features, and models. - [Providers](/docs/providers): First-class model packs, custom compatible endpoints, the registry, and reasoning translation. - [Compatibility](/docs/providers/compatibility): Every provider, what it supports, and the models the library special-cases. - [OpenAI](/docs/providers/openai): Responses API by default, chat completions when you ask, plus embeddings, images, speech, transcription, and realtime. - [Anthropic](/docs/providers/anthropic): The Messages API with adaptive thinking, tool use, vision, and prompt caching. - [Google](/docs/providers/google): Gemini over the native wire, Vertex AI routing, and Gemini Live realtime. - [Azure OpenAI](/docs/providers/azure): Deployment-based routing over the OpenAI wire. - [Amazon Bedrock](/docs/providers/bedrock): The Converse API over AWS event-stream framing, with API-key auth. - [xAI](/docs/providers/xai): Grok over the Responses API, typed live search, video generation, and realtime voice. - [Groq](/docs/providers/groq): Fast open models on the chat-completions wire, with reasoning deltas. - [DeepSeek](/docs/providers/deepseek): Chat and reasoner models with reasoning_content streaming. - [Mistral](/docs/providers/mistral): Mistral and Magistral models on the chat-completions wire. - [Perplexity](/docs/providers/perplexity): Search-grounded answers with citations as sources. - [Cohere](/docs/providers/cohere): Command models, embeddings, and the reranker. - [Together AI](/docs/providers/together-ai): Run Together AI models through a first-class Swift provider pack. - [Fireworks](/docs/providers/fireworks): Stream Fireworks models with tools, structured output, and reasoning. - [Cerebras](/docs/providers/cerebras): Use Cerebras inference models through a dedicated Swift model type. - [OpenRouter](/docs/providers/openrouter): Access OpenRouter's multi-provider model catalog from Swift. - [DeepInfra](/docs/providers/deepinfra): Run DeepInfra chat models through a dedicated Swift provider pack. - [Baseten](/docs/providers/baseten): Call Baseten model deployments through a first-class Swift model. - [Vercel](/docs/providers/vercel): Generate with Vercel's v0 model endpoint from Swift. - [AI Gateway](/docs/providers/ai-gateway): Route models through Vercel AI Gateway with a dedicated Swift type. - [Sarvam](/docs/providers/sarvam): Indic-language chat, speech synthesis, and transcription across 10+ Indian languages. - [fal](/docs/providers/fal): Image generation through fal models. - [Luma](/docs/providers/luma): Image and video generation through Dream Machine. - [Replicate](/docs/providers/replicate): Image generation with Replicate-hosted models. - [ElevenLabs](/docs/providers/elevenlabs): Speech synthesis and audio transcription. - [LMNT](/docs/providers/lmnt): Text-to-speech through LMNT models and voices. - [Hume](/docs/providers/hume): Expressive text-to-speech with Hume voices. - [Deepgram](/docs/providers/deepgram): Aura speech synthesis and Nova transcription. - [AssemblyAI](/docs/providers/assemblyai): Asynchronous audio transcription behind one await. - [Rev.ai](/docs/providers/rev-ai): Asynchronous Rev.ai transcription behind one await. - [Gladia](/docs/providers/gladia): Asynchronous prerecorded-audio transcription behind one await. - [Ollama](/docs/providers/ollama): Run local Ollama models with the same generation APIs as cloud providers. - [LM Studio](/docs/providers/lm-studio): Connect Swift apps to models served locally by LM Studio. - [Custom OpenAI-compatible endpoints](/docs/providers/openai-compatible): Connect custom gateways, proxies, and model servers that speak chat completions. - [Media providers](/docs/providers/media): Provider index for image, speech, transcription, and video models. - [On-device models](/docs/on-device): Apple Foundation Models through the same LanguageModel protocol. - **UI** - [Chat UI](/docs/chat-ui): ChatSession, CompletionSession, and ObjectSession for SwiftUI. - [Streaming protocol](/docs/streaming-protocol): The UI message stream on the wire, and the server-side builders. - [Realtime voice](/docs/realtime): Live speech conversations over WebSockets with OpenAI, Google, and xAI. - **Beyond text** - [Embeddings](/docs/embeddings): Embed one or many values and compare vectors with cosine similarity. - [Reranking](/docs/reranking): Reorder candidate documents by relevance with a reranking model. - [Image generation](/docs/image-generation): Generate and edit images with a shared ImageModel API. - [Speech generation](/docs/speech-generation): Turn text into audio with a shared SpeechModel API. - [Transcription](/docs/transcription): Turn audio into text with a shared TranscriptionModel API. - [Video generation](/docs/video-generation): Generate video and animate still images with a shared VideoModel API. - [Files and skills](/docs/files-and-skills): Upload provider-hosted files and reusable Anthropic skills. - [Media overview](/docs/media): Image generation, speech synthesis, transcription, and video generation. - **More** - [Advanced](/docs/advanced): Middleware, MCP tools, uploads, telemetry, errors, and retries. - [Testing](/docs/testing): The AITesting kit: mock models, scripted loops, stream simulators. - Changelog: What shipped in each release. - [Changelog](/docs/changelog): What shipped in each release of swift-ai-sdk.