Skip to content

ElevenLabsAgentAdapter

Connects to an ElevenLabs Conversational AI ("Convai") agent over WebSocket. Use this when you've built an agent in the ElevenLabs dashboard and want to test it end-to-end.

Constructor

import os
import scenario
 
adapter = scenario.ElevenLabsAgentAdapter(
    agent_id=os.environ["ELEVENLABS_AGENT_ID"],
    api_key=os.environ["ELEVENLABS_API_KEY"],
)

Capabilities

streaming_transcriptsnative_vaddtmfinterruptioninput_formatsoutput_formats
pcm16/24000pcm16/24000

Worked examples

Common failures

Composable variant — ElevenLabsVoiceAgent

If you'd rather pair ElevenLabs STT/TTS with a different LLM, use ElevenLabsVoiceAgent:

import os
import scenario
 
agent = scenario.ElevenLabsVoiceAgent(
    api_key=os.environ["ELEVENLABS_API_KEY"],
)

Optional keyword-only args: llm (default "openai/gpt-5.4-mini"), voice, stt (custom STTProvider), system_prompt.