Skip to main content
Realtime

LiveTranslate server events

WebSocket server reference

Server events for the qwen3-livetranslate-flash-realtime API.

error

An error from the server.
Example
{
  "event_id": "event_RoUu4T8yExPMI37GKwaOC",
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_value",
    "message": "Invalid modalities: ['audio']. Supported combinations are: ['text'] and ['audio', 'text'].",
    "param": "session.modalities"
  }
}
string
body
Event ID.
string
body
Always error.
object
body
Error details.

session.created

Sent when you connect. Contains the default session configuration.
Example
{
  "event_id": "event_QxBGpjBDmDDQQWDtrqBKB",
  "type": "session.created",
  "session": {
    "id": "sess_OozZ1vtbPt2muDflHODIH",
    "object": "realtime.session",
    "model": "qwen3-livetranslate-flash-realtime",
    "modalities": [
      "text",
      "audio"
    ],
    "voice": "Cherry",
    "input_audio_format": "pcm16",
    "output_audio_format": "pcm24",
    "translation": {
      "language": "en"
    }
  }
}
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
{
  "event_id": "event_QxBGpjBDmDDQQWDtrqBKB",
  "type": "session.updated",
  "session": {
    "id": "sess_OozZ1vtbPt2muDflHODIH",
    "object": "realtime.session",
    "model": "qwen3-livetranslate-flash-realtime",
    "modalities": [
      "text",
      "audio"
    ],
    "voice": "Ethan",
    "input_audio_format": "pcm16",
    "output_audio_format": "pcm24",
    "translation": {
      "language": "en"
    }
  }
}
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
{
  "event_id": "event_xxx",
  "type": "session.finished"
}
string
body
Event ID.
string
body
Always session.finished.

response.created

Sent when the server starts a new response.
Example
{
  "event_id": "event_L8hHVI5jYis6BzAjnPWJh",
  "type": "response.created",
  "response": {
    "id": "resp_P79OOMs8LnrXVpiIHUCKR",
    "object": "realtime.response",
    "conversation_id": "conv_UFClXtYkRkFXrs48y8pmK",
    "status": "in_progress",
    "modalities": [
      "text",
      "audio"
    ],
    "voice": "Cherry",
    "output_audio_format": "pcm24",
    "output": []
  }
}
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
{
  "event_id": "event_CNea8oXNipVanSg2VIzkO",
  "type": "response.done",
  "response": {
    "id": "resp_TfhYTqej692vsGA2jNEtH",
    "object": "realtime.response",
    "conversation_id": "conv_ZtyLfKVm8XqLwYRlsuDih",
    "status": "completed",
    "modalities": [
      "text",
      "audio"
    ],
    "voice": "Cherry",
    "output_audio_format": "pcm24",
    "output": [
      {
        "id": "item_MKtkMwN9RtcyE9eJShyWy",
        "object": "realtime.item",
        "type": "message",
        "status": "completed",
        "role": "assistant",
        "content": [
          {
            "type": "audio",
            "transcript": "Hello? "
          }
        ]
      }
    ],
    "usage": {
      "total_tokens": 56,
      "input_tokens": 47,
      "output_tokens": 9,
      "input_tokens_details": {
        "text_tokens": 20,
        "audio_tokens": 27
      },
      "output_tokens_details": {
        "text_tokens": 2,
        "audio_tokens": 7
      }
    }
  }
}
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
{
  "event_id": "event_B1lIeyOXR7qJMEExbqtTG",
  "type": "response.text.text",
  "response_id": "resp_B1lIdtjF4Noqpn5NOjznj",
  "item_id": "item_B1lIdJsAJlJiFs8ztWpJt",
  "output_index": 0,
  "content_index": 0,
  "text": "How are"
}
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
{
  "event_id": "event_B1lIeE2Nac33zn5V7h2mm",
  "type": "response.text.done",
  "response_id": "resp_B1lIdtjF4Noqpn5NOjznj",
  "item_id": "item_B1lIdJsAJlJiFs8ztWpJt",
  "output_index": 0,
  "content_index": 0,
  "text": "How can I assist you today?"
}
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
{
  "event_id": "event_B1osWMZBtrEQbiIwW0qHQ",
  "type": "response.audio.delta",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
  "output_index": 0,
  "content_index": 0,
  "delta": "UklGRnoGAABXQVZFZm10IBAAAAAB..."
}
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
{
  "event_id": "event_B1osWMWoDRYyITDyNYcBu",
  "type": "response.audio.done",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
  "output_index": 0,
  "content_index": 0
}
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.

conversation.item.input_audio_transcription.text

Streams speech recognition results in the source language. Requires input_audio_transcription.model to be set.
Example
{
  "event_id": "event_xxx",
  "type": "conversation.item.input_audio_transcription.text",
  "item_id": "item_xxx",
  "content_index": 0,
  "text": "",
  "stash": "The weather is really nice today",
  "language": "zh"
}
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.

conversation.item.input_audio_transcription.completed

Sent when speech recognition finishes with the final result. Requires input_audio_transcription.model to be set.
Example
{
  "event_id": "event_xxx",
  "type": "conversation.item.input_audio_transcription.completed",
  "item_id": "item_xxx",
  "content_index": 0,
  "transcript": "The weather is really nice today, let's go for a walk in the park.",
  "language": "zh"
}
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.

response.audio_transcript.text

Streams the translation text in real time when output includes audio.
Example
{
  "event_id": "event_xxx",
  "type": "response.audio_transcript.text",
  "response_id": "resp_xxx",
  "item_id": "item_xxx",
  "output_index": 0,
  "content_index": 0,
  "text": "Hello,",
  "stash": " who are you?"
}
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
{
  "event_id": "event_VN4Q4GJugLcc1S23viW8E",
  "type": "response.audio_transcript.done",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_JvJauNH2CTXb1D9WV6pD4",
  "output_index": 0,
  "content_index": 0,
  "transcript": "How can I assist you today?"
}
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
{
  "event_id": "event_B4O5yPt3Gjnjy5eYH3plG",
  "type": "response.output_item.added",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "output_index": 0,
  "item": {
    "id": "item_OFaPGtzfWCPyGzxnuEX9i",
    "object": "realtime.item",
    "type": "message",
    "status": "in_progress",
    "role": "assistant",
    "content": []
  }
}
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
{
  "event_id": "event_XkiwbYTBC9Wcdwy6uYJ2G",
  "type": "response.output_item.done",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "output_index": 0,
  "item": {
    "id": "item_JvJauNH2CTXb1D9WV6pD4",
    "object": "realtime.item",
    "type": "message",
    "status": "completed",
    "role": "assistant",
    "content": [
      {
        "type": "audio",
        "text": "Hello, I am a large language model developed by Alibaba Cloud. My name is Qwen. How can I help you?"
      }
    ]
  }
}
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
{
  "event_id": "event_J2UixwYKZsXg7c9YXZetL",
  "type": "response.content_part.added",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": ""
  }
}
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
{
  "event_id": "event_VN4Q4GJugLcc1S23viW8E",
  "type": "response.content_part.done",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_JvJauNH2CTXb1D9WV6pD4",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": "Hello, I am a large language model developed by Alibaba Cloud. My name is Qwen. How can I help you?"
  }
}
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.