echoing-football-29763
03/25/2026, 8:18 PMtall-airline-16756
03/25/2026, 8:19 PMtall-airline-16756
03/25/2026, 8:20 PMuv add "livekit-agents[elevenlabs]~=1.4"
1. Set your ElevenLabs API key in your environment:
◦ Add to your .env file:
ELEVEN_API_KEY=your_elevenlabs_api_key
1. Configure the plugin in your agent code:
◦ Example usage:
from livekit.plugins import elevenlabs
session = AgentSession(
tts=elevenlabs.TTS(
voice_id="ODq5zmih8GrVes37Dizd",
model="eleven_multilingual_v2"
)
# ... llm, stt, etc.
)
• Pick a model such as eleven_flash_v2_5, eleven_multilingual_v2, or eleven_turbo_v2.
• Use voice_id for the specific custom voice you want to use.
• Optional: set voice_settings (stability, similarity_boost, style, speed), language, enable_ssml_parsing, and chunk_length_schedule as needed.
Notes and tips
• Custom/community voices require a paid ElevenLabs plan; ensure your ElevenLabs account and API key have access to the voice(s) you intend to use.
• If you only need basic/default voices and want to avoid managing your own ElevenLabs key, use LiveKit Inference.
• If you plan to stream audio with low latency, you can tune streaming latency and chunking settings in the plugin.
If you want, tell me:
• Which route you prefer (LiveKit Inference or Direct plugin), and
• The language/model/voice_id you intend to use (or whether you need help finding the voice_id),
and I’ll give the exact code snippet or walk through any errors you run into.
Sources: ElevenLabs TTS | LiveKit Documentation, with interactive elementsechoing-football-29763
03/25/2026, 8:33 PMtall-airline-16756
03/25/2026, 8:33 PMELEVEN_API_KEY=your_elevenlabs_api_key
• The ElevenLabs plugin reads this environment variable when running your agent or server.
2) Install and configure the ElevenLabs plugin in your agent/service
• Install the plugin for your environment (example for LiveKit agents):
uv add "livekit-agents[elevenlabs]~=1.4"
• In your backend agent/server code, configure TTS using the ElevenLabs plugin. Example (Python-style snippet):
from livekit.plugins import elevenlabs
session = AgentSession(
tts=elevenlabs.TTS(
voice_id="ODq5zmih8GrVes37Dizd",
model="eleven_multilingual_v2"
)
# ... llm, stt, etc.
)
• Choose an appropriate model (eleven_flash_v2_5, eleven_multilingual_v2, eleven_turbo_v2) and the voice_id for the custom voice you want. Optional settings: voice_settings, enable_ssml_parsing, chunk_length_schedule, and streaming latency.
3) Frontend (web LiveKit experience)
• The browser app should never contain the ElevenLabs API key.
• Frontend connects to LiveKit / your agent backend using tokens generated by your backend. Typical flow:
a. User opens web app and requests to join a room or use a voice agent.
b. Frontend calls your backend endpoint to request a LiveKit token / agent session.
c. Backend (which has ELEVEN_API_KEY) creates/returns a token and triggers the agent that will call ElevenLabs for TTS.
d. Frontend uses the token to connect to LiveKit and receives audio streams produced by the backend/agent.
4) If you prefer no-server setup for simple/default voices
• Use LiveKit Inference from the LiveKit web Agent Builder or Inference integrations. No ElevenLabs key is required; LiveKit handles access and billing, but custom/community voices are not supported.
What I can help with next
• Show the exact backend code snippet for your stack (Node or Python) to read ELEVEN_API_KEY, initialize the plugin, and produce TTS.
• Walk through the token endpoint pattern your frontend should call to obtain a LiveKit token / start an agent session.
• Help pick a model/voice_id or show how to test audio output.
Which would you like me to show next: a Node.js or Python backend example for wiring the ElevenLabs plugin and the LiveKit token endpoint?
Sources: ElevenLabs TTS | LiveKit Documentation | ElevenLabs STT | LiveKit Documentation | TTS Translator with Gladia STT | LiveKit Documentation | Web and mobile frontends | LiveKit Documentation | Examples | livekit/livekit_composite | DeepWiki, with interactive elements