task-started
當用戶端發送 run-task 指令後,服務端返回 task-started 事件,標誌任務已成功開啟。只有在接收到該事件後,用戶端才能繼續發送後續指令。
header.task_id string用戶端產生的任務 ID。header.event string事件類型,固定為 task-started。payload object無內容,為空白對象。 |
result-generated
用戶端發送文本後,服務端持續返回 result-generated 事件。該事件返回句子元資訊。
header.task_id string用戶端產生的任務 ID。header.event string事件類型,固定為 result-generated。payload.output object輸出資訊。
屬性 type string子事件類型,取值:
integer句子編號,從 0 開始。sentence.words array字層級時間戳記資訊數組。
words 元素屬性 text string字的常值內容。begin_index integer字在句子中的開始位置索引,從 0 開始。end_index integer字在句子中的結束位置索引,從 1 開始。begin_time integer字對應音訊開始時間戳,單位:毫秒。end_time integer字對應音訊結束時間戳記,單位:毫秒。string分句後的句子常值內容。object計費用量,在 sentence-end 事件中返回。qwen-audio-3.1-tts-flash 按輸入和輸出 Token 計費;qwen-audio-3.1-tts-plus、qwen-audio-3.0-tts-plus 和 qwen-audio-3.0-tts-flash 按字元計費。
屬性 input_tokens integer本次請求的輸入 Token 數。適用於 qwen-audio-3.1-tts-plus、qwen-audio-3.1-tts-flash。integer本次請求的輸出 Token 數。適用於 qwen-audio-3.1-tts-plus、qwen-audio-3.1-tts-flash。integer輸入和輸出 Token 數之和。適用於 qwen-audio-3.1-tts-plus、qwen-audio-3.1-tts-flash。integer累計計費字元數。 |
task-finished
服務端返回 task-finished 事件,標誌任務已結束。用戶端可以關閉 WebSocket 串連或複用串連開啟新任務。
header.task_id string用戶端產生的任務 ID。header.event string事件類型,固定為 task-finished。payload.usage object欄位含義與 result-generated 的 usage 相同。 |
task-failed
當任務失敗時,服務端返回 task-failed 事件。用戶端需要關閉 WebSocket 串連並處理錯誤。
header.task_id string用戶端產生的任務 ID。header.event string事件類型,固定為 task-failed。header.error_code string錯誤碼。header.error_message string具體錯誤資訊。 |