All guides
TOOL · LIVEKIT · INTERMEDIATE

LiveKit: voice agents that answer in 300ms.

Real-time voice over WebRTC. Stitched to Deepgram (STT) + Claude (brain) + ElevenLabs (TTS). Sub-second latency. Same stack the AI receptionists use.

▸ When you're done

A voice agent your phone or browser can talk to. It hears you, thinks with Claude, replies in a chosen voice. Free tier covers your first 10,000 minutes.

18 min walkthrough
4 tools · all free tier
Copy-paste ready · no theory
The stack
◢ The build · 4 steps · 18 min

Follow these in order. Don't skip.

Step 01 / 04

Create your LiveKit Cloud project

Create a LiveKit Cloud project
STEP 01
livekit.io → Sign up → Create Project. Pick the region closest to your users.
LiveKit API keys page
STEP 01
Project → Settings → Keys. Create a new key. Copy the URL, key, secret.
.env.local
1LIVEKIT_URL=wss://your-project.livekit.cloud
2LIVEKIT_API_KEY=APIxxxxxx
3LIVEKIT_API_SECRET=secretxxxxxx
4DEEPGRAM_API_KEY=...
5ELEVENLABS_API_KEY=...
6ANTHROPIC_API_KEY=...
Step 02 / 04

Install the LiveKit Agents Python SDK

The Agents SDK handles the audio loop — capture, send to STT, get LLM response, stream to TTS — so you write one Python file.

Terminal
1# In a fresh agent/ folder
2python3 -m venv .venv
3source .venv/bin/activate
4
5pip install livekit-agents \
6 "livekit-plugins-anthropic" \
7 "livekit-plugins-deepgram" \
8 "livekit-plugins-elevenlabs" \
9 "livekit-plugins-silero" \
10 python-dotenv
Step 03 / 04

Write the agent in ~40 lines

agent/main.py
1import asyncio
2from dotenv import load_dotenv
3from livekit import agents
4from livekit.agents import AutoSubscribe, JobContext, llm
5from livekit.agents.voice_assistant import VoiceAssistant
6from livekit.plugins import anthropic, deepgram, elevenlabs, silero
7
8load_dotenv()
9
10async def entrypoint(ctx: JobContext):
11 initial_ctx = llm.ChatContext().append(
12 role="system",
13 text=(
14 "You are a friendly receptionist. Answer in 1-2 short sentences. "
15 "If the caller wants to book, ask for their name and preferred day."
16 ),
17 )
18
19 await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
20
21 assistant = VoiceAssistant(
22 vad=silero.VAD.load(),
23 stt=deepgram.STT(model="nova-3"),
24 llm=anthropic.LLM(model="claude-sonnet-4-6-20250101"),
25 tts=elevenlabs.TTS(voice="Rachel"),
26 chat_ctx=initial_ctx,
27 )
28
29 assistant.start(ctx.room)
30 await asyncio.sleep(1)
31 await assistant.say("Hi — thanks for calling. How can I help?", allow_interruptions=True)
32
33
34if __name__ == "__main__":
35 agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
Step 04 / 04

Run the agent locally and talk to it

Terminal
1# Run the agent worker (it connects to LiveKit Cloud and waits for rooms)
2python agent/main.py dev
  • Now go to playground.livekit.io
  • Sign in with the same project's URL + key
  • Click "Connect" → it joins a room and your agent picks up
  • Speak into your mic — the agent responds in 300–600ms
You're done when
That's it. Your voice agent works. Hook it to Twilio for phone numbers, plug in tools (calendar, CRM) via function calling, deploy it as a worker on Render or Fly.
Ship-it checklist
5 CHECKS
  • LiveKit Cloud project created, keys in .env.local
  • Deepgram + ElevenLabs + Anthropic keys set
  • Python venv with livekit-agents installed
  • agent/main.py runs without errors
  • You spoke to the agent through playground.livekit.io and it responded