*** title: Overview subtitle: ElevenLabs Agents in VoxEngine ---------------------------------------- ## Benefits The native ElevenLabs module connects Voximplant calls to ElevenLabs Agents for real-time, speech-to-speech conversations. The connector streams audio between Voximplant and ElevenLabs while keeping call control in VoxEngine. Capability and feature highlights: * Connect inbound and outbound calls to a single ElevenLabs agent ID. * Bi-directional audio streaming with low latency and built-in media conversion. * Barge-in support using interruption events and media buffer control. * Real-time events for transcripts, responses, tool calls, and diagnostics. * Client-side tool execution with `ClientToolCall` and `clientToolResult`. ## Architecture ElevenLabs Agents is a stateful WebSocket service. VoxEngine opens a session and streams audio while receiving audio, transcripts, and events on the same connection. ```mermaid graph LR Caller["PSTN/SIP/WhatsApp/WebRTC"] <-->|"Media + call control"| VoxEngine["VoxEngine Scenario"] VoxEngine <-->|"WebSocket: audio + events"| ElevenLabs["ElevenLabs Agents"] ``` ## Prerequisites * ElevenLabs API key * ElevenLabs Agent ID configured in the ElevenLabs console ## Development notes * **Native VoxEngine module**: load with `require(Modules.ElevenLabs)` and create an `ElevenLabs.AgentsClient` via `ElevenLabs.createAgentsClient({ xiApiKey, agentId })`. * **Agent configuration**: prompts, voices, and tools are configured in the [ElevenLabs Agent console](https://elevenlabs.io/app/agents/agents). Use `agentId` to select the agent to run. * **Barge-in**: listen for `ElevenLabs.AgentsEvents.Interruption` and call `agentsClient.clearMediaBuffer()` to stop current TTS audio. * **Context and user text**: optionally call `conversationInitiationClientData`, `contextualUpdate`, or `userMessage` to inject metadata or text. * **Function calling**: handle `ElevenLabs.AgentsEvents.ClientToolCall` and respond with `clientToolResult`. See the [ElevenLabs module API reference](https://voximplant.com/docs/references/voxengine/elevenlabs) for full details on methods, events, and types. ## Examples * [Example: Answering an incoming call](elevenlabs-agents-voice-ai-example-answering-incoming-call) * [Example: Placing an outbound call](elevenlabs-agents-voice-ai-example-placing-outbound-call) * [Example: Function calling](elevenlabs-agents-voice-ai-example-function-calling) ## Links ### Voximplant * ElevenLabs Agents docs: [https://voximplant.com/docs/voice-ai/elevenlabs](https://voximplant.com/docs/voice-ai/elevenlabs) * ElevenLabs module API reference: [https://voximplant.com/docs/references/voxengine/elevenlabs](https://voximplant.com/docs/references/voxengine/elevenlabs) * Voice AI product overview: [https://voximplant.ai/](https://voximplant.ai/) ### ElevenLabs * ElevenLabs documentation: [https://elevenlabs.io/docs](https://elevenlabs.io/docs)