How do I connect ellevenlabs v3 model in cloud bui...
# ask-ai
j
How do I connect ellevenlabs v3 model in cloud builder
t
Thanks for reaching out, David. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you’re asking how to connect the ElevenLabs v3 TTS model in Cloud Builder. I looked at the Models & Voice UI you shared. Short answer: ElevenLabs v3 is not listed in the Cloud Builder TTS model dropdown. The Cloud Builder UI currently shows ElevenLabs v2 / v2.5 models (e.g., Eleven Flash v2.5, Eleven Turbo v2.5, Eleven Multilingual v2), so v3 is not available there. Options you can take next: • Use one of the listed ElevenLabs models in Cloud Builder (select it under Models & Voice → Text-to-speech and click START CALL to preview). • If you must use ElevenLabs v3, you can integrate it outside Cloud Builder via a custom provider or SDK plugin. I can provide step‑by‑step instructions for using the ElevenLabs plugin/SDK to call v3 (authentication, request examples, and wiring it into an agent pipeline). Which would you like: help selecting/configuring a listed ElevenLabs voice in Cloud Builder, or detailed SDK/plugin steps to integrate ElevenLabs v3? Sources: Text-to-speech (TTS) models | LiveKit Docs | Speech-to-text (STT) models | LiveKit Docs | ElevenLabs TTS plugin guide | LiveKit docs
j
Yeah do the step by step
t
Great — I’ll walk you through a concise step-by-step guide to integrate ElevenLabs v3 TTS into a LiveKit voice agent using the SDK (both Python and Node.js examples). I’ll include environment setup, dependency install, sample agent code to call ElevenLabs v3, how to run it, and how to verify it’s using v3. Before you start, make sure you have: • LiveKit Cloud project credentials (URL, API key, API secret). • ElevenLabs API key. • Python 3.10+ or Node.js 18+ and a package manager (pip/uv/pnpm/npm). 1) Create a .env file • Add your keys:
Copy code
LIVEKIT_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:
Copy code
pip install "livekit-agents[elevenlabs]" python-dotenv
Node.js:
Copy code
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:
Copy code
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:
Copy code
python agent.py dev
4) Minimal Node.js agent using ElevenLabs v3 (example) • Save as agent.mjs:
Copy code
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:
Copy code
npx @livekit/agents-cli agent.mjs
5) If you need custom behavior, create a small wrapper plugin (Python sketch)
Copy code
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