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.
Event interaction flow: To understand the event interaction sequence, see WebSocket API.
Description: The task has started successfully. The client can begin sending audio data.
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.
Description: The task has ended normally. You can close the connection or reuse it.
Description: The task has failed. The connection is closed and cannot be reused.
task-started
Description: The task has started successfully. The client can begin sending audio data.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-started.attributesobjectAdditional attributes. This value is usually empty.objectThis 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.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always result-generated.object
Properties output object
Properties usage objectWhen payload.output.sentence.sentence_end is false (the current sentence has not ended), usage is null.When payload.output.sentence.sentence_end is true (the current sentence has ended), usage.duration is the billed duration of the current task.
Properties duration integerThe billed task duration, in seconds.
Properties sentence object
Properties begin_time integerThe start time of the sentence, in milliseconds.end_timeintegerThe end time of the sentence, in milliseconds.textstringThe recognized text.heartbeatbooleanIf this value is true, the result is a heartbeat packet and can be ignored.sentence_beginbooleanIndicates the start of a sentence.sentence_endbooleanWhether the sentence has ended (true = final result, false = intermediate result).sentence_idintegerThe sequence identifier of the sentence. In normal recognition results, sentence_id increments from 1. When heartbeat is true (that is, a heartbeat packet), sentence_id is always 0.wordsarray[object]Word-level timestamp information.
Properties begin_time integerThe start time of the word, in milliseconds.end_timeintegerThe end time of the word, in milliseconds.textstringThe recognized text.punctuationstringThe punctuation mark. | Sentence-start result: |
task-finished
Description: The task has ended normally. You can close the connection or reuse it.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-finished.attributesobjectAdditional attributes. This value is usually empty.objectYou can ignore this field. This value is usually {}. |
task-failed
Description: The task has failed. The connection is closed and cannot be reused.
headerobject
Properties task_id stringThe task ID generated by the client (in UUID format).eventstringThe event type. This value is always task-failed.error_codestringA description of the error type.error_messagestringThe specific cause of the error.attributesobjectAdditional attributes. This value is usually empty.objectThis value is always {}. |