WebSocket server reference
Server-side events for the qwen3.5-livetranslate-flash-realtime API.
An error from the server.
Sent when you connect. Contains the default session configuration.
Sent after a successful
Sent after all translations are complete.
The server sends this only after you send session.finish. You can disconnect after you receive it.
Sent when the server starts a new response.
Sent when response generation finishes. The
Sent when the model generates text incrementally in text-only mode.
Sent when text-only output is complete.
Sent when the model generates audio data incrementally.
Sent when audio generation is complete.
Returned when the server-side VAD (Voice Activity Detection) detects that the user has started speaking.
Returned when the server-side VAD detects that the user has stopped speaking, indicating the end of the current speech input turn. Because the translation response is generated synchronously with the streaming speech input, the actual translation response may have already started during the speech input process, without needing to wait for this event.
In Manual mode (
After the client sends an
Returned when a new message item is created in the conversation. This event is triggered in the following scenarios:
Streams speech recognition results in the source language. Requires
Sent when speech recognition finishes with the final result. Requires
Returned when audio input was received but speech recognition failed. This event is handled separately from other
Streams the translation text in real time when output includes audio.
Sent when translation text generation is complete for audio output.
Sent when a new output item is created during response generation.
Sent when an output item is complete.
Sent when a new content part begins.
Sent when a content part is complete.
error
An error from the server.
Example
string
body
Event ID.
string
body
Always
error.object
body
Error details.
session.created
Sent when you connect. Contains the default session configuration.
Example
string
body
Event ID.
string
body
Always
session.created.object
body
Session configuration.
session.updated
Sent after a successful session.update request. On error, the server returns an error event instead.
Example
string
body
Event ID.
string
body
Always
session.updated.object
body
Session configuration.
session.finished
Sent after all translations are complete.
The server sends this only after you send session.finish. You can disconnect after you receive it.
Example
string
body
Event ID.
string
body
Always
session.finished.response.created
Sent when the server starts a new response.
Example
string
body
Event ID.
string
body
Always
response.created.object
body
Response object.
response.done
Sent when response generation finishes. The response object includes all output items except raw audio data.
Example
string
body
Event ID.
string
body
Always
response.done.object
body
Response object.
response.text.text
Sent when the model generates text incrementally in text-only mode.
Example
string
body
Event ID.
string
body
Always
response.text.text.string
body
Incremental text chunk.
string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
response.text.done
Sent when text-only output is complete.
Also sent if the response is interrupted, incomplete, or canceled.
Example
string
body
Event ID.
string
body
Always
response.text.done.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
string
body
Complete text output.
response.audio.delta
Sent when the model generates audio data incrementally.
Example
string
body
Event ID.
string
body
Always
response.audio.delta.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
string
body
Base64-encoded audio chunk.
response.audio.done
Sent when audio generation is complete.
Also sent if the response is interrupted, incomplete, or canceled. This event does not contain the full audio data.
Example
string
body
Event ID.
string
body
Always
response.audio.done.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
input_audio_buffer.speech_started
Returned when the server-side VAD (Voice Activity Detection) detects that the user has started speaking.
Example
string
body
The unique identifier for this event.
string
body
Always
input_audio_buffer.speech_started.integer
body
The time point (in milliseconds) when speech was detected to start, as an offset from the beginning of the audio stream.
string
body
The unique identifier for the associated message item.
input_audio_buffer.speech_stopped
Returned when the server-side VAD detects that the user has stopped speaking, indicating the end of the current speech input turn. Because the translation response is generated synchronously with the streaming speech input, the actual translation response may have already started during the speech input process, without needing to wait for this event.
Example
string
body
The unique identifier for this event.
string
body
Always
input_audio_buffer.speech_stopped.integer
body
The time point (in milliseconds) when speech was detected to end, as an offset from the beginning of the audio stream.
string
body
The unique identifier for the associated message item.
input_audio_buffer.committed
In Manual mode (turn_detection is null), after the client sends an input_audio_buffer.commit event, the server returns this event as confirmation and automatically starts generating the translation response.
Example
string
body
The unique identifier for this event.
string
body
Always
input_audio_buffer.committed.input_audio_buffer.cleared
After the client sends an input_audio_buffer.clear event, the server returns this event as confirmation that the uncommitted audio data in the buffer has been cleared.
Example
string
body
The unique identifier for this event.
string
body
Always
input_audio_buffer.cleared.conversation.item.created
Returned when a new message item is created in the conversation. This event is triggered in the following scenarios:
- When the server starts generating a translation response, it creates a corresponding assistant message item (at this point,
contentis an empty array, and the content is progressively populated with the streaming response). - In Manual mode, after the client sends an
input_audio_buffer.commitevent, the server additionally creates a message item corresponding to the user's input audio (contentcontains{"type": "input_audio"}).
item.id of the speech recognition result matches the previous_item_id in the translation result event. Use these values to associate and display the source text with its translation.
Example
string
body
The unique identifier for this event.
string
body
Always
conversation.item.created.string
body
The unique identifier of the previous message item. For a translation result event, this value matches the
item.id of the speech recognition result for the same VAD segment.object
body
The message item information.
conversation.item.input_audio_transcription.text
Streams speech recognition results in the source language. Requires input_audio_transcription.model to be set.
Example
string
body
Event ID.
string
body
Always
conversation.item.input_audio_transcription.text.string
body
Message item ID.
integer
body
Always 0.
string
body
Confirmed recognition text.
string
body
Pending recognition text. May be corrected by later events.
string
body
Detected source language.
string
body
The detected emotion of the recognized audio. Supported emotions are as follows:
surprised: Surprisedneutral: Neutralhappy: Happysad: Saddisgusted: Disgustedangry: Angryfearful: Fearful
conversation.item.input_audio_transcription.completed
Sent when speech recognition finishes with the final result. Requires input_audio_transcription.model to be set.
Example
string
body
Event ID.
string
body
Always
conversation.item.input_audio_transcription.completed.string
body
Message item ID.
integer
body
Always 0.
string
body
Final recognition result in the source language.
string
body
Detected source language.
string
body
The detected emotion of the recognized audio. Supported emotions:
surprised: surprisedneutral: calm/neutralhappy: happysad: saddisgusted: disgustedangry: angryfearful: fearful
conversation.item.input_audio_transcription.failed
Returned when audio input was received but speech recognition failed. This event is handled separately from other error events, making it easier for the client to identify the specific associated item.
Example
string
body
Always
conversation.item.input_audio_transcription.failed.string
body
The ID of the associated conversation item.
integer
body
The index of the content part that contains the audio.
string
body
The error code.
string
body
The error message.
response.audio_transcript.text
Streams the translation text in real time when output includes audio.
Example
string
body
Event ID.
string
body
Always
response.audio_transcript.text.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
string
body
Confirmed translation segment.
string
body
Temporary text appended to
text to form a partial result. The server updates text and stash through response.audio_transcript.text events until response.audio_transcript.done, which contains the final translation in transcript.response.audio_transcript.done
Sent when translation text generation is complete for audio output.
Example
string
body
Event ID.
string
body
Always
response.audio_transcript.done.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
string
body
Final translation text.
response.output_item.added
Sent when a new output item is created during response generation.
Example
string
body
Event ID.
string
body
Always
response.output_item.added.string
body
Response ID.
integer
body
Always 0.
object
body
Output item.
response.output_item.done
Sent when an output item is complete.
Example
string
body
Event ID.
string
body
Always
response.output_item.done.string
body
Response ID.
integer
body
Always 0.
object
body
Output item.
response.content_part.added
Sent when a new content part begins.
Example
string
body
Event ID.
string
body
Always
response.content_part.added.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
object
body
Content part.
response.content_part.done
Sent when a content part is complete.
Example
string
body
Event ID.
string
body
Always
response.content_part.done.string
body
Response ID.
string
body
Message item ID.
integer
body
Always 0.
integer
body
Always 0.
object
body
Content part.