🎧 LiveKit Voice
LiveKit real-time voice/video infrastructure for OpenClaw agents. Create rooms, generate tokens, manage participants, and integrate with voice AI platforms.
What is LiveKit?
LiveKit is an open-source WebRTC infrastructure platform for building real-time audio/video applications. It powers voice AI agents, video conferencing, live streaming, and more.
Self-hosted vs Cloud:
- - LiveKit Cloud — Managed service, no infrastructure to maintain
- Self-hosted — Deploy on your own servers via Docker/Kubernetes
Requirements
| Variable | Required | Description |
|---|
| INLINECODE0 | ✅ | LiveKit API key |
| INLINECODE1 |
✅ | LiveKit API secret |
|
LIVEKIT_URL | ✅ | LiveKit server URL (e.g.
wss://your-project.livekit.cloud) |
Quick Start
CODEBLOCK0
Commands
create-room <name>
Create a new LiveKit room.
- -
--max-participants N — limit participants - INLINECODE6 — seconds before empty room auto-closes (default 300)
token <room>
Generate a JWT access token for a participant.
- -
--identity ID — participant identity (required) - INLINECODE9 — display name
- INLINECODE10 — allow publishing audio/video
- INLINECODE11 — allow subscribing to others
- INLINECODE12 — token TTL in seconds (default 3600)
list-rooms
List all active rooms with participant counts.
participants <room>
List participants in a room with their connection state and tracks.
delete-room <name>
Delete/close a room and disconnect all participants.
record <room>
Start an Egress recording of a room.
- -
--output URL — output destination (S3, GCS, or local path)
Voice AI Integration
LiveKit is the backbone for many voice AI platforms:
- - Vapi — Uses LiveKit for real-time voice AI agent calls
- ElevenLabs — Stream TTS audio into LiveKit rooms
- OpenAI Realtime — Connect GPT-4o voice to LiveKit participants
Agent Pattern
- 1. Create a LiveKit room
- Generate tokens for both human and AI agent
- AI agent joins, subscribes to human audio
- Process audio → STT → LLM → TTS → publish back
- Result: real-time voice conversation with AI
Credits
Built by
M. Abidi |
agxntsix.ai
YouTube |
GitHub
Part of the
AgxntSix Skill Suite for OpenClaw agents.
📅 Need help setting up OpenClaw for your business? Book a free consultation
🎧 LiveKit 语音
为 OpenClaw 智能体提供 LiveKit 实时语音/视频基础设施。可创建房间、生成令牌、管理参与者,并与语音 AI 平台集成。
什么是 LiveKit?
LiveKit 是一个开源的 WebRTC 基础设施平台,用于构建实时音频/视频应用。它为语音 AI 智能体、视频会议、直播等场景提供支持。
自托管 vs 云服务:
- - LiveKit 云服务 — 托管服务,无需维护基础设施
- 自托管 — 通过 Docker/Kubernetes 部署在自己的服务器上
环境要求
| 变量 | 必需 | 描述 |
|---|
| LIVEKITAPIKEY | ✅ | LiveKit API 密钥 |
| LIVEKITAPISECRET |
✅ | LiveKit API 密钥 |
| LIVEKIT_URL | ✅ | LiveKit 服务器 URL(例如 wss://your-project.livekit.cloud) |
快速开始
bash
创建房间
python3 {baseDir}/scripts/livekit_api.py create-room my-room
带选项创建房间
python3 {baseDir}/scripts/livekit_api.py create-room my-room --max-participants 10 --empty-timeout 300
为参与者生成访问令牌
python3 {baseDir}/scripts/livekit_api.py token my-room --identity user123 --name John
生成带特定权限的令牌
python3 {baseDir}/scripts/livekit_api.py token my-room --identity agent --can-publish --can-subscribe
列出活跃房间
python3 {baseDir}/scripts/livekit_api.py list-rooms
列出房间内的参与者
python3 {baseDir}/scripts/livekit_api.py participants my-room
删除房间
python3 {baseDir}/scripts/livekit_api.py delete-room my-room
开始录制(Egress)
python3 {baseDir}/scripts/livekit_api.py record my-room --output s3://bucket/recording.mp4
命令
create-room <名称>
创建新的 LiveKit 房间。
- - --max-participants N — 限制参与者数量
- --empty-timeout N — 空房间自动关闭前的等待秒数(默认 300)
token <房间>
为参与者生成 JWT 访问令牌。
- - --identity ID — 参与者身份标识(必需)
- --name NAME — 显示名称
- --can-publish — 允许发布音频/视频
- --can-subscribe — 允许订阅其他参与者
- --ttl N — 令牌有效期(秒,默认 3600)
list-rooms
列出所有活跃房间及其参与者数量。
participants <房间>
列出房间内的参与者及其连接状态和轨道信息。
delete-room <名称>
删除/关闭房间并断开所有参与者连接。
record <房间>
开始房间的 Egress 录制。
- - --output URL — 输出目标(S3、GCS 或本地路径)
语音 AI 集成
LiveKit 是许多语音 AI 平台的骨干基础设施:
- - Vapi — 使用 LiveKit 进行实时语音 AI 智能体通话
- ElevenLabs — 将 TTS 音频流传输到 LiveKit 房间
- OpenAI Realtime — 将 GPT-4o 语音连接到 LiveKit 参与者
智能体模式
- 1. 创建 LiveKit 房间
- 为人类和 AI 智能体生成令牌
- AI 智能体加入,订阅人类音频
- 处理音频 → STT → LLM → TTS → 发布回房间
- 结果:与 AI 进行实时语音对话
致谢
由
M. Abidi 构建 |
agxntsix.ai
YouTube |
GitHub
属于 OpenClaw 智能体的
AgxntSix 技能套件 的一部分。
📅 需要为您的业务设置 OpenClaw? 预约免费咨询