Skip to navigation

Interactive Avatar: Let Synthesia host the room

Start a session from your backend, and let Synthesia run the room.

When Synthesia hosts the room, your agent joins it. Your agent still does the thinking: it listens, decides what to say and speaks. You don’t set up a LiveKit project or mint any room tokens. You only manage your agent.

Choose this route if you want the quickest way to a working session. If you already run your own LiveKit room, or build on Pipecat, use the bring-your-own integration instead. Choosing a route compares the two.

Choosing a route

When you create an API deployment in Studio, you choose how your agent connects.

Synthesia hosts the roomYou host the room
Best forThe quickest start. Recommended.Adding the avatar to a room you already host.
The roomSynthesia runs it. No LiveKit to set up.You run it, on LiveKit or Pipecat.
From SynthesiaThe avatar and the roomThe avatar and the plugin
From youYour agentYour agent and your room
Start a session withdeploymentIdavatarIds, livekitUrl and livekitToken

Set up a deployment

You do these steps in Studio. A deployment holds the settings for your agent. Right now that’s the avatar.

  1. Pick the avatar. Open your deployment and choose the avatar people see in the session. When you change it, new sessions use the new avatar right away.
  2. Create an API key. Create one in Studio if you don’t have one yet. Keep the key on your backend.
  3. Copy the deployment ID. It starts with dep_. Your backend sends it to start a session. It isn’t a secret.

Start a session

Send the request from your backend, with the deployment ID and one of your API keys. Billing starts when your agent joins.

curl -X POST https://developers.synthesia.io/api/interactive-avatars/sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"deploymentId": "dep_YOUR_DEPLOYMENT_ID"}'

Send deploymentId on its own. A request that also has avatarIds, livekitUrl or livekitToken fails with 400 validation_error. Your key needs the interactive_avatars:write scope.

The response is a session with a connection object:

{
"id": "ses_6f2a91c04b8d4e37",
"status": "active",
"createdAt": "2026-09-10T09:30:00Z",
"connection": {
"livekitUrl": "wss://synthesia.livekit.cloud",
"participantToken": "<join-only token for your end user>",
"joinBy": "2026-09-10T09:31:00Z",
"agentToken": "<token for your agent>",
"agentIdentity": "<identity the agent token grants>"
}
}
FieldWhat it is
livekitUrlThe WebSocket URL of the room.
participantTokenA join-only token. Hand it to your end user’s client.
joinByJoin before this time, or the session ends. A session that nobody joins ends on its own.
agentTokenA LiveKit access token for your own agent.
agentIdentityThe participant identity that agentToken grants.

Connect your client and your agent

Two things join the room, and each one uses its own token from the connection object.

Who joinsUsesHow
Your end user’s clientlivekitUrl and participantTokenYou build the screen with the LiveKit client SDK. The avatar appears as a normal participant, so you don’t need Synthesia-specific frontend code.
Your agentlivekitUrl and agentTokenYour agent joins with the agent token, under the agentIdentity participant identity.

Join before joinBy, or the session ends. Billing starts when your agent joins.

Example: join from the browser

Your backend starts the session and hands each token to the right place. The end user’s client gets livekitUrl and participantToken, and your agent process gets livekitUrl and agentToken. Never send agentToken to a browser.

In the browser, join with the LiveKit client SDK and show the avatar’s video and audio:

import { Room, RoomEvent } from "livekit-client";
// livekitUrl and participantToken come from your backend.
const room = new Room();
room.on(RoomEvent.TrackSubscribed, (track) => {
// The avatar's video and audio arrive as normal tracks.
document.getElementById("avatar").appendChild(track.attach());
});
await room.connect(livekitUrl, participantToken);

Your agent publishes its speech audio to the room, and the avatar lip-syncs to it. This is the same as in the bring-your-own route, except that Synthesia runs the room. The user hears the audio from the avatar, so the voice and the lips stay in sync.

Set call limits

In your deployment’s Call limits section, you choose when conversations with the avatar end.

SettingDefaultOther optionsWhat it does
Session length20 minutes2, 5, 10 or 15 minutesThe longest a single session can run.
Inactivity timeout5 minutes1, 2, 3 or 10 minutesHow long a session can stay quiet before it ends.

Limits and errors

  • Each running session counts toward your plan’s concurrent-session limit: 1 for Freemium and 100 for all paid plans. Over the limit, the request fails with 429 concurrency_limit.
  • If your plan doesn’t include Interactive Avatars, or your workspace has no credit for the deployment’s sessions, the request fails with 402. The codes are feature_not_in_plan, quota_exceeded and no_credit.
  • A 404 unknown_reference means the deployment doesn’t exist, isn’t an API deployment, or isn’t in your workspace.

For every code and its fix, see Errors. For the full request and response, see Create Interactive Avatar Session.