Chat Mode

Chat Mode provides standard text and voice chat functionality with pre-recorded avatar responses. Messages are sent via WebSocket and responses are delivered as text with optional audio/video URLs.

Overview

Workflow:

  1. Establish WebSocket connection (see WebSocket API)
  2. Send text or audio messages with isLive: false
  3. Receive text response with optional fileUrl for audio/video playback
tip:  

For real-time interactive sessions with streaming 3D avatar responses, use Live Mode instead.

Sending Text Messages

Send a text message via WebSocket.

WebSocket Message:

{
"avatar_id": "avatar-id-123",
"user_id": "user-123",
"chat_type": "text",
"language": "en",
"request": "Hello, how are you?",
"requestType": "text",
"source": "my-source-app-name",
"isLive": false,
"session": "session-identifier"
}
FieldTypeRequiredDescription
avatar_idstringYesTarget avatar identifier
user_idstringYesUser identifier
chat_typestringYes"text"
languagestringYesLanguage code (e.g., "en")
requeststringYesMessage text content
requestTypestringYes"text"
sourcestringYesClient identifier (e.g., "mobile-app")
isLivebooleanYesfalse for Chat Mode
sessionstringNoSession identifier from configuration

Sending Audio Messages

Send an audio message via WebSocket.

WebSocket Message:

{
"avatar_id": "avatar-id-123",
"user_id": "user-123",
"chat_type": "voice",
"language": "en",
"requestType": "audio",
"source": "my-source-app-name",
"isLive": false,
"isPushToTalk": true,
"file_base64_data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"session": "session-identifier"
}
FieldTypeRequiredDescription
avatar_idstringYesTarget avatar identifier
user_idstringYesUser identifier
chat_typestringYes"voice"
languagestringYesLanguage code
requestTypestringYes"audio"
sourcestringYesClient identifier
isLivebooleanYesfalse for Chat Mode
isPushToTalkbooleanNotrue when VAD is disabled (see Voice Activity Detection)
file_base64_datastringYesBase64-encoded audio blob
sessionstringNoSession identifier

Standard Audio Format

For Chat Mode audio messages, use the following audio format:

PropertyValue
FormatWAV or WebM
Sample Rate16,000 Hz (16 kHz)
ChannelsMono (1 channel)
EncodingBase64
Transmission Fieldfile_base64_data

Audio Recording Constraints:

{
"sampleRate": 16000,
"echoCancellation": true,
"noiseSuppression": true,
"autoGainControl": true,
"channelCount": 1
}
note:  

For Live Mode audio using PCM format, see the Live Mode documentation. For a comparison of both audio formats, see Audio Format Comparison.