Tradução de apoio para consulta. Código e identificadores técnicos preservados. Consultar referência original ↗
Qwen-ASR - Recuperar transcrição
Verifique o status da transcrição
Formato do resultado
Esta seção descreve o formato do resultado para qwen3-asr-flash-filetransmodelo. Para Fun-ASR modelos, consulte Fun-ASR formato do resultado.
Quando o estado é SUCCEEDED, transcription_url contém um link de download JSON válido por 24 horas. Depois disso, você não poderá mais consultar a tarefa ou baixar o resultado.
Estrutura do arquivo de resultados:
| Campo | Tipo | Descrição |
|---|---|---|
| arquivo_url | string | URL do arquivo de áudio. |
| áudio_info.formato | string | Formato de áudio. |
| áudio_info.sample_rate | inteiro | Taxa de amostragem de áudio. |
| transcrições | matriz | Resultados por faixa de áudio. |
Objeto de transcrição
| Campo | Tipo | Descrição |
|---|---|---|
| canal_id | inteiro | Índice de rastreamento, começando em 0. |
| texto | string | Texto reconhecido. |
| frases | matriz | Resultados em nível de frase. |
Objeto de frase
| Campo | Tipo | Descrição |
|---|---|---|
| frase_id | inteiro | Índice de sentença, começando em 0. |
| início_hora | inteiro | Carimbo de data e hora de início (ms). |
| fim_hora | inteiro | Carimbo de data/hora final (ms). |
| texto | string | Texto reconhecido. |
| idioma | string | Idioma detectado. Valores: zh, yue, en, ja, de, ko, ru, fr, pt, ar, it, es, hi, id, th, tr, uk, vi, cs, da, fil, fi, is, ms, no, pl, sv. |
| emoção | string | Emoção detectada. Valores: surprised, neutral, happy, sad, disgusted, angry, fearful. |
| palavras | matriz | Resultados em nível de palavra. Devolvido somente quando enable_words é true. |
Objeto de palavra
| Campo | Tipo | Descrição |
|---|---|---|
| início_hora | inteiro | Carimbo de data e hora de início (ms). |
| fim_hora | inteiro | Carimbo de data/hora final (ms). |
| texto | string | Texto reconhecido. |
| pontuação | string | Marca de pontuação. |
Exemplo de resultado
{
"file_url": "https://***.wav",
"audio_info": {
"format": "wav",
"sample_rate": 16000
},
"transcripts": [
{
"channel_id": 0,
"text": "Senior staff, Principal Doris Jackson, Wakefield faculty, and of course my fellow classmates.I am honored to have been chosen to speak before my classmates along with the students across America today.",
"sentences": [
{
"sentence_id": 0,
"begin_time": 240,
"end_time": 6720,
"language": "en",
"emotion": "happy",
"text": "Senior staff, Principal Doris Jackson, Wakefield faculty, and of course my fellow classmates.",
"words": [
{
"begin_time": 240,
"end_time": 1120,
"text": "Senior ",
"punctuation": ""
},
{
"begin_time": 1120,
"end_time": 1200,
"text": "staff",
"punctuation": ","
}
]
},
{
"sentence_id": 1,
"begin_time": 12268,
"end_time": 17388,
"language": "en",
"emotion": "neutral",
"text": "I am honored to have been chosen to speak before my classmates along with the students across America today.",
"words": [
{
"begin_time": 12268,
"end_time": 12428,
"text": "I ",
"punctuation": ""
},
{
"begin_time": 12428,
"end_time": 12508,
"text": "am ",
"punctuation": ""
}
]
}
]
}
]
}
OpenAPI
openapi: 3.1.0
info:
title: Qwen-ASR Audio File Recognition API
description: API reference for Qwen-ASR audio file recognition. Supports OpenAI-compatible, DashScope synchronous, and DashScope asynchronous protocols.
version: 1.0.0
servers:
- url: https://maas.qwencloudapi.com
description: Singapore
security:
- bearer: []
paths:
/api/v1/tasks/{task_id}:
get:
operationId: asrGetTaskStatus
summary: Query task result
description: Query the status and result of a transcription task.
security:
- bearer: []
parameters:
- name: task_id
in: path
required: true
description: The ID of the task returned by the [Submit transcription task](/api-reference/speech-recognition/qwen-asr/dashscope-async) operation.
schema:
type: string
- name: X-DashScope-Async
in: header
required: true
description: Must be set to `enable`.
schema:
type: string
enum:
- enable
responses:
"200":
description: Task status response
content:
application/json:
schema:
$ref: "#/components/schemas/AsyncASRGetResponse"
example:
request_id: 1dca6c0a-0ed1-4662-aa39-xxxxxxxxxxxx
output:
task_id: 8fab76d0-0eed-4d20-929f-xxxxxxxxxxxx
task_status: SUCCEEDED
submit_time: 2025-10-27 13:57:45.948
scheduled_time: 2025-10-27 13:57:46.018
end_time: 2025-10-27 13:57:47.079
result:
transcription_url: https://dashscope-result.oss-cn-beijing.aliyuncs.com/result.json?Expires=1761631066&OSSAccessKeyId=LTAIxxxx&Signature=xxxx
usage:
seconds: 3
x-codeSamples:
- lang: bash
label: cURL
source: |-
curl --location --request GET 'https://maas.qwencloudapi.com/api/v1/tasks/{task_id}' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "X-DashScope-Async: enable" \
--header "Content-Type: application/json"
- lang: python
label: Python
source: |-
import os
import requests
# If you have not configured the environment variable, replace the following line with your API key: DASHSCOPE_API_KEY = "sk-xxx"
DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY")
# Replace with the actual task_id.
task_id = "xxx"
url = f"https://maas.qwencloudapi.com/api/v1/tasks/{task_id}"
headers = {
"Authorization": f"Bearer {DASHSCOPE_API_KEY}",
"X-DashScope-Async": "enable",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
- lang: java
label: Java
source: |-
import okhttp3.*;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
// Replace with the actual task_id.
String taskId = "xxx";
// If you have not configured the environment variable, replace the following line with your API key: String apiKey = "sk-xxx"
String apiKey = System.getenv("DASHSCOPE_API_KEY");
String apiUrl = "https://maas.qwencloudapi.com/api/v1/tasks/" + taskId;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(apiUrl)
.addHeader("Authorization", "Bearer " + apiKey)
.addHeader("X-DashScope-Async", "enable")
.addHeader("Content-Type", "application/json")
.get()
.build();
try (Response response = client.newCall(request).execute()) {
if (response.body() != null) {
System.out.println(response.body().string());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
- lang: json
label: Response (RUNNING)
source: |-
{
"request_id": "6769df07-2768-4fb0-ad59-xxxxxxxxxxxx",
"output": {
"task_id": "9be1700a-0f8e-4778-be74-xxxxxxxxxxxx",
"task_status": "RUNNING",
"submit_time": "2025-10-27 14:19:31.150",
"scheduled_time": "2025-10-27 14:19:31.233",
"task_metrics": {
"TOTAL": 1,
"SUCCEEDED": 0,
"FAILED": 0
}
}
}
- lang: json
label: Response (FAILED)
source: |-
{
"request_id": "3d141841-858a-466a-9ff9-xxxxxxxxxxxx",
"output": {
"task_id": "c58c7951-7789-4557-9ea3-xxxxxxxxxxxx",
"task_status": "FAILED",
"submit_time": "2025-10-27 15:06:06.915",
"scheduled_time": "2025-10-27 15:06:06.967",
"end_time": "2025-10-27 15:06:07.584",
"code": "FILE_403_FORBIDDEN",
"message": "FILE_403_FORBIDDEN"
}
}
components:
securitySchemes:
bearer:
type: http
scheme: bearer
description: DashScope API key. Get your API key from [QwenCloud console](https://home.qwencloud.com/api-keys).
schemas:
OpenAIASRRequest:
type: object
required:
- model
- messages
properties:
model:
type: string
description: The model name. Only applicable to Qwen3-ASR-Flash.
examples:
- qwen3-asr-flash
messages:
type: array
description: The list of messages.
items:
type: object
required:
- role
- content
properties:
role:
type: string
description: The role of the message sender.
enum:
- system
- user
content:
type: array
description: The content of the message.
items:
type: object
properties:
type:
type: string
description: Set to `input_audio` for audio input.
enum:
- input_audio
input_audio:
type: object
description: The audio input object.
properties:
data:
type: string
description: "The audio to recognize. Supports URLs of Internet-accessible files and Base64-encoded data (Data URL format: `data:<mediatype>;base64,<data>`)."
text:
type: string
description: "Context for customized recognition (System Message only). Provide background text, entity vocabularies, and other reference information. Length limit: 10,000 tokens."
asr_options:
type: object
description: Specifies whether to enable certain features. Not a standard OpenAI parameter — pass it through `extra_body` when using an OpenAI SDK.
properties:
language:
type: string
description: If you know the language of the audio, specify it to improve recognition accuracy. Specify only one language. If the audio contains multiple languages, do not specify this parameter.
enum:
- zh
- yue
- en
- ja
- de
- ko
- ru
- fr
- pt
- ar
- it
- es
- hi
- id
- th
- tr
- uk
- vi
- cs
- da
- fil
- fi
- is
- ms
- no
- pl
- sv
enable_itn:
type: boolean
description: Specifies whether to enable Inverse Text Normalization (ITN). Applicable only to Chinese and English audio.
default: false
stream:
type: boolean
description: Specifies whether to use streaming output. We recommend setting this to `true` to improve responsiveness and reduce the risk of timeouts.
default: false
stream_options:
type: object
description: Configuration for streaming output. Takes effect only when `stream` is `true`.
properties:
include_usage:
type: boolean
description: Specifies whether to include token consumption information in the last data block of the response.
default: false
OpenAIASRResponse:
type: object
properties:
id:
type: string
description: The unique identifier for this call.
example: chatcmpl-487abe5f-d4f2-9363-a877-xxxxxxx
choices:
type: array
description: The output information of the model.
items:
type: object
properties:
finish_reason:
type: string
description: "`null` during generation. `stop` when finished naturally. `length` when output exceeded maximum length."
enum:
- stop
- length
- null
example: stop
index:
type: integer
description: The index of the current object in the `choices` array.
example: 0
message:
type: object
description: The message object output by the model.
properties:
role:
type: string
description: The role of the output message. Always `assistant`.
example: assistant
content:
type: string
description: The speech recognition result text.
example: Welcome to QwenCloud.
annotations:
type: array
description: Output annotation information, such as language and emotion.
items:
type: object
properties:
type:
type: string
description: Set to `audio_info`.
example: audio_info
language:
type: string
description: The language of the recognized audio.
enum:
- zh
- yue
- en
- ja
- de
- ko
- ru
- fr
- pt
- ar
- it
- es
- hi
- id
- th
- tr
- uk
- vi
- cs
- da
- fil
- fi
- is
- ms
- no
- pl
- sv
example: zh
emotion:
type: string
description: The emotion of the recognized audio.
enum:
- surprised
- neutral
- happy
- sad
- disgusted
- angry
- fearful
example: neutral
example:
- emotion: neutral
language: zh
type: audio_info
example:
- finish_reason: stop
index: 0
message:
annotations:
- emotion: neutral
language: zh
type: audio_info
content: Welcome to QwenCloud.
role: assistant
created:
type: integer
description: The UNIX timestamp (in seconds) when the request was created.
example: 1767683986
model:
type: string
description: The model used for this request.
example: qwen3-asr-flash
object:
type: string
description: Always `chat.completion`.
example: chat.completion
usage:
type: object
description: Token consumption information.
properties:
completion_tokens:
type: integer
description: The number of tokens in the model's output.
example: 12
completion_tokens_details:
type: object
properties:
text_tokens:
type: integer
description: The number of tokens in the model's output text.
example: 12
prompt_tokens:
type: integer
description: The number of tokens in the input.
example: 42
prompt_tokens_details:
type: object
properties:
audio_tokens:
type: integer
description: The length of the input audio in tokens. Each second of audio converts to 25 tokens. Audio shorter than 1 second is counted as 1 second.
example: 42
text_tokens:
type: integer
description: Ignore this parameter.
example: 0
seconds:
type: integer
description: The duration of the audio in seconds.
example: 1
total_tokens:
type: integer
description: The total number of tokens in the input and output.
example: 54
examples:
- summary: Non-streaming response
value:
choices:
- finish_reason: stop
index: 0
message:
annotations:
- emotion: neutral
language: zh
type: audio_info
content: Welcome to QwenCloud.
role: assistant
created: 1767683986
id: chatcmpl-487abe5f-d4f2-9363-a877-xxxxxxx
model: qwen3-asr-flash
object: chat.completion
usage:
completion_tokens: 12
completion_tokens_details:
text_tokens: 12
prompt_tokens: 42
prompt_tokens_details:
audio_tokens: 42
text_tokens: 0
seconds: 1
total_tokens: 54
DashScopeASRRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: The model name. Only applicable to Qwen3-ASR-Flash.
examples:
- qwen3-asr-flash
input:
type: object
required:
- messages
description: The input object.
properties:
messages:
type: array
description: The list of messages.
items:
type: object
required:
- role
- content
properties:
role:
type: string
description: The role of the message sender.
enum:
- system
- user
content:
type: array
description: The content of the message.
items:
type: object
properties:
audio:
type: string
description: The audio to recognize (User Message). Supports URLs, Base64-encoded data, and local file paths (SDK only).
text:
type: string
description: "Context for customized recognition (System Message). Length limit: 10,000 tokens."
parameters:
type: object
description: Additional parameters.
properties:
asr_options:
type: object
description: Specifies whether to enable certain features. Supported only by Qwen3-ASR-Flash.
properties:
language:
type: string
description: If you know the language of the audio, specify it to improve recognition accuracy. Specify only one language. If the audio contains multiple languages, do not specify this parameter.
enum:
- zh
- yue
- en
- ja
- de
- ko
- ru
- fr
- pt
- ar
- it
- es
- hi
- id
- th
- tr
- uk
- vi
- cs
- da
- fil
- fi
- is
- ms
- no
- pl
- sv
enable_itn:
type: boolean
description: Specifies whether to enable Inverse Text Normalization (ITN). Applicable only to Chinese and English audio.
default: false
DashScopeASRResponse:
type: object
properties:
request_id:
type: string
description: The unique identifier for this call. The Java SDK returns this as `requestId`.
example: 568e2bf0-d6f2-97f8-9f15-a57b11dc6977
output:
type: object
description: The call result.
properties:
choices:
type: array
description: The model output, included when `result_format` is `message`.
items:
type: object
properties:
finish_reason:
type: string
description: "`null` during generation. `stop` when finished naturally. `length` when output exceeded maximum length."
enum:
- stop
- length
- null
example: stop
message:
type: object
description: The message object output by the model.
properties:
role:
type: string
description: The role of the output message. Always `assistant`.
example: assistant
content:
type: array
description: The output message content.
items:
type: object
properties:
text:
type: string
description: The speech recognition result text.
example: Welcome to QwenCloud.
example:
- text: Welcome to QwenCloud.
annotations:
type: array
description: Output annotation information.
items:
type: object
properties:
type:
type: string
description: Set to `audio_info`.
example: audio_info
language:
type: string
description: The language of the recognized audio.
enum:
- zh
- yue
- en
- ja
- de
- ko
- ru
- fr
- pt
- ar
- it
- es
- hi
- id
- th
- tr
- uk
- vi
- cs
- da
- fil
- fi
- is
- ms
- no
- pl
- sv
example: zh
emotion:
type: string
description: The emotion of the recognized audio.
enum:
- surprised
- neutral
- happy
- sad
- disgusted
- angry
- fearful
example: neutral
example:
- language: zh
type: audio_info
emotion: neutral
example:
- finish_reason: stop
message:
annotations:
- language: zh
type: audio_info
emotion: neutral
content:
- text: Welcome to QwenCloud.
role: assistant
usage:
type: object
description: Token consumption information.
properties:
input_tokens_details:
type: object
properties:
text_tokens:
type: integer
description: Ignore this parameter.
example: 0
output_tokens_details:
type: object
properties:
text_tokens:
type: integer
description: The length of the recognized text output in tokens.
example: 6
seconds:
type: integer
description: The duration of the audio in seconds.
example: 1
examples:
- summary: DashScope synchronous response
value:
output:
choices:
- finish_reason: stop
message:
annotations:
- language: zh
type: audio_info
emotion: neutral
content:
- text: Welcome to QwenCloud.
role: assistant
usage:
input_tokens_details:
text_tokens: 0
output_tokens_details:
text_tokens: 6
seconds: 1
request_id: 568e2bf0-d6f2-97f8-9f15-a57b11dc6977
AsyncASRRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: The model name. Only applicable to Qwen3-ASR-Flash-Filetrans.
examples:
- qwen3-asr-flash-filetrans
input:
type: object
required:
- file_url
description: The input object.
properties:
file_url:
type: string
description: The URL of the audio file to be recognized. Must be accessible over the Internet.
parameters:
type: object
description: Additional parameters.
properties:
language:
type: string
description: If you know the language of the audio, specify it to improve recognition accuracy.
enum:
- zh
- yue
- en
- ja
- de
- ko
- ru
- fr
- pt
- ar
- it
- es
- hi
- id
- th
- tr
- uk
- vi
- cs
- da
- fil
- fi
- is
- ms
- no
- pl
- sv
enable_itn:
type: boolean
description: Specifies whether to enable Inverse Text Normalization (ITN). Applicable only to Chinese and English audio.
default: false
enable_words:
type: boolean
description: "Controls whether to return word-level timestamps. When `false`, returns sentence-level timestamps. When `true`, returns word-level timestamps (supported for Chinese, English, Japanese, Korean, German, French, Spanish, Italian, Portuguese, and Russian). Also affects sentence segmentation: `false` uses VAD-based segmentation, `true` uses VAD and punctuation-based segmentation."
default: false
text:
type: string
description: "Context for customized recognition. Provide background text, entity vocabularies, and other reference information. Length limit: 10,000 tokens."
channel_id:
type: array
items:
type: integer
description: "Indexes of audio tracks to recognize in a multi-track audio file. Index starts from 0. Default: `[0]`. Each specified track is billed separately."
default:
- 0
AsyncASRSubmitResponse:
type: object
properties:
request_id:
type: string
description: The unique identifier for this call.
example: 92e3decd-0c69-47a8-xxxxxxxxxxxx
output:
type: object
properties:
task_id:
type: string
description: The task ID. Use this to query the task result.
example: 8fab76d0-0eed-4d20-xxxxxxxxxxxx
task_status:
type: string
description: The task status.
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
- UNKNOWN
example: PENDING
examples:
- summary: Task submitted
value:
request_id: 92e3decd-0c69-47a8-xxxxxxxxxxxx
output:
task_id: 8fab76d0-0eed-4d20-xxxxxxxxxxxx
task_status: PENDING
AsyncASRGetResponse:
type: object
properties:
request_id:
type: string
description: The unique identifier for this call.
example: 1dca6c0a-0ed1-4662-aa39-xxxxxxxxxxxx
output:
type: object
properties:
task_id:
type: string
description: The task ID.
example: 8fab76d0-0eed-4d20-929f-xxxxxxxxxxxx
task_status:
type: string
description: The task status.
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
- UNKNOWN
example: SUCCEEDED
result:
type: object
description: The recognition result (available when task_status is SUCCEEDED).
properties:
transcription_url:
type: string
description: The download URL for the recognition result JSON file. Valid for 24 hours.
example: https://dashscope-result.oss-cn-beijing.aliyuncs.com/result.json?Expires=1761631066&OSSAccessKeyId=LTAIxxxx&Signature=xxxx
submit_time:
type: string
description: The time when the task was submitted.
example: 2025-10-27 13:57:45.948
scheduled_time:
type: string
description: The time when the task was scheduled (start of execution).
example: 2025-10-27 13:57:46.018
end_time:
type: string
description: The time when the task ended.
example: 2025-10-27 13:57:47.079
task_metrics:
type: object
description: Task metrics with subtask status statistics.
properties:
TOTAL:
type: integer
description: The total number of subtasks.
example: 1
SUCCEEDED:
type: integer
description: The number of successful subtasks.
example: 0
FAILED:
type: integer
description: The number of failed subtasks.
example: 0
code:
type: string
description: Error code. Returned only when the task fails.
example: FILE_403_FORBIDDEN
message:
type: string
description: Error message. Returned only when the task fails.
example: FILE_403_FORBIDDEN
usage:
type: object
description: Token consumption information.
properties:
seconds:
type: integer
description: The duration of the audio in seconds.
example: 3
examples:
- summary: SUCCEEDED
value:
request_id: 1dca6c0a-0ed1-4662-aa39-xxxxxxxxxxxx
output:
task_id: 8fab76d0-0eed-4d20-929f-xxxxxxxxxxxx
task_status: SUCCEEDED
submit_time: 2025-10-27 13:57:45.948
scheduled_time: 2025-10-27 13:57:46.018
end_time: 2025-10-27 13:57:47.079
result:
transcription_url: https://dashscope-result.oss-cn-beijing.aliyuncs.com/result.json?Expires=1761631066&OSSAccessKeyId=LTAIxxxx&Signature=xxxx
usage:
seconds: 3
- summary: RUNNING
value:
request_id: 6769df07-2768-4fb0-ad59-xxxxxxxxxxxx
output:
task_id: 9be1700a-0f8e-4778-be74-xxxxxxxxxxxx
task_status: RUNNING
submit_time: 2025-10-27 14:19:31.150
scheduled_time: 2025-10-27 14:19:31.233
task_metrics:
TOTAL: 1
SUCCEEDED: 0
FAILED: 0
- summary: FAILED
value:
request_id: 3d141841-858a-466a-9ff9-xxxxxxxxxxxx
output:
task_id: c58c7951-7789-4557-9ea3-xxxxxxxxxxxx
task_status: FAILED
submit_time: 2025-10-27 15:06:06.915
scheduled_time: 2025-10-27 15:06:06.967
end_time: 2025-10-27 15:06:07.584
code: FILE_403_FORBIDDEN
message: FILE_403_FORBIDDEN