LiveAvatar is a thin client for this API. Use the API directly when your server isn’t Node.js (Python, Go, Java, Ruby, .NET, Rust…), or when you want full control. Everything the SDK can do, the API can do: start a session, stream your agent’s voice, interrupt, get speech events, and show the avatar in browsers or in your LiveKit room.
Messages
Every message you send and receive, with its fields.
Python example
A complete client, with FastAPI and LiveKit.
Browser playback
Show the avatar in your page over WebRTC.
Node.js SDK
On Node.js, the SDK does all of this for you.
Endpoint
A session, step by step
- Connect and send a
startmessage within 10 seconds. It names your API key, the avatar, your audio’s sample rate, and where the avatar goes: direct to browsers over WebRTC, or into your LiveKit room. - Wait for
ready. The avatar is live, and billing starts. - Show it. Direct output: relay a
viewhandshake for each browser (Browser playback). LiveKit: the avatar joins your room by itself. - Stream your agent’s voice as binary audio messages of raw PCM16 mono. The avatar speaks it, with the voice and lips in sync.
- Interrupt with
clearwhen the user talks over the avatar. - Close the WebSocket when the conversation ends. Billing stops.
The smallest session
Any WebSocket client works. In Python:Billing
$0.02 per minute, billed per second fromready until the connection closes, from your prepaid balance. It’s the same session, with the same price and limits, as one started with the SDK, and it appears on the Usage page under your API key’s name.
Limits
Close codes
The connection’s close code says why a session ended. Before closing for an error, the server usually sends anerror message with the details.