Skip to main content
Last verified: 2026-08-05

Overview

Use this integration to put a streaming LiveAvatar avatar in front of a deployed Cartesia Line agent. Your Line agent owns the prompt, tools, voice, and turn-taking; LiveAvatar’s Cartesia Agent Connector runs the bridge and renders lip-synced video from the agent’s audio. You pass an agent_id and a stored Cartesia API key when creating the session — no audio pipeline of your own.

Prerequisites

Quick start

The LiveAvatar Web SDK repo ships a Next.js demo app with a LITE Mode session route. Add your Cartesia agent config to that route and run it.
1

Store your Cartesia API key with LiveAvatar

LiveAvatar keeps the key by reference, so session requests carry a secret_id instead of the key itself.Set the environment variables used in the request:
The response returns an id. Use it as secret_id in the next step.
2

Clone the SDK repo and install

3

Add your LiveAvatar API key

Set API_KEY in apps/demo/app/api/secrets.ts. The demo ships with a working AVATAR_ID — swap it for one of your own avatars later.
4

Point the LITE session at your Line agent

Add cartesia_agent_config to the session token request in apps/demo/app/api/start-lite-session/route.ts:
Both secret_id and agent_id are required. LiveAvatar provisions a LiveKit room and dispatches a worker that talks to your Line agent.
5

Run the demo

Open http://localhost:3001, click Lite Mode, then unmute and speak. Your Line agent answers and the avatar lip-syncs to its audio.

Session events

Cartesia connector sessions use LiveAvatar’s FULL Mode event system over the LiveKit data channel, not LITE Mode WebSocket events. LiveAvatarSession emits them as typed events. Run this in an ES module (for example, a "use client" module in the demo app) or wrap the body in an async function — the snippet uses top-level await.

Configuration

cartesia_agent_config fields on the create session token request: Your Line agent owns its voice, prompt, and language, so LiveAvatar takes no per-session overrides for them. To keep the config server-side, save it once as a stored voice agent of type cartesia_agent and reference it by id instead — see the connector docs for that payload.

Resources