Live Mode
Live Mode provides real-time interactive sessions with streaming avatar responses via PixelStreaming. This mode requires additional session management and supports continuous audio streaming using PCM format for Gemini API integration.
Overview
Key differences from Chat Mode:
- Requires explicit session start/end via REST endpoints
- Uses
LicenseIdfor session tracking - Supports real-time PCM audio streaming
- Avatar responses are streamed in real-time via 3D rendering
- Voice Activity Detection (VAD) auto-stops on speech end
Starting Live Session
Before using Live Mode, start a live session to obtain streaming credentials.
Endpoint:
POST /startLiveSession
Request Headers:
Content-Type: application/json
Authorization: Bearer {jwt_token}
Request Body:
{
"avatar_id": "avatar-id-123",
"width": "1280",
"height": "720"
}
| Field | Type | Required | Description |
|---|---|---|---|
avatar_id | string | Yes | Avatar identifier |
width | string | No | Video resolution width in pixels (default: "1280") |
height | string | No | Video resolution height in pixels (default: "720") |
Field Validation:
| Field | Constraints |
|---|---|
avatar_id | Must be a valid avatar ID from /connection response |
width | String representation of width in pixels. Must be an integer ≤ 1920 (e.g., "640", "1280", "1920") |
height | String representation of height in pixels. Must be an integer ≤ 1080 (e.g., "360", "720", "1080") |
cURL Example:
curl -X POST https://chat.rvtr.ai/startLiveSession \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-d '{"avatar_id": "avatar-id-123", "width": "1280", "height": "720"}'
Response (Success):
{
"status": 200,
"LicenseId": "license-abc-123",
"streamingUrl": "https://streaming.example.com/stream"
}
Response (Error):
{
"status": 503,
"error": "All AI assistants are busy at the moment"
}
Status Codes:
| Status Code | Description | Meaning |
|---|---|---|
| 200 | Success | Live session started successfully |
| 503 | Service Unavailable | All AI assistants are currently busy |
| 504 | Gateway Timeout | Stream connection timed out |
| -1 | Unknown Error | Generic error occurred |
Response Fields:
| Field | Type | Description |
|---|---|---|
status | number | Status code (see table above) |
LicenseId | string | License ID for session tracking (required for all Live Mode messages). Only present on success. |
streamingUrl | string | HTTP/HTTPS URL for iframe-based WebRTC video streaming (PixelStreaming). Only present on success. |
error | string | Error message describing the failure. Only present on error. |
warning:
Store the LicenseId -- it must be included in all Live Mode WebSocket messages and is required to end the session.