livekit or daily) and exposes an ingestion WebSocket you stream audio into. The avatar joins your room as a participant and publishes lip-synced avatar video generated from that audio.
Lifecycle
POST /api/sessions- create the session. The response carriesingestion.urland a single-useingestion.wsToken(15 minute TTL).- Open the WebSocket and send
start- see the WebSocket protocol. - Optionally send
POST /api/sessions/{id}/heartbeatto keep the session marked active. POST /api/sessions/{id}/endorDELETE /api/sessions/{id}to terminate. Both can return202while session cleanup finishes - pollGET /api/sessions/{id}untilsession.statusisENDED.- If the WebSocket drops or the token expires,
POST /api/sessions/{id}/reconnectmints a freshwsToken. The status endpoint never returns tokens or room credentials.
Endpoints
The room object
Every session needs aroom describing where the avatar publishes:
livekit_room_id (top level, optional) overrides the resolved room name. Legacy top-level fields byolr, livekitUrl, and livekitToken are rejected with ROOM_LEGACY_FIELDS; unknown fields fail with REQUEST_FIELD_UNKNOWN; waitForIngestion fails with WAIT_FOR_INGESTION_REMOVED.
inputProvider
Optional hint naming the upstream speech provider feeding the socket:deepgram, gemini, gnani, elevenlabs, openai, cartesia, sarvam, or custom. Provider-driven modes change how utterance boundaries are detected; omit it (or use custom) for plain PCM streaming. On reconnect, a provided inputProvider must match the stored value (INPUT_PROVIDER_MISMATCH).
Reading responses
- Create returns the session summary twice: nested under
sessionand mirrored at the top level (room,egressType,roomUrl,roomToken,inputProvider). workerStatusprogressesPENDING-ASSIGNING-ASSIGNED/ACTIVE-ENDING-ENDED(orFAILED).workerAssignmentis opaque placement metadata; keepjobIdhandy for support.ingestion.readytells you whetherurl/wsTokenare present. OnGET /api/sessions/{id},readycan be true whileurl/wsTokenare absent - use reconnect to mint a token.cost_usdis the session’s USD cost as a decimal string. It is"0.0000"for every session during the private beta (usage is metered in credits instead). When paid plans launch, new sessions will carry their real cost; sessions created during the beta keep0permanently.