Examples
Runnable voice bots in the repository, over WebRTC, over a WebSocket, on the phone, on Cloudflare Durable Objects, and mounted in each major framework.
Each example is a complete project in the repository's
examples folder, with an end-to-end
test that runs it against mock provider APIs. Clone the repository and run bun install once, then
start any of them from the repository root.
| Example | Run it | What it is |
|---|---|---|
smallwebrtc-voice-bot | OPENAI_API_KEY=sk-... bun run --cwd examples/smallwebrtc-voice-bot start | A voice assistant in the browser over SmallWebRTC, with OpenAI or Google Gemini services. |
websocket-voice-bot | OPENAI_API_KEY=sk-... bun run --cwd examples/websocket-voice-bot start | The same assistant over a WebSocket, with protobuf frames for @pipecat-ai/websocket-transport. |
twilio-phone-bot | OPENAI_API_KEY=sk-... PUBLIC_URL=https://... bun run --cwd examples/twilio-phone-bot start (or start:deno) | A phone bot on Twilio Media Streams: the TwiML webhook and the media WebSocket as one fetch handler, served with serveFetch on Bun or Node, or on Deno and Workers. See the Twilio quickstart. |
workers-durable-voice-agent | bun run --cwd examples/workers-durable-voice-agent dev | Parallel voice agents on Cloudflare Workers, one Durable Object per session, over WebSocket. |
workers-realtime-voice-agent | bun run --cwd examples/workers-realtime-voice-agent deploy | A browser voice agent over WebRTC on Cloudflare Workers: Cloudflare Realtime carries the audio, a Durable Object per call runs the bot. |
landing-demo | bun run --cwd examples/landing-demo dev:fakes | The live demo on the landing page: Workers AI Flux and Aura, Claude Haiku 5.5 with typed tools, Turnstile and a session budget, over WebSocket or WebRTC, with a SvelteKit page served by the same Worker. |
framework-snippets | bun test examples/framework-snippets | The same voice endpoints mounted in Bun, Deno, Elysia, Express, Hono, Next.js, Nuxt, SvelteKit, TanStack Start and Vercel. See Frameworks. |
The mock provider APIs and the recorded question the tests use are in
test-mocks. The tests
need no API keys; running an example against the real providers does.
The two browser bots serve their page on http://localhost:7860. Set
VOICE_PROVIDER=google and GOOGLE_API_KEY to use Gemini instead of OpenAI. The Workers example
reads OPENAI_API_KEY from .dev.vars; its README shows how to stream a recording to a session.
WebRTC or WebSocket?
The two browser bots are the same pipeline with a different transport. Pick by where your audio comes from:
- WebRTC copes better with lossy networks: it runs over UDP, so a lost packet doesn't hold up the audio behind it. Browser users get lower latency, the browser's echo cancellation, and Opus compression. See the voice bot guide.
- WebSocket is simpler: no ICE or TURN servers, it passes through HTTP proxies and load balancers, and it runs on Cloudflare Workers, where WebRTC can't. It is also the way to go for server-to-server audio and phone bridges. See the WebSocket transport.
pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.
Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).