Skip to main content
Qwen-TTS-Realtime

Server events

Server events for the Qwen-TTS-Realtime API.

Reference: Real-time speech synthesis.

error

Sent for both client-side and server-side errors.
{
  "event_id": "event_QzAVZRVa9hKqM5VOaHunh",
  "type": "error",
  "error": {
    "code": "invalid_value",
    "message": "Session update error: session already started or finished or failed."
  }
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always error.
errorobjectThe error details.
error.codestringThe error code.
error.messagestringThe error message.

session.created

Sent when a client connects. Includes the default session configuration.
{
  "event_id": "event_xxx",
  "type": "session.created",
  "session": {
    "object": "realtime.session",
    "mode": "server_commit",
    "model": "qwen3-tts-flash-realtime",
    "voice": "Cherry",
    "response_format": "pcm",
    "sample_rate": 24000,
    "id": "sess_xxx"
  }
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always session.created.
sessionobjectThe session configuration.
session.idstringThe session ID.
session.objectstringThe session service name.
session.modestringThe interaction mode. Valid values are server_commit or commit.
session.modelstringThe model in use.
session.voicestringThe voice in use.
session.response_formatstringThe audio format.
session.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_id": "event_xxx",
  "type": "session.updated",
  "session": {
    "id": "sess_xxx",
    "object": "realtime.session",
    "model": "qwen3-tts-flash-realtime",
    "voice": "Cherry",
    "language_type": "Chinese",
    "mode": "commit",
    "response_format": "pcm",
    "sample_rate": 24000
  }
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always session.updated.
sessionobjectThe session configuration.
session.idstringThe session ID.
session.objectstringThe session service name.
session.modestringThe interaction mode. Valid values are server_commit or commit.
session.modelstringThe model in use.
session.voicestringThe voice in use.
session.response_formatstringThe audio format.
session.sample_rateintegerThe audio sampling rate.
session.language_typestringThe language of the audio.

input_text_buffer.committed

Sent after the server receives an input_text_buffer.commit event.
{
  "event_id": "event_FC6MA88wS2oEeXkPvWsxX",
  "type": "input_text_buffer.committed",
  "item_id": ""
}
ParameterTypeDescription
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_id": "event_1122",
    "type": "input_text_buffer.cleared"
}
ParameterTypeDescription
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_id": "event_IMnLqDvG6Ahhk7sWV2uOs",
  "type": "response.created",
  "response": {
    "id": "resp_USvBwHktHcz76r6GaIJUV",
    "object": "realtime.response",
    "conversation_id": "",
    "status": "in_progress",
    "voice": "Cherry",
    "output": []
  }
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always response.created.
responseobjectThe response details.
response.idstringThe response ID.
response.objectstringThe object type. This value is always realtime.response.
response.statusstringThe final status of the response. Valid values are:
  • completed
  • failed
  • in_progress
  • incomplete
response.voicestringThe voice in use.
response.outputarrayThis field is empty for this event.

response.output_item.added

Sent when a new output item is ready.
{
  "event_id": "event_INDGnGNulaXCrStd9ZM5X",
  "type": "response.output_item.added",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "output_index": 0,
  "item": {
    "id": "item_FIrYGaNVK3rbIZqeY4QjM",
    "object": "realtime.item",
    "type": "message",
    "status": "in_progress",
    "role": "assistant",
    "content": []
  }
}
ParameterTypeDescription
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.
item.idstringThe output item ID.
item.objectstringThis value is always realtime.item.
item.statusstringThe status of the output item.
item.contentarrayThe content of the message.

response.content_part.added

Sent when a new content part is ready.
{
  "event_id": "event_DigZ95MWN36YYyyjcENoq",
  "type": "response.content_part.added",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": ""
  }
}
ParameterTypeDescription
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.
part.typestringThe type of the content part.
part.textstringThe text of the content part.

response.audio.delta

Sent when the model generates new audio data incrementally.
{
  "event_id": "event_B1osWMZBtrEQbiIwW0qHQ",
  "type": "response.audio.delta",
  "response_id": "resp_B1osWTzBb8hO0WsELHgVP",
  "item_id": "item_B1osWH81fXDoyim1T5fsF",
  "output_index": 0,
  "content_index": 0,
  "delta": "base64 audio"
}
ParameterTypeDescription
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_id": "event_Vo2YUjlYQJ4colH8nVzkU",
  "type": "response.content_part.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": ""
  }
}
ParameterTypeDescription
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.
part.typestringThe type of the content part.
part.textstringThe text of the content part.

response.output_item.done

Sent when an output item is complete.
{
  "event_id": "event_LO6SJRKIQ9NBayyYB8a1A",
  "type": "response.output_item.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "output_index": 0,
  "item": {
    "id": "item_FIrYGaNVK3rbIZqeY4QjM",
    "object": "realtime.item",
    "type": "message",
    "status": "completed",
    "role": "assistant",
    "content": [
      {
        "type": "audio",
        "text": ""
      }
    ]
  }
}
ParameterTypeDescription
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.
item.idstringThe output item ID.
item.objectstringThis value is always realtime.item.
item.statusstringThe status of the output item.
item.contentarrayThe content of the message.

response.audio.done

Sent when the model finishes generating audio data.
{
  "event_id": "event_LZaOHPzXYMUXGBcVkBmKX",
  "type": "response.audio.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0
}
ParameterTypeDescription
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_id": "event_Aemy83XqHFFDDSeJIDn6N",
    "type": "response.done",
    "response": {
        "id": "resp_LFeR42yXZ9SxUAeXjmyTz",
        "object": "realtime.response",
        "conversation_id": "",
        "status": "completed",
        "modalities": [
            "text",
            "audio"
        ],
        "voice": "Cherry",
        "output": [
            {
                "id": "item_Ae1lv2XmRljRSG96L8Zm1",
                "object": "realtime.item",
                "type": "message",
                "status": "completed",
                "role": "assistant",
                "content": [
                    {
                        "type": "audio",
                        "transcript": ""
                    }
                ]
            }
        ],
        "usage": {
            "characters": 25
        }
    }
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always response.done.
response_idstringThe ID of the response.
responseobjectThe response details.
response.idstringThe response ID.
response.objectstringThe object type. This value is always realtime.response.
response.outputarrayResponse output.
response.usageobjectBilling information for this speech synthesis request.
response.usage.charactersintegerThe number of characters billed for Qwen3-TTS Realtime.

session.finished

Sent when all responses have been generated.
{
  "event_id": "event_2239",
  "type": "session.finished"
}
ParameterTypeDescription
event_idstringThe server-side event ID.
typestringThe event type. This value is always session.finished.