Messages
{
"type": "<string>",
"model_id": "<string>",
"format": "<string>",
"sample_rate": 123,
"language_hints": {
"item": "<string>"
},
"enable_speaker_diarization": true,
"mode": "<string>",
"target_language": "<string>",
"target_language_a": "<string>",
"target_language_b": "<string>"
}{
"type": "<string>",
"data": "<string>"
}{
"type": "<string>",
"command": "<string>"
}{
"type": "<string>",
"request_id": "<string>",
"format": "<string>",
"sample_rate": 123,
"mode": "<string>",
"target_language": "<string>",
"target_language_a": "<string>",
"target_language_b": "<string>",
"language_hints": {
"item": "<string>"
},
"enable_speaker_diarization": true
}{
"type": "<string>",
"request_id": "<string>",
"text": "<string>",
"is_final": true,
"language": "<string>",
"speaker_id": "<string>",
"confidence": 123,
"offset": 123,
"duration": 123,
"words": {
"word": "<string>",
"offset": 123,
"duration": 123,
"confidence": 123
}
}{
"type": "<string>",
"request_id": "<string>",
"text": "<string>",
"is_final": true,
"source_language": "<string>",
"target_language": "<string>",
"speaker_id": "<string>"
}{
"type": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}Websockets
Translate Realtime
WebSocket Real-time Speech Translation Channel
Through this channel, clients can:
- Send initialization messages to configure translation parameters
- Send audio data streams for real-time speech translation
- Send command messages to control the translation flow
- Receive source transcript results and translated results (partial and final)
Connection:
- Authentication via header:
X-Api-Key: YOUR_API_KEY - Authentication via query:
?token=YOUR_API_KEY
Message Format:
All messages are in JSON format, containing a type field to identify the message type
WSS
/
v1
/
translate
/
realtime
Messages
{
"type": "<string>",
"model_id": "<string>",
"format": "<string>",
"sample_rate": 123,
"language_hints": {
"item": "<string>"
},
"enable_speaker_diarization": true,
"mode": "<string>",
"target_language": "<string>",
"target_language_a": "<string>",
"target_language_b": "<string>"
}{
"type": "<string>",
"data": "<string>"
}{
"type": "<string>",
"command": "<string>"
}{
"type": "<string>",
"request_id": "<string>",
"format": "<string>",
"sample_rate": 123,
"mode": "<string>",
"target_language": "<string>",
"target_language_a": "<string>",
"target_language_b": "<string>",
"language_hints": {
"item": "<string>"
},
"enable_speaker_diarization": true
}{
"type": "<string>",
"request_id": "<string>",
"text": "<string>",
"is_final": true,
"language": "<string>",
"speaker_id": "<string>",
"confidence": 123,
"offset": 123,
"duration": 123,
"words": {
"word": "<string>",
"offset": 123,
"duration": 123,
"confidence": 123
}
}{
"type": "<string>",
"request_id": "<string>",
"text": "<string>",
"is_final": true,
"source_language": "<string>",
"target_language": "<string>",
"speaker_id": "<string>"
}{
"type": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"error": "<string>",
"code": "<string>",
"request_id": "<string>"
}token
type:httpApiKey
API Key passed as query parameter, e.g. ?token=YOUR_API_KEY
Translate Initialization Message
type:object
Translate Audio Message
type:object
Translate Command Message
type:object
Translate Ready Message
type:object
Translate Transcript Message
type:object
Translate Translation Message
type:object
Translate Flush Done Message
type:object
Translate Error Message
type:object

