This topic describes the events that the server sends to the client during a WebSocket session with the Qwen-ASR-Realtime API.
error
Sent when the server detects a client or server error.
|
session.created
Sent first after successful connection. Contains default session configurations.
|
session.updated
Sent after successfully processing the client's session.update event. On error, an error event is sent instead.
|
input_audio_buffer.speech_started
Sent in VAD mode when speech starts in the audio buffer.
Can occur each time audio is added to the buffer, unless speech start has been detected.
|
input_audio_buffer.speech_stopped
Sent in VAD mode when speech ends in the audio buffer.
After this event, the server immediately sends a conversation.item.created event containing the user message item created from the audio buffer.
|
input_audio_buffer.committed
- VAD mode: Sent after the client sends audio data via input_audio_buffer.append event.
- Manual mode: Sent after the client sends audio data via input_audio_buffer.append event, then sends input_audio_buffer.commit event.
|
conversation.item.created
Sent when a new conversation item is created.
|
conversation.item.input_audio_transcription.text
Sent frequently with real-time recognition results.
| Parameter | Type | Description |
|---|---|---|
| type | string | The type of the event. Fixed to conversation.item.input_audio_transcription.text. |
| event_id | string | The ID of the event. |
| item_id | string | The ID of the associated conversation item. |
| content_index | integer | The index of the content part that contains the audio. |
| language | string | Language of the recognized audio. Matches the language request parameter if specified.Possible values:
|
| emotion | string | Emotion recognition is always enabled and requires no configuration. The emotion detected in the audio. The following emotions are supported:
|
| text | string | Confirmed text prefix — the part of the current sentence that the model has verified and won't change. |
| stash | string | Pre-recognized text suffix following the confirmed part. Temporary draft the model is still processing and may correct. |
text + stash.
Click to view an example
Click to view an example
| Timestamp | User speech progress | API response (text and stash) | UI display (text + stash) |
|---|---|---|---|
| T1 | "The..." | text: "" stash: "The" | The |
| T2 | "...weather is..." | Text: "" stash: "The weather is" | The weather is |
| T3 | "...nice today" | text: "The" stash: "weather is nice today" | The weather is nice today (Note: "The" is confirmed and moved to the text field.) |
| T4 | (Short pause) | text: "The weather is nice today," stash: "" | The weather is nice today, (The first clause is fully confirmed.) |
| T5 | "...sunny and..." | text: "The weather is nice today," stash: "sunny and" | The weather is nice today, sunny and |
| T6 | "...bright." | text: "The weather is nice today," stash: "sunny and bright." | The weather is nice today, sunny and bright. |
| T7 | (User stops speaking) | - | Use the content of the transcript from the conversation.item.input_audio_transcription.completed event as the final result. |
conversation.item.input_audio_transcription.completed
Sends the final recognition result, marking the end of a conversation item.
|
conversation.item.input_audio_transcription.failed
Sent when input audio recognition fails. Handled separately from other error events to identify the specific failed item.
|
session.finished
Session finished; all audio recognition complete.
Sent after the client sends session.finish event. Client can disconnect after receiving this.
|