Examples
Examples
Runnable example apps for all three SDKs, with a docs page for each covering what it demonstrates, how it works, and how to run it.
Every example here is real, runnable code in the cosmo-ai examples repo. Each page in this section tells you what the example demonstrates, walks the parts worth copying, and shows what a successful run looks like — the full source lives in the repo, so nothing on these pages is a listing you have to transcribe.
The following table maps each example to its language, its docs page, and what it shows off.
| Example | Language | What it demonstrates |
|---|---|---|
| Browser voice page | TypeScript / React | The smallest complete browser app: provider, transcript, mic control, one client tool |
| Voice CLI | Python | Two-way voice from a terminal — OS mic and speaker, live transcript |
| Agent recipes | Python | Client tools, skills, hooks, MCP servers, and an outbound phone call — one small script each |
| Docs agent | TypeScript / React | Client tools as a live view of your app's state, plus sendContext and a deployable token flow |
| Squat coach | TypeScript / React + Python | A session grounded in analysis done before the call, with a video-replay client tool |
| Garden doctor | TypeScript / React | A live-camera plant doctor: server locators find what you ask about, the SDK's renderers draw boxes and points over the preview |
| Cartographer | Swift (macOS) | A native SwiftUI app: typed event stream, Decodable tool args, an app-side hook limit |
Two more live in the repo but are covered elsewhere on this site:
examples/swift/HelloRealtime— the terminal-first Swift example behind the Swift quickstart and the Mac app guide. Its extra targets (SkillsExample,HooksExample,MCPExample) are the Swift siblings of the Python agent recipes.examples/typescript/token-server— the deployable token-minting backend. Share your app and End-user credentials cover when and how to use it.