livekit-plugins-protoface is
the quickest way to add an avatar. It starts a Protoface session and joins
the avatar to your room as a participant, then streams your agent’s audio
to it.
LiveKit maintains and publishes the plugin, and documents it at
docs.livekit.io.
If you are not on LiveKit, Protoface works with many more platforms and
SDKs. See Other integrations.
Install
Basic usage
Create anAvatarSession and start it before session.start(...):
Token handling
AvatarSession.start(...) mints a short-lived room token in the agent
process from your LiveKit API key and secret, then passes it to Protoface
as worker_token. Your secret never leaves the agent process.
Configuration
Set these in the agent environment.
Or pass them directly:
AvatarSession options
Session
avatar.start(...) creates a Protoface session and puts its sess_... ID
on avatar.session_id. The session moves through queued, starting,
and running. first_frame_at is set when the first frame reaches the
room, and a protoface-avatar-agent participant publishes audio and
video into it.
await avatar.aclose() or POST /v1/sessions/{id}/end,
after idle_timeout_seconds without inbound audio, or at your plan’s
duration cap. The idle default is 30 seconds, and the timer follows the
audio your agent sends rather than when the visitor stops speaking.
Billing rounds up to the minute, and usage.billable_seconds settles
after the fact rather than ticking live.
Credits and limits covers the caps.
