jolly-autumn-53818
12/27/2025, 6:58 PMtall-airline-16756
12/27/2025, 6:58 PMtall-airline-16756
12/27/2025, 6:58 PMjolly-autumn-53818
12/27/2025, 7:02 PMtall-airline-16756
12/27/2025, 7:03 PMLIVEKIT_URL=<https://your-livekit-url>
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret
ELEVENLABS_API_KEY=your_elevenlabs_api_key
2) Install dependencies
Python:
pip install "livekit-agents[elevenlabs]" python-dotenv
Node.js:
pnpm add @livekit/agents @livekit/agents-plugin-elevenlabs
(If you use npm: npm install @livekit/agents @livekit/agents-plugin-elevenlabs.)
3) Minimal Python agent using ElevenLabs v3 (example)
• Save as agent.py:
from dotenv import load_dotenv
import os
from livekit.agents import AgentSession, JobContext, cli, function_tool
from livekit.plugins import elevenlabs, deepgram, silero
load_dotenv()
# Configure ElevenLabs TTS to use a v3 model (e.g., eleven_multilingual_v2 or eleven_turbo_v2)
tts = elevenlabs.TTS(
api_key=os.getenv("ELEVENLABS_API_KEY"),
model="eleven_multilingual_v2", # v3 model
voice_id="pNInz6obpgDQGcFmaJgB", # replace with desired voice id
language="es", # optional
streaming_latency=3,
enable_ssml_parsing=True
)
stt = deepgram.STT(api_key=os.getenv("DEEPGRAM_API_KEY", "")) # optional STT
llm = elevenlabs.LLM(api_key=os.getenv("ELEVENLABS_API_KEY")) # or other LLM plugin
class MyAgent:
async def on_enter(self, session: AgentSession):
await session.say("Hello — this agent uses ElevenLabs v3 TTS.")
@cli.entrypoint
def entrypoint(ctx: JobContext):
session = AgentSession(stt=stt, llm=llm, tts=tts, vad=silero.VAD.load())
return session
• Run:
python agent.py dev
4) Minimal Node.js agent using ElevenLabs v3 (example)
• Save as agent.mjs:
import 'dotenv/config';
import * as lk from '@livekit/agents';
import ElevenLabsPlugin from '@livekit/agents-plugin-elevenlabs';
const plugin = new ElevenLabsPlugin({ apiKey: process.env.ELEVENLABS_API_KEY });
lk.plugins.registerPlugin(plugin);
class MyAgent extends lk.Agent {
constructor() {
super();
this.tts = new plugin.TTS({
model: 'eleven_multilingual_v2', // v3 model
voice: { id: 'pNInz6obpgDQGcFmaJgB' }, // replace with desired voice id
language: 'es'
});
}
async onEnter() {
await this.session.say('Hello — this agent uses ElevenLabs v3 TTS.');
}
}
lk.registerAgent(MyAgent);
• Run:
npx @livekit/agents-cli agent.mjs
5) If you need custom behavior, create a small wrapper plugin (Python sketch)
from livekit.agents import tts
from livekit.plugins.elevenlabs import TTS as BaseEleven
class CustomElevenTTS(tts.TTS):
def __init__(self, api_key, model="eleven_multilingual_v2", voice_id=None):
super().__init__(streaming=True, sample_rate=24000, num_channels=1)
self.base = BaseEleven(api_key=api_key, model=model, voice_id=voice_id)
async def synthesize(self, text: str):
# optional preprocess or SSML handling
return await self.base.synthesize(text)
Register and pass this CustomElevenTTS into your AgentSession.
6) Run & connect to a LiveKit room
• Start your agent (see run commands above).
• Confirm the agent worker connects to LiveKit Cloud and joins a room.
• Use Cloud Builder Preview or a test client to join the room and trigger the agent voice.
7) Verify ElevenLabs v3 usage
• Check outgoing API calls to ElevenLabs in your agent logs; request body should include the chosen model (e.g., eleven_multilingual_v2 or eleven_turbo_v2).
• Optionally verify in your ElevenLabs account/API dashboard that requests are arriving and billed against v3 models.
• Listen to audio output to confirm expected voice/model quality.
Notes and quick tips
• Replace sample voice IDs with ones from your ElevenLabs account.
• If you rely on streaming TTS, set streaming=True and confirm your audio sample rate matches the agent session.
• Cloud Builder UI currently does not expose ElevenLabs v3 models directly — the SDK/plugin approach is the supported path for v3.
If you want, I can:
• Provide a ready-to-run GitHub-style repo layout and Dockerfile.
• Give a prefilled Python or Node.js template with common voice IDs and SSML examples.
Which would you like next?
Sources: Pipeline Translator Agent | LiveKit docs | ElevenLabs TTS plugin guide | LiveKit docs | Agents (Node.js) | livekit/livekit_composite | DeepWiki | TTS Comparison | LiveKit docs