> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.synthesia.io/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.synthesia.io/docs/_mcp/server.

# Interactive Avatar: Let Synthesia host 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](/docs/ia-overview) instead. [Choosing a route](#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 room**             | **You host the room**                         |
| -------------------- | ---------------------------------------- | --------------------------------------------- |
| Best for             | The quickest start. Recommended.         | Adding the avatar to a room you already host. |
| The room             | Synthesia runs it. No LiveKit to set up. | You run it, on LiveKit or Pipecat.            |
| From Synthesia       | The avatar and the room                  | The avatar and the plugin                     |
| From you             | Your agent                               | Your agent and your room                      |
| Start a session with | `deploymentId`                           | `avatarIds`, `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.

```bash
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`](/docs/scopes) scope.

The response is a session with a `connection` object:

```json
{
  "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>"
  }
}
```

| Field              | What it is                                                                               |
| ------------------ | ---------------------------------------------------------------------------------------- |
| `livekitUrl`       | The WebSocket URL of the room.                                                           |
| `participantToken` | A join-only token. Hand it to your end user's client.                                    |
| `joinBy`           | Join before this time, or the session ends. A session that nobody joins ends on its own. |
| `agentToken`       | A LiveKit access token for your own agent.                                               |
| `agentIdentity`    | The 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 joins              | Uses                                | How                                                                                                                                                                                               |
| ---------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Your end user's client | `livekitUrl` and `participantToken` | You build the screen with the [LiveKit client SDK](https://docs.livekit.io/home/client/connect/). The avatar appears as a normal participant, so you don't need Synthesia-specific frontend code. |
| Your agent             | `livekitUrl` and `agentToken`       | Your 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:

```javascript
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](/docs/ia-overview#data-flow), 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.

| Setting                | Default    | Other options          | What it does                                      |
| ---------------------- | ---------- | ---------------------- | ------------------------------------------------- |
| **Session length**     | 20 minutes | 2, 5, 10 or 15 minutes | The longest a single session can run.             |
| **Inactivity timeout** | 5 minutes  | 1, 2, 3 or 10 minutes  | How 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](/docs/errors). For the full request and response, see [Create Interactive Avatar Session](/docs/api-reference/interactive-avatars/create-interactive-avatar-session).