Server events for the Qwen-TTS-Realtime API.
Reference: Real-time speech synthesis.
error
Sent for both client-side and server-side errors.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always error. |
| error | object | The error details. |
| error.code | string | The error code. |
| error.message | string | The error message. |
session.created
Sent when a client connects. Includes the default session configuration.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always session.created. |
| session | object | The session configuration. |
| session.id | string | The session ID. |
| session.object | string | The session service name. |
| session.mode | string | The interaction mode. Valid values are server_commit or commit. |
| session.model | string | The model in use. |
| session.voice | string | The voice in use. |
| session.response_format | string | The audio format. |
| session.sample_rate | integer | The audio sampling rate. |
session.updated
Sent after the server successfully processes a session.update request. On error, an error event is sent instead.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always session.updated. |
| session | object | The session configuration. |
| session.id | string | The session ID. |
| session.object | string | The session service name. |
| session.mode | string | The interaction mode. Valid values are server_commit or commit. |
| session.model | string | The model in use. |
| session.voice | string | The voice in use. |
| session.response_format | string | The audio format. |
| session.sample_rate | integer | The audio sampling rate. |
| session.language_type | string | The language of the audio. |
input_text_buffer.committed
Sent after the server receives an input_text_buffer.commit event.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always input_text_buffer.committed. |
| item_id | string | The ID of the user message item to create. |
input_text_buffer.cleared
The server’s response event after the client sends the input_text_buffer.clear event.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always input_text_buffer.cleared. |
response.created
The server sends this event after it receives an input_text_buffer.commit event from the client.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.created. |
| response | object | The response details. |
| response.id | string | The response ID. |
| response.object | string | The object type. This value is always realtime.response. |
| response.status | string | The final status of the response. Valid values are:
|
| response.voice | string | The voice in use. |
| response.output | array | This field is empty for this event. |
response.output_item.added
Sent when a new output item is ready.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.output_item.added. |
| response_id | string | The ID of the response. |
| output_index | integer | The index of the response output item. This value is always 0. |
| item | object | The output item details. |
| item.id | string | The output item ID. |
| item.object | string | This value is always realtime.item. |
| item.status | string | The status of the output item. |
| item.content | array | The content of the message. |
response.content_part.added
Sent when a new content part is ready.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.content_part.added. |
| response_id | string | The ID of the response. |
| item_id | string | The ID of the message item. |
| output_index | integer | The index of the response output item. This value is always 0. |
| content_index | integer | The index of the content part within the response output item. This value is always 0. |
| part | object | The completed content part. |
| part.type | string | The type of the content part. |
| part.text | string | The text of the content part. |
response.audio.delta
Sent when the model generates new audio data incrementally.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.audio.delta. |
| response_id | string | The ID of the response. |
| item_id | string | The ID of the message item. |
| output_index | integer | The index of the response output item. This value is always 0. |
| content_index | integer | The index of the content part within the response output item. This value is always 0. |
| delta | string | Audio data generated incrementally by the model. The data is Base64-encoded. |
response.content_part.done
Sent when a content part is complete.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.content_part.done. |
| response_id | string | The ID of the response. |
| item_id | string | The ID of the message item. |
| output_index | integer | The index of the response output item. This value is always 0. |
| content_index | integer | The index of the content part within the response output item. This value is always 0. |
| part | object | The completed content part. |
| part.type | string | The type of the content part. |
| part.text | string | The text of the content part. |
response.output_item.done
Sent when an output item is complete.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.output_item.done. |
| response_id | string | The ID of the response. |
| output_index | integer | The index of the response output item. This value is always 0. |
| item | object | The output item details. |
| item.id | string | The output item ID. |
| item.object | string | This value is always realtime.item. |
| item.status | string | The status of the output item. |
| item.content | array | The content of the message. |
response.audio.done
Sent when the model finishes generating audio data.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.audio.done. |
| response_id | string | The ID of the response. |
| item_id | string | The ID of the message item. |
| output_index | integer | The index of the response output item. This value is always 0. |
| content_index | integer | The index of the content part within the response output item. This value is always 0. |
response.done
Sent when response generation is complete. The response object contains all output items but excludes the already-sent raw audio data.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always response.done. |
| response_id | string | The ID of the response. |
| response | object | The response details. |
| response.id | string | The response ID. |
| response.object | string | The object type. This value is always realtime.response. |
| response.output | array | Response output. |
| response.usage | object | Billing information for this speech synthesis request. |
| response.usage.characters | integer | The number of characters billed for Qwen3-TTS Realtime. |
session.finished
Sent when all responses have been generated.
| Parameter | Type | Description |
|---|---|---|
| event_id | string | The server-side event ID. |
| type | string | The event type. This value is always session.finished. |