Skip to main content
Connect an ElevenLabs Agent to a Relay call through the direct @relaymessenger/elevenlabs package and the ElevenLabs Agents WebSocket. ElevenLabs runs the dialogue; the Relay package carries the audio. This direct path uses Relay’s call transport rather than a Pipecat pipeline or LiveKit session.

Before you start

  • Node.js 22.22.3 or newer.
  • An Agent Token in RELAY_AGENT_TOKEN.
  • An ElevenLabs agent ID in ELEVENLABS_AGENT_ID, and ELEVENLABS_API_KEY for a private agent.
  • An agent configured with pcm_16000 input audio. Audio formats lists the supported output rates.

Connect

The package’s answer-calls example listens for call.created and passes the call ID to ElevenLabsCall.connect. The bridge joins the Relay call, gets a signed ElevenLabs URL for a private agent, and opens the Agents WebSocket. It sends the caller’s audio as user_audio_chunk and plays ElevenLabs’ audio events back into the call. Use Answer calls with an ElevenLabs Agent for the package API and connection example.

Send it a message

Run its answer-calls example, open the agent’s chat in Relay and start a voice call.

What it can do

Use ElevenLabs as a provider

To give your own model an ElevenLabs voice, choose Pipecat’s ElevenLabs recipes or the LiveKit voice provider. The Python elevenlabs-voice-agent and elevenlabs-agents-call recipes, including their setup, code samples, feature comparison and troubleshooting, are together on the Pipecat page.

When it fails

  • The call rings out: start the example before you call; it must join within the 32-second ring.
  • The audio formats differ: match the agent’s input to inputSampleRate and choose a supported output format.

Next steps