livekit-plugins-protoface is an
easy way to add an avatar. It opens a Protoface session and joins the avatar
to your room, then streams your agent’s audio to it.
If you’re not using LiveKit, Protoface also integrates with many more platforms and SDKs. See
More Integrations.
Install
Basic usage
session.start(...):
Token handling
AvatarSession.start(...) uses your LiveKit API key and secret inside the
agent process to mint a short-lived avatar room token. Protoface receives that
token as worker_token; it never receives your LiveKit API secret.
Configuration
Set these in the agent environment.| Variable | Required | Used for |
|---|---|---|
PROTOFACE_API_KEY | yes | Authenticates calls to Protoface. |
PROTOFACE_API_URL | no | Overrides https://api.protoface.com. |
LIVEKIT_URL | yes | The LiveKit server the avatar joins. |
LIVEKIT_API_KEY | yes | Used locally to mint the avatar room token. |
LIVEKIT_API_SECRET | yes | Used locally to mint the avatar room token. Do not expose it to clients. |
AvatarSession options
| Option | Purpose |
|---|---|
avatar_id | Avatar to render. Use an ID from the dashboard or /v1/avatars. |
api_key | Protoface API key. Defaults to PROTOFACE_API_KEY. |
api_url | Protoface API base URL. Defaults to PROTOFACE_API_URL or https://api.protoface.com. |
avatar_participant_identity | LiveKit identity for the avatar participant. |
avatar_participant_name | LiveKit display name for the avatar participant. |
max_duration_seconds | Optional upper bound for the Protoface session. |
conn_options | LiveKit Agents connection timeout and retry options. |
avatar.start(...) succeeds, avatar.session_id contains the Protoface
session ID.
Lifecycle
Callawait avatar.start(session, room=ctx.room) before session.start(...).
Call await avatar.aclose() if you need to stop the avatar explicitly.
Next
Quickstart
Run a complete sample agent.
More Integrations
Quickstarts for other platforms and SDKs.
Avatars
Choose the avatar ID for your app.

