Skip to main content
Realtime

Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime server events

WebSocket server event reference for Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime real-time speech recognition

The Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime real-time speech recognition service pushes server-side events to the client over WebSocket. This topic describes the data structures and field descriptions of the four event types: task-started, result-generated, task-finished, and task-failed. User guide: For model descriptions and selection guidance, see Speech-to-text models. Event interaction flow: To understand the event interaction sequence, see WebSocket API.

task-started

Description: The task has started successfully. The client can begin sending audio data.
Example
{
  "header": {
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "event": "task-started",
    "attributes": {}
  },
  "payload": {}
}
object
body
Message header.
object
body
This value is always {}.

result-generated

Description: The recognition result. It includes intermediate results (sentence_end=false) and final results (sentence_end=true). The first intermediate result for a new sentence includes sentence_begin=true.
Sentence-start result
{
  "header": {
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "event": "result-generated",
    "attributes": {}
  },
  "payload": {
    "output": {
      "sentence": {
        "begin_time": 0,
        "end_time": null,
        "text": "",
        "sentence_begin": true,
        "sentence_end": false,
        "sentence_id": 1,
        "words": []
      }
    },
    "usage": null
  }
}
Final result
{
  "header": {
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "event": "result-generated",
    "attributes": {}
  },
  "payload": {
    "output": {
      "sentence": {
        "begin_time": 170,
        "end_time": 920,
        "text": "OK, got it.",
        "heartbeat": false,
        "sentence_end": true,
        "sentence_id": 1,
        "words": [
          {
            "begin_time": 170,
            "end_time": 295,
            "text": "OK",
            "punctuation": ","
          },
          {
            "begin_time": 295,
            "end_time": 503,
            "text": "got",
            "punctuation": ""
          },
          {
            "begin_time": 503,
            "end_time": 711,
            "text": "it",
            "punctuation": ""
          },
          {
            "begin_time": 711,
            "end_time": 920,
            "text": "",
            "punctuation": "."
          }
        ]
      }
    },
    "usage": {
      "duration": 3
    }
  }
}
object
body
Message header.
object
body
Message payload.

task-finished

Description: The task has ended normally. You can close the connection or reuse it.
Example
{
  "header": {
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "event": "task-finished",
    "attributes": {}
  },
  "payload": {
    "output": {},
    "usage": null
  }
}
object
body
Message header.
object
body
You can ignore this field. This value is usually {}.

task-failed

Description: The task has failed. The connection is closed and cannot be reused.
Example
{
  "header": {
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "event": "task-failed",
    "error_code": "CLIENT_ERROR",
    "error_message": "request timeout after 23 seconds.",
    "attributes": {}
  },
  "payload": {}
}
object
body
Message header.
object
body
This value is always {}.