Security
- The API key is in your server’s secrets (for example
TALKING_AVATAR_API_KEY), never in browser code, a mobile app or a repository. - Your
/avatarroute is behind your app’s authentication, so only your users can watch a conversation. - You use a separate API key per environment (development, staging, production), so you can revoke one without affecting the others.
Lifecycle and billing
- There’s exactly one
LiveAvatarper conversation. - You call
close()when the conversation ends, the user leaves, or anything fails. - You handle
LiveAvatarErrorfromstart()and thecloseevent, and your voice agent keeps working without the avatar. - Auto top-up is on, or you watch your balance, so sessions don’t stop with
4002. - A monthly spending limit caps what a bug could cost.
Audio
- The
sampleRatematches your TTS audio exactly. - You send raw PCM16 mono, not MP3, Opus or WAV with headers.
- The voice plays only through the avatar, never twice.
- Barge-in calls
clear(), and your agent’s transcript is truncated toheardMs.
The page
-
connect()runs from a click or tap, so the browser lets the voice play. - You handle the
mutedstatus: show a button that callsview.unmute(). - You
disconnect()the view when the conversation UI goes away (for example, on React unmount). - The container has a size. The 16:9 video fits inside it without cropping.
Networks
- For users behind strict corporate firewalls, you pass your own TURN server in
iceServers:
Disclosure
- Where the law requires it, and whenever people might otherwise be misled, you tell your users that they are talking to an AI. See the Terms of Service.