Skip to main content
ElevenLabs Conversational AI lets you create voice agents with cloned or synthetic voices. ElevenLabs agents normally think using a model you choose from their list. Instead, you point the agent at Pria’s Chat Completions API — ElevenLabs calls this a Custom LLM — so your Digital Twin does the thinking, with all its knowledge and tools, while ElevenLabs handles listening and speaking. 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
  • A voice created (and, if cloned, trained) in ElevenLabs
  • 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:
ElevenLabs includes this value as the model parameter on every request. Note that the Digital Twin that actually serves the request is resolved from the user’s x_access_token — or the x-praxis-institution-public-id header when targeting a specific Twin — as described in the Chat Completions API docs.
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
Save this same API Key in your Digital Twin’s configuration in Praxis (see Step 4) — Pria uses it server-side to start Convo Mode sessions with your agent.

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:
x_access_token carries the signed-in user’s own Praxis token. Pria uses it to answer as that user — with their permissions and their conversation history — so the voice agent never has more access than the person using it.
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

Pria reads the context exclusively from the x-praxis-* HTTP headers, so configure the custom-header mapping shown above. ElevenLabs’ Extra Body option (which copies dynamic variables into the request body under elevenlabs_extra_body) is not read by Pria — headers are the required channel.

Step 4: Configure Your Digital Twin

Now set the Praxis side up, in the Admin dashboard with your Digital Twin open. Digital Twin Setup for Elevenlabs
The order matters. The ElevenLabs credential fields don’t exist until the twin is set to speak through ElevenLabs — so turn Convo on and pick the model first, and the boxes appear.
1

Turn on the Chat Completions endpoint

On Configuration and Integrations, in the Chat Completion section, tick Enable Chat Completion endpoint.
This one is easy to miss and breaks everything. It is off until someone turns it on, and it’s the door ElevenLabs knocks on — without it every spoken turn is refused and your agent connects, listens, and then says nothing. See the Chat Completions API for the overrides it reveals.
2

Turn on Convo

Still on Configuration and Integrations, under Realtime / Convo, tick Enable Convo (Speech-to-Speech).
3

Choose ElevenLabs as the voice

On Personalization and AI Models, set Speech-to-Speech Model to an ElevenLabs model.Digital Twin Convo with Elevenlabs
4

Enter the credentials

Return to Configuration and Integrations, where an ElevenLabs Voice Cloning section has now appeared:
  • ElevenLabs Agent ID (for Digital Twin Voice) — the agent_… identifier from your ElevenLabs dashboard
  • ElevenLabs API Key — the same key from Step 2. Pria uses it server-side to start each conversation with your agent; it is never exposed to the browser
  • ElevenLabs Connection Method — see below
If ElevenLabs is the chosen voice but the Agent ID or API Key are missing, a warning pill appears pointing you back here.
5

Start a conversation

Users can now press the Convo button and speak to the Digital Twin.
See Configuration — ElevenLabs for full details on the credential fields.
You don’t pick the voice in Praxis. The voice is whichever one your ElevenLabs agent is set to — change it in your ElevenLabs agent configuration.

Connection Method

ElevenLabs Connection Method decides how the audio travels between the listener’s browser and ElevenLabs: Start on the default and only try WebRTC if you want to shave latency and your users aren’t behind restrictive networks. If you switched to WebRTC and people report connection failures, switch back.

Step 5: 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 on a live site: @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

On a live site, 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