Server-side events for the qwen3.5-livetranslate-flash-realtime API.
Reference: Real-time audio and video translation - Qwen
error
Error message returned by the server.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
error Detailed information about the error. |
session.created
When a client connects, the server returns this event first with the default session configurations.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
session The session configuration. |
session.updated
Returned after a successful session.update request. If the request fails, an error event is returned instead.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
session The session configuration. |
session.finished
Session is finished and all audio translations are complete.
Sent only after the client sends a session.finish request. The client can then disconnect.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
response.created
Returned when the server generates a new model response.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
response The response object. |
response.done
Returned after response generation is complete. Contains all output items except raw audio data.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
response The response object. |
response.text.text
Returned for text-only output when the model generates text incrementally.
|
event_id A unique identifier for the event. |
|
|
type The type of the event. The value is always |
|
|
text The incremental text that is returned. |
|
|
response_id The response ID. |
|
|
item_id A unique identifier for the message item. |
|
|
output_index Currently, the value is always 0. |
|
|
content_index Currently, the value is always 0. |
|
|
stash Temporary text generated by the model. Concatenate |
response.text.done
Returned when text generation finishes for text-only output, or if the response is interrupted, incomplete, or canceled.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
response_id The unique identifier for the response. |
|
|
item_id The unique identifier for the message item. |
|
|
output_index The value is currently always 0. |
|
|
content_index The value is currently always 0. |
|
|
text The complete text output from the model. |
response.audio.delta
Returned when audio output is enabled and the model generates audio incrementally.
|
event_id A unique identifier for the event. |
|
|
type The event type. The value is always |
|
|
response_id A unique identifier for the response. |
|
|
item_id A unique identifier for the message item. |
|
|
output_index integer The value is always 0. |
|
|
content_index The value is always 0. |
|
|
delta The incremental audio data that is output by the model. The data is Base64-encoded. |
response.audio.done
Returned when audio generation is complete. Also returned if the response is interrupted, incomplete, or canceled. Does not contain complete audio data.
|
event_id The unique identifier for this event. |
|
|
type The event type. This is always |
|
|
response_id The unique identifier for the response. |
|
|
item_id The unique identifier for the message item. |
|
|
output_index The value is always 0. |
|
|
content_index The value is always 0. |
input_audio_buffer.speech_started
Returned when the server-side VAD (Voice Activity Detection) detects that the user has started speaking.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
audio_start_ms The time point (in milliseconds) when speech was detected to start, as an offset from the beginning of the audio stream. |
|
|
item_id 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.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
audio_end_ms The time point (in milliseconds) when speech was detected to end, as an offset from the beginning of the audio stream. |
|
|
item_id 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.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
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.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
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"}).
For the same VAD segment, the server creates separate message items for the speech recognition result and the translation result. The 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.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
previous_item_id The unique identifier of the previous message item. For a translation result event, this value matches the |
|
|
item The message item information. |
conversation.item.input_audio_transcription.text
When input_audio_transcription.model is configured, the server streams speech recognition results in the original source language.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
item_id The unique identifier for the message item. |
|
|
content_index The value is currently always 0. |
|
|
text The confirmed recognition text. |
|
|
stash The recognition text that is pending confirmation. This text may be corrected by subsequent events. |
|
|
language The detected source language. |
|
|
emotion The detected emotion of the recognized audio. Supported emotions are as follows:
|
conversation.item.input_audio_transcription.completed
When input_audio_transcription.model is configured, returns the final recognition result after speech recognition completes.
|
event_id The unique identifier for this event. |
|
|
type The event type. This is always |
|
|
item_id The unique identifier for the message item. |
|
|
content_index This is currently always 0. |
|
|
transcript The complete speech recognition result in the original source language. |
|
|
language The detected source language. |
|
|
emotion The detected emotion of the recognized audio. Supported emotions:
|
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.
|
type The event type. The value is always |
|
|
item_id The ID of the associated conversation item. |
|
|
content_index The index of the content part that contains the audio. |
|
|
error.code The error code. |
|
|
error.message The error message. |
response.audio_transcript.text
Returned for audio output to display real-time translation.
|
event_id The unique identifier for this event. |
|
|
type The type of the event. The value is always |
|
|
response_id The unique identifier for the response. |
|
|
item_id The unique identifier for the message item. |
|
|
output_index Currently, the value is always 0. |
|
|
content_index Currently, the value is always 0. |
|
|
text The confirmed translation text segment. |
|
|
stash Temporary translation text, concatenated with |
response.audio_transcript.done
Returned when audio output is enabled and text generation finishes.
|
event_id The unique identifier for this event. |
|
|
type The event type. This is always |
|
|
response_id The unique identifier for the response. |
|
|
item_id The unique identifier for the message item. |
|
|
output_index This is currently always 0. |
|
|
content_index This is currently always 0. |
|
|
transcript The complete text. |
response.output_item.added
Returned when a new output item is added during response generation.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
response_id The unique identifier for the response. |
|
|
output_index The value is currently always 0. |
|
|
item Information about the output item. |
response.output_item.done
Returned when an output item is completed.
|
event_id The unique identifier for this event. |
|
|
type The event type. The value is always |
|
|
response_id The unique identifier for the response. |
|
|
output_index The value is currently always 0. |
|
|
item Information about the output item. |
response.content_part.added
Returned when a new content part is added.
|
event_id The unique ID of the event. |
|
|
type The type of the event. The value is always |
|
|
response_id The unique ID of the response. |
|
|
item_id The unique ID of the message item. |
|
|
output_index The value is always 0. |
|
|
content_index The value is always 0. |
|
|
part Outputs item information. |
response.content_part.done
Returned when a content part is completed.
|
event_id The unique identifier for this event. |
|
|
type The event type. This is always |
|
|
response_id The unique identifier for the response. |
|
|
item_id The unique identifier for the message item. |
|
|
output_index The value is always 0. |
|
|
content_index The value is always 0. |
|
|
part Information about the content part. |