Skip to main content
Already using LiveKit? The avatar can join your room instead of streaming to your page. It publishes a lip-synced video track and its voice, in sync. Your LiveKit client plays them, so you don’t need LiveAvatarView or a /avatar route. You mint a publish-only token for the avatar’s participant. Your LiveKit API key and secret stay with you.

Set it up

1

Install

2

Mint a token and start the avatar

agent.js
3

Play the tracks

In your room, the avatar is a participant with the identity you gave its token (avatar-<room> above). It publishes:Render them with your existing LiveKit client, and stop playing your agent’s original voice track, so it isn’t heard twice.

Options

Playing the voice yourself

By default the avatar publishes the voice in sync with its lips (recommended). If you need to play the voice through your own track instead, set publishAudio: false, and pass playAtMs to each pushAudio call: the wall-clock time, in milliseconds since the epoch, when that audio will be heard, sent about 400 ms early. In this mode clear() resolves with null, because the avatar can’t know how much was heard.

Python agents

On LiveKit Agents for Python, use the realtime avatar API directly. The Python example mints the avatar’s token with livekit-api and starts it in your room.