नेविगेशन पर जाएँ

WebSocket

The Realtime Translation WebSocket API streams translation audio continuously to a target language given source audio. Currently for enterprise workspaces only.

हैंडशेक

WSS
/v1/translation/realtime

हेडर

xi-api-keystringवैकल्पिक

क्वेरी पैरामीटर

authorizationstringवैकल्पिक
Your authorization bearer token.
target_languagestringआवश्यक

Target language as an ISO 639 code (e.g. de, es, fr, zh).

source_languagestringवैकल्पिक

Source language as an ISO 639 code. When omitted the server auto-detects the spoken language.

voice_idstringआवश्यक
Voice ID used for the translated speech output.
input_formatanyवैकल्पिक
Audio encoding format for realtime translation input.
output_formatanyवैकल्पिक
Audio encoding format for realtime translation output.
tts_model_idenumवैकल्पिकडिफ़ॉल्ट: eleven_v4_turbo
TTS model used to synthesize the translated speech.
अनुमत मान:
apply_text_normalizationenumवैकल्पिकडिफ़ॉल्ट: off

This parameter controls text normalization with three modes: ‘auto’, ‘on’, and ‘off’. When set to ‘auto’, the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With ‘on’, text normalization will always be applied, while with ‘off’, it will be skipped.

अनुमत मान:
eagernessenumवैकल्पिकडिफ़ॉल्ट: medium
How eagerly translation starts while the speaker is still talking. 'high' starts translating soonest for the lowest latency. 'low' waits for more of the sentence, giving higher quality translations with more delay.
अनुमत मान:
client_session_idstringवैकल्पिक

Optional client-defined session identifier for tracking purposes.

enable_zrmbooleanवैकल्पिकडिफ़ॉल्ट: false

When enable_zrm is set to true, zero retention mode will be used for the request. Sensitive content (transcripts, translations, and TTS text) is not written to application logs or session history. Zero retention mode may only be used by enterprise customers.

भेजें

inputAudioChunkobjectआवश्यक
Send a chunk of audio for translation.
OR
endOfStreamobjectआवश्यक
Signal that the audio stream has ended.

प्राप्त करें

sessionStartedobjectआवश्यक
Sent by the server when the session is initialized.
OR
statusobjectआवश्यक
Session lifecycle update indicating the session has started or stopped.
OR
partialTranscriptobjectआवश्यक
Interim transcription of the source audio.
OR
finalTranscriptobjectआवश्यक
Final transcription of a segment of source audio.
OR
translationobjectआवश्यक
Translated text in the target language.
OR
audioobjectआवश्यक

Base64-encoded audio of the translated speech.

OR
errorobjectआवश्यक
Error encountered during translation.
OR
Translate Auth Errorobjectआवश्यक
Authentication failed for the session.
OR
Translate Rate Limited Errorobjectआवश्यक
The request rate limit was reached.
OR
Translate Queue Overflow Errorobjectआवश्यक
Audio was sent too frequently and the session was terminated.
OR
Translate Input Errorobjectआवश्यक

An input message could not be handled; check the message format.

OR
Translate Transcriber Errorobjectआवश्यक
The transcriber failed to process the audio.
OR
Translate Translation Errorobjectआवश्यक

Translation failed for a segment; the session continues.

OR
Translate Audio Output Errorobjectआवश्यक

Audio output for a segment failed or was dropped; the session continues.

OR
Translate Quota Exceeded Errorobjectआवश्यक

The workspace is out of credits; the session is closed.

OR
Translate Payment Issue Errorobjectआवश्यक

The workspace has a payment issue or is suspended; the session is closed.

OR
Translate Unaccepted Terms Errorobjectआवश्यक

The workspace has not accepted terms required for this feature; the session is closed.