Server events for the Qwen-TTS-Realtime API.
Reference: Real-time speech synthesis.
error
Sent for both client-side and server-side errors.
event_idstringThe server-side event ID.typestringThe event type. This value is always error.errorobjectThe error details.
Properties codestringThe error code.messagestringThe error message. |
session.created
Sent when a client connects. Includes the default session configuration.
event_idstringThe server-side event ID.typestringThe event type. This value is always session.created.sessionobjectThe session configuration.
Properties id stringThe session ID.objectstringThe session service name.modestringThe interaction mode. Valid values are server_commit or commit.modelstringThe model in use.voicestringThe voice in use.response_formatstringThe audio format.sample_rateintegerThe audio sampling rate. |
session.updated
Sent after the server successfully processes a session.update request. On error, an error event is sent instead.
event_idstringThe server-side event ID.typestringThe event type. This value is always session.updated.sessionobjectThe session configuration.
Properties id stringThe session ID.objectstringThe session service name.modestringThe interaction mode. Valid values are server_commit or commit.modelstringThe model in use.voicestringThe voice in use.response_formatstringThe audio format.sample_rateintegerThe audio sampling rate.language_typestringThe language of the audio. |
input_text_buffer.committed
Sent after the server receives an input_text_buffer.commit event.
event_idstringThe server-side event ID.typestringThe event type. This value is always input_text_buffer.committed.item_idstringThe 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.
event_idstringThe server-side event ID.typestringThe 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.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.created.responseobjectThe response details.
Properties id stringThe response ID.objectstringThe object type. This value is always realtime.response.statusstringThe final status of the response. Valid values are:
stringThe voice in use.outputarrayThis field is empty for this event. |
response.output_item.added
Sent when a new output item is ready.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.output_item.added.response_idstringThe ID of the response.output_indexintegerThe index of the response output item. This value is always 0.itemobjectThe output item details.
Properties id stringThe output item ID.objectstringThis value is always realtime.item.statusstringThe status of the output item.contentarrayThe content of the message. |
response.content_part.added
Sent when a new content part is ready.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.content_part.added.response_idstringThe ID of the response.item_idstringThe ID of the message item.output_indexintegerThe index of the response output item. This value is always 0.content_indexintegerThe index of the content part within the response output item. This value is always 0.partobjectThe completed content part.
Properties type stringThe type of the content part.textstringThe text of the content part. |
response.audio.delta
Sent when the model generates new audio data incrementally.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.audio.delta.response_idstringThe ID of the response.item_idstringThe ID of the message item.output_indexintegerThe index of the response output item. This value is always 0.content_indexintegerThe index of the content part within the response output item. This value is always 0.deltastringAudio data generated incrementally by the model. The data is Base64-encoded. |
response.content_part.done
Sent when a content part is complete.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.content_part.done.response_idstringThe ID of the response.item_idstringThe ID of the message item.output_indexintegerThe index of the response output item. This value is always 0.content_indexintegerThe index of the content part within the response output item. This value is always 0.partobjectThe completed content part.
Properties type stringThe type of the content part.textstringThe text of the content part. |
response.output_item.done
Sent when an output item is complete.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.output_item.done.response_idstringThe ID of the response.output_indexintegerThe index of the response output item. This value is always 0.itemobjectThe output item details.
Properties id stringThe output item ID.objectstringThis value is always realtime.item.statusstringThe status of the output item.contentarrayThe content of the message. |
response.audio.done
Sent when the model finishes generating audio data.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.audio.done.response_idstringThe ID of the response.item_idstringThe ID of the message item.output_indexintegerThe index of the response output item. This value is always 0.content_indexintegerThe 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.
event_idstringThe server-side event ID.typestringThe event type. This value is always response.done.response_idstringThe ID of the response.responseobjectThe response details.
Properties id stringThe response ID.objectstringThe object type. This value is always realtime.response.outputarrayResponse output.usageobjectBilling information for this speech synthesis request.
Properties characters integerThe number of characters billed for Qwen3-TTS Realtime.total_tokensintegerTotal token count for input and output (synthesized audio).input_tokensintegerToken count for input content.output_tokensintegerToken count for output content.input_tokens_detailsintegerDetailed token count for input content.input_tokens_details.text_tokensintegerToken count for input text content.output_tokens_detailsintegerDetailed token count for output content.output_tokens_details.text_tokensintegerToken count for output text content.output_tokens_details.audio_tokensintegerToken count for output audio content.Audio-to-token conversion rule: 1 second = 50 tokens. Audio under 1 second counts as 50 tokens. |
session.finished
Sent when all responses have been generated.
event_idstringThe server-side event ID.typestringThe event type. This value is always session.finished. |