Skip to main content
ElevenLabs Conversational AI lets you create voice agents with cloned or synthetic voices. By pointing an ElevenLabs agent at Pria’s Chat Completions API as a Custom LLM, your Digital Twin becomes the brain behind a real-time voice experience — no additional backend code required.
This integration combines ElevenLabs’ voice synthesis and real-time audio with your Digital Twin’s knowledge, personality, and tools.

How It Works

ElevenLabs Agent

Handles voice input/output, speech-to-text, text-to-speech, and the real-time audio stream.

Chat Completions API

Receives OpenAI-compatible requests from ElevenLabs and routes them to your Digital Twin.

Digital Twin

Generates intelligent responses using its knowledge base, tools, assistants, and conversation memory.

Prerequisites

Before you begin, make sure you have:
  • An ElevenLabs account with access to Conversational AI Agents
  • Created a voice in Eleven Labs and trained it
  • A Praxis AI account with at least one Digital Twin configured
  • Your Digital Twin’s Public ID (a UUID found in the administration panel)

Step 1: Create an ElevenLabs Agent

Custom LLM
1

Go to the ElevenLabs Dashboard

Navigate to Conversational AI in your ElevenLabs account and create a new agent.
2

Choose a voice

Select a stock voice, or use ElevenLabs’ voice cloning to create a custom voice that matches your Digital Twin’s persona.
3

Configure the system prompt

The Digital Twin manages its own system instructions server-side. Use the ElevenLabs system prompt for voice-specific behavior only (e.g., greeting style, conversation pacing).
4

First Message

Type a greeting, for example Hey there, ready to learn something new together?
5

LLM

Select Custom LLM

Step 2: Connect to Custom LLM

This is the core configuration — tell your ElevenLabs agent to use your Digital Twin as its language model. Custom LLM
1

Open LLM settings

In your agent’s settings, go to the LLM section and select Custom LLM.
2

Set the Server URL

Enter your Chat Completions API base URL:
3

Set the Model ID

Enter your Digital Twin’s Public ID as the model:
The Model ID maps directly to the Digital Twin Public ID. ElevenLabs will include this in every request as the model parameter — exactly how the Chat Completions API expects it.
4

API Key

In the API Key section of your ElevenLabs custom-LLM dashboard, select your ElevenLabs API Key or create a new one.Elevenlab API Secret
You must also set this value in your Digital Twin configuration page in Praxis.

Step 3: Configure Dynamic Variables

Dynamic variables let you pass user identity and conversation context from the client application through ElevenLabs to your Digital Twin. These are mapped to the x-praxis-* request headers that the Chat Completions API forwards to Praxis.

Define Variables in ElevenLabs

Custom Variable In your agent’s settings, define the custom header mapping to dynamic variables:
The x_access_token dynamic variable corresponds to the user’s access token from Praxis and is passed through to allow the Chat Completions API to seamlessly connect to your Digital Twin assuming the user’s identity.
This is the example JSON configuration for your Agent’s custom LLM: Example Configuration JSON
Don’t forget to publish your changes after making updates.

How Variables Flow

When using the Extra Body option in ElevenLabs, dynamic variables are included in the request body under elevenlabs_extra_body:

Step 4: Configure Your Digital Twin

After setting up the ElevenLabs agent, you must configure your Digital Twin in Praxis to accept requests from ElevenLabs. Digital Twin Setup for Elevenlabs
1

Open the Admin Dashboard

Navigate to the Admin dashboard and select your Digital Twin instance.
2

Go to Configuration

Open the Configuration tab and locate the ElevenLabs section.
3

Set the ElevenLabs Agent ID

Enter the Agent ID from your ElevenLabs Conversational AI agent. This is the identifier shown in your ElevenLabs dashboard under the agent settings.
4

Set the ElevenLabs API Key

Enter the same API Key you configured in Step 2. This allows the Chat Completions API to validate inbound requests from ElevenLabs.
See Configuration — ElevenLabs for full details on the credential fields (Agent ID and API Key).

Step 5: Use ElevenLabs for Convo Mode

Once the ElevenLabs agent is configured in your Digital Twin, you can select ElevenLabs as the voice provider for Pria’s built-in Convo Mode (speech-to-speech). Digital Twin Convo with Elevenlabs
1

Open Personalization

In the Admin dashboard, select your Digital Twin instance and navigate to the Personalization tab.
2

Change the Convo Mode model

Under Convo Mode, select ElevenLabs from the list of supported voice providers.
If ElevenLabs is selected as the voice provider but the Agent ID or API Key are not configured in the Configuration tab, a warning pill will appear directing you to complete the ElevenLabs setup in Configuration.
3

Start a conversation

The Convo widget will now use your ElevenLabs agent for real-time speech-to-speech. Users can click the Convo button to speak directly with the Digital Twin.
Voice selection is not available in ElevenLabs Convo Mode. The voice used is the one configured in your agent’s settings on the ElevenLabs dashboard. To change the voice, update it in your ElevenLabs agent configuration.

Connection Method

ElevenLabs supports two connection methods for the audio stream between the browser and ElevenLabs servers: The connection method can be configured in the Convo Mode settings. If users report connection issues in corporate or campus networks, switching to WebSocket typically resolves the problem.

Step 6: Deploy Client Widgets (optional)

ElevenLabs provides multiple ways to embed a voice agent in your application. Each method supports passing dynamic variables at session start.

HTML Widget

The simplest option — add two lines to any web page:
Pin to a specific version for production: @elevenlabs/convai-widget-embed@1.0.0

React Integration

For React applications, use the @elevenlabs/react package with dynamic variables:
Install the dependency:

JavaScript SDK (Vanilla)

For non-React applications, use the @elevenlabs/client SDK directly:
Install the dependency:

Securing Private Agents

For production deployments, use signed URLs to prevent unauthorized access to your ElevenLabs agent.
1

Generate a signed URL on your server

2

Use the signed URL on the client

Never expose your ElevenLabs API key in client-side code. Always generate signed URLs from your backend. Signed URLs expire after 15 minutes.
You can also configure an allowlist of approved domains in your agent’s Security tab to restrict where the widget can be embedded.

Full Example: Embeddable Support Widget

A complete React component that authenticates with your backend, starts a voice session with a Digital Twin, and displays the conversation transcript:

Troubleshooting