# OpenAI Realtime Agents — Voice AI Agent Patterns > Advanced agentic patterns for voice AI built on OpenAI Realtime API. Chat-supervisor and sequential handoff patterns with WebRTC streaming. MIT, 6,800+ stars. ## Install Save as a script file and run: ## Quick Use 1. Clone and install: ```bash git clone https://github.com/openai/openai-realtime-agents.git cd openai-realtime-agents npm i ``` 2. Set your API key: ```bash export OPENAI_API_KEY=sk-your-key-here ``` 3. Run the demo: ```bash npm run dev # Open http://localhost:3000 ``` --- ## Intro OpenAI Realtime Agents is an official OpenAI demo showcasing advanced agentic patterns for voice AI with 6,800+ GitHub stars. It demonstrates two key patterns: Chat-Supervisor (a realtime voice agent delegates complex tasks to a smarter text model like GPT-4.1) and Sequential Handoff (specialized agents transfer users between each other based on intent). Built with the OpenAI Agents SDK and WebRTC voice streaming. Best for developers building voice-enabled AI applications, customer service bots, or multi-agent voice systems. See more agent frameworks on [TokRepo Agent Toolkit](https://tokrepo.com/en/@Agent%20Toolkit). --- ## OpenAI Realtime Agents — Voice AI Agent Architecture ### Two Agent Patterns #### 1. Chat-Supervisor Pattern A realtime voice agent handles user conversation and basic tasks, while a more intelligent text-based supervisor model (GPT-4.1) handles complex tool calls and decision-making. ``` User ←→ [Voice Agent (realtime)] ←→ [Supervisor (GPT-4.1)] ↓ ↓ Basic tasks Complex reasoning Voice I/O Tool calls ``` **When to use**: When you need natural voice interaction but also complex reasoning that requires a more capable model. #### 2. Sequential Handoff Pattern Specialized agents transfer users between them based on detected intent. Inspired by the OpenAI Swarm pattern. ``` User → [Greeter Agent] → [Sales Agent] → [Support Agent] ↓ ↓ ↓ Route intent Handle sales Handle support ``` **When to use**: When different conversation stages require different expertise (e.g., routing → sales → support). ### Key Technologies | Technology | Purpose | |------------|---------| | OpenAI Realtime API | Low-latency voice streaming | | OpenAI Agents SDK | Multi-agent orchestration | | WebRTC | Browser-based voice I/O | | GPT-4.1 | Text-based supervisor reasoning | ### Setup ```bash git clone https://github.com/openai/openai-realtime-agents.git cd openai-realtime-agents npm i export OPENAI_API_KEY=sk-your-key npm run dev ``` ### FAQ **Q: What is OpenAI Realtime Agents?** A: An official OpenAI demo showing how to build sophisticated voice AI agents using the Realtime API and Agents SDK, with patterns like chat-supervisor hierarchies and sequential handoffs. **Q: Is it free to use?** A: The code is MIT licensed. You pay for OpenAI API usage (Realtime API pricing applies). **Q: Can I use this in production?** A: It's a demo/reference implementation. Use the patterns and architecture in your own production applications. --- ## Source & Thanks > Created by [OpenAI](https://github.com/openai). Licensed under MIT. > > [openai-realtime-agents](https://github.com/openai/openai-realtime-agents) — ⭐ 6,800+ Thanks to Noah MacCallum, Ilan Bigio, and the OpenAI team for demonstrating production voice AI patterns. --- ## 快速使用 1. 克隆并安装: ```bash git clone https://github.com/openai/openai-realtime-agents.git cd openai-realtime-agents npm i ``` 2. 设置 API 密钥并运行: ```bash export OPENAI_API_KEY=sk-your-key npm run dev ``` --- ## 简介 OpenAI Realtime Agents 是 OpenAI 官方的语音 AI Agent 高级模式演示,GitHub 6,800+ star。展示两种关键模式:Chat-Supervisor(语音 Agent + 智能文本模型协作)和 Sequential Handoff(按意图在专业 Agent 间转移用户)。基于 OpenAI Agents SDK 和 WebRTC 语音流。适合构建语音 AI 应用、客服机器人或多 Agent 语音系统的开发者。 --- ## OpenAI Realtime Agents — 语音 AI Agent 架构 ### 两种 Agent 模式 #### 1. Chat-Supervisor 模式 语音 Agent 处理用户对话和基础任务,智能文本模型(GPT-4.1)处理复杂推理和工具调用。 #### 2. Sequential Handoff 模式 专业 Agent 根据检测到的意图在彼此之间转移用户(问候→销售→支持)。 ### FAQ **Q: OpenAI Realtime Agents 是什么?** A: OpenAI 官方演示,展示如何用 Realtime API 和 Agents SDK 构建复杂语音 AI Agent。 **Q: 可以用于生产吗?** A: 这是参考实现,可以将模式和架构应用到自己的生产应用中。 --- ## 来源与感谢 > Created by [OpenAI](https://github.com/openai). Licensed under MIT. > > [openai-realtime-agents](https://github.com/openai/openai-realtime-agents) — ⭐ 6,800+ --- Source: https://tokrepo.com/en/workflows/0d228731-33e3-11f1-9bc6-00163e2b0d79 Author: Agent Toolkit