Skip to main content
Realtime

Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime real-time speech recognition client events

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

This topic describes the client events that the client sends to the server over WebSocket in the Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime real-time speech recognition service, including the data structures and field definitions for run-task (start a task) and finish-task (end a task). User guide: For model descriptions and selection guidance, see Speech-to-text models. Event interaction flow: For the event interaction sequence, see WebSocket API.

run-task

Description: Starts a speech recognition task and sets parameters such as the model, audio format, and sample rate. When to send: Send immediately after the WebSocket connection is established. Response event: You can send audio only after the server returns the task-started event.
Example
{
  "header": {
    "action": "run-task",
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "streaming": "duplex"
  },
  "payload": {
    "task_group": "audio",
    "task": "asr",
    "function": "recognition",
    "model": "qwen-audio-3.0-asr-flash-streaming",
    "parameters": {
      "format": "pcm",
      "sample_rate": 16000
    },
    "input": {}
  }
}
With context
{
  "header": {
    "action": "run-task",
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "streaming": "duplex"
  },
  "payload": {
    "task_group": "audio",
    "task": "asr",
    "function": "recognition",
    "model": "qwen-audio-3.0-asr-flash-streaming",
    "parameters": {
      "format": "pcm",
      "sample_rate": 16000
    },
    "input": {
      "context": [
        {
          "role": "user",
          "content": [
            {
              "type": "input_text",
              "text": "Hello there"
            }
          ]
        },
        {
          "role": "assistant",
          "content": [
            {
              "type": "text",
              "text": "Hello, I am Qwen. How can I help you?"
            }
          ]
        }
      ]
    }
  }
}
Instant hot words
{
  "header": {
    "action": "run-task",
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "streaming": "duplex"
  },
  "payload": {
    "task_group": "audio",
    "task": "asr",
    "function": "recognition",
    "model": "qwen-audio-3.0-asr-flash-streaming",
    "parameters": {
      "format": "pcm",
      "sample_rate": 16000,
      "vocabulary": {"John Smith": 5, "Jane Doe": 5}
    },
    "input": {}
  }
}
object
body
required
Message header.
object
body
required
Message payload.

continue-task

Description: Updates the conversation context during task execution to improve recognition. When to send: Send during task execution when you need to update the conversation context.
Only the qwen-audio-3.0-asr-flash-streaming, fun-asr-realtime, and fun-asr-realtime-2025-11-07 models support this event.
Example
{
  "header": {
    "action": "continue-task",
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "streaming": "duplex"
  },
  "payload": {
    "input": {
      "context": [
        {
          "role": "user",
          "content": [
            {
              "type": "input_text",
              "text": "Hello there"
            }
          ]
        },
        {
          "role": "assistant",
          "content": [
            {
              "type": "text",
              "text": "Hello, I am Qwen. How can I help you?"
            }
          ]
        }
      ]
    }
  }
}
object
body
required
Message header.
object
body
required
Message payload.

finish-task

Description: Notifies the server that all audio has been sent and requests to end the task. When to send: Send after all audio data has been sent. Response event: The server returns the task-finished event.
Example
{
  "header": {
    "action": "finish-task",
    "task_id": "2bf83b9a-baeb-4fda-8d9a-xxxxxxxxxxxx",
    "streaming": "duplex"
  },
  "payload": {
    "input": {}
  }
}
object
body
required
Message header.
object
body
required
Message payload.
Qwen-Audio-3.0-ASR-Flash-Streaming/Fun-ASR-Realtime real-time speech recognition client events - QwenCloud