Qwen-Audio-ASR-Filetrans HTTP API
Submit audio files for asynchronous transcription, check the task status, and download a JSON file with the transcript and timestamps.
NoteThe examples use China (Beijing). Replace {WorkspaceId} with your workspace ID and set DASHSCOPE_API_KEY to an API key for that region.
Submit a task
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcriptionRequest headers
AuthorizationstringRequiredUse the API key for the endpoint region, in the format Bearer <API Key>.
Content-TypestringRequiredThe media type of the request body. Fixed to application/json.
X-DashScope-AsyncstringRequiredThe asynchronous task flag. Required only for the submit task interface. Fixed value: enable. Do not omit it, or the task cannot be submitted.
NoteIf a dedicated deployment returns current user api does not support asynchronous calls, set X-DashScope-Async to disable and use a synchronous request.
Request parameters
modelstringRequiredThe model name.
inputobjectRequiredThe input parameter object.
file_urlsarray[string]RequiredList containing one HTTP or HTTPS URL for the audio or video file. See Audio specifications for supported formats, sizes, and durations.
For production, high-concurrency workloads, and load testing, use a stable file URL from storage such as Alibaba Cloud OSS.
Note(Not recommended) When using a temporary oss:// URL from the file upload API, set the X-DashScope-OssResourceResolve HTTP header to enable. Temporary URLs are supported only by the HTTP API. Temporary URLs expire after 48 hours. The upload credential API has a fixed limit of 100 QPS.
contextarray[object]OptionalOptional conversation context.
rolestringRequiredRole of the context message.
user— Supplies text from a previous user turn.assistant— Supplies the corresponding model reply.
contentarray[object]RequiredThe list of message content items.
typestringRequiredContext content type.
input_text— For ausermessage. Pass the user text intext.text— For anassistantmessage. Pass the model reply intext.
textstringRequiredContext text helps the model recognize domain-specific terms. See Context enhancement. Provide the following content according to type.
input_text— A transcript of a previous user turn or a list of domain terms relevant to the audio.text— A model reply from a previous turn.
Note
- Message count: Provide at most 5 context messages of each type (
input_textandtext). If this limit is exceeded, only the 5 most recent messages are kept. - Text length: The combined length of the
userandassistanttextfields in each turn must not exceed 400 characters. Each character counts as 1. Excess text is truncated from the end. - Message order: Arrange messages by conversation turn. Within each turn, the
usermessage (input_text) must precede its correspondingassistantmessage (text).
parametersobjectRequiredAlways include parameters, using an empty object {} if no options are needed. Omitting this field causes the submitted transcription task to fail.
channel_idarray[integer]OptionalZero-based indices of the tracks to transcribe. Defaults to [0]. For example, [0, 1] selects the first two tracks. Each selected track is billed separately.
diarization_enabledbooleanOptionalEnables speaker diarization. Defaults to false. When set to true, the model distinguishes speakers and labels each transcribed sentence with a speaker_id.
NoteSpeaker diarization supports mono audio only. Keep recordings to 2 hours or less to reduce the risk of failures or timeouts.
speaker_countintegerOptionalNoteApplies when diarization_enabled is true.
Estimated number of speakers, from 2 to 100. Omit it to let the model detect the number automatically. The detected count can differ from the estimate.
keep_dialectbooleanOptionalNoteApplies only to qwen-audio-3.1-asr-flash-filetrans.
Whether to preserve dialect expressions.
false— Transcribe dialect speech as standard Mandarin text (default).true— Preserve dialect expressions.
language_hintsarray[string]OptionalThe language codes to recognize. If you can't determine the language in advance, leave it unset and the model detects the language automatically.
You can set up to 4 values. If you set more, only the first 4 take effect.
Click to view the supported language codes
zh: Chineseen: Englishja: Japaneseko: Koreanvi: Vietnameseth: Thaiid: Indonesianms: Malaytl: Filipinohi: Hindiar: Arabicfr: Frenchde: Germanes: Spanishpt: Portugueseru: Russianit: Italiannl: Dutchsv: Swedishda: Danishfi: Finnishno: Norwegianel: Greekpl: Polishcs: Czechhu: Hungarianro: Romanianbg: Bulgarianhr: Croatiansk: Slovak
vocabulary_idstringOptionalThe ID of a precompiled hot word list.
Generate this ID in advance by calling the create hot word list API. Pass the ID during recognition to use the hot words in the list.
Suitable for scenarios where the vocabulary is known and relatively stable, and where you need to reuse the same word list across requests.
For usage details, see Precompiled hotwords.
vocabularyobjectOptionalUse instant hotwords to supply terms for this request without creating a vocabulary list. Each key is a term (string) and each value is its weight (integer), for example {"Kelira": 5}.
Supported hotword weights:
1–5— Higher weights make the model more likely to recognize the term.50— Marks a super hotword to substantially improve recall. Specify up to 50 super hotwords.
NoteWhen you supply both vocabulary_id and vocabulary, the service merges the two sets of hotwords. If the combined set exceeds 2,000 hotwords, it uses 2,000 selected at random.
special_word_filterstringOptionalConfigure words to replace or remove. The parameter is a JSON string with these fields:
filter_with_signed.word_list: A string array of words to replace with an equal number of*characters.filter_with_empty.word_list: A string array of words to remove from the result.system_reserved_filter: A boolean, defaulttrue, that controls whether to also use the built-in word list. Custom rules still apply when it isfalse.
If this parameter is omitted, matches in the built-in Model Studio sensitive-word list are replaced with an equal number of * characters.
For example, replace project with an equal number of asterisks and remove report using the following value:
{
"special_word_filter": "{\"filter_with_signed\":{\"word_list\":[\"project\"]},\"filter_with_empty\":{\"word_list\":[\"report\"]},\"system_reserved_filter\":true}"
}
Response body
request_idstringThe unique identifier of this call.
outputobjectThe data returned by the submit task interface.
task_idstringThe task ID. Pass this ID as the string in the Query task interface.
task_statusstringThe task status. Returns PENDING on successful submission.
Basic transcription
curl "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcription" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
--data '{
"model": "qwen-audio-3.1-asr-flash-filetrans",
"input": {
"file_urls": [
"https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
]
},
"parameters": {}
}'
{
"output": {
"task_id": "8df7cbfd-cfec-4036-8ab7-ef02d2130bfc",
"task_status": "PENDING"
},
"request_id": "ca27226f-d0ab-9aae-b89e-767373a24aac"
}
With context
curl "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcription" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
--data '{
"model": "qwen-audio-3.1-asr-flash-filetrans",
"input": {
"file_urls": [
"https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
],
"context": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "The project manager is named Kelira."
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "I will use Kelira in the report."
}
]
}
]
},
"parameters": {}
}'
{
"output": {
"task_id": "31ba1c04-13a4-4444-beb0-1ae4e94cd804",
"task_status": "PENDING"
},
"request_id": "746673f1-36e8-9c1c-b6eb-d7ab3653fed9"
}
Speaker diarization
curl "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcription" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
--data '{
"model": "qwen-audio-3.1-asr-flash-filetrans",
"input": {
"file_urls": [
"https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav"
]
},
"parameters": {
"diarization_enabled": true
}
}'
{
"output": {
"task_id": "76078063-62ac-4246-b7de-c77f13204b59",
"task_status": "PENDING"
},
"request_id": "345d1b18-1be3-9585-8d84-dce410d98408"
}
Query a task
For high-concurrency batch transcription, configure asynchronous task callbacks and query the result with task_id after receiving a completion notification.
Note
- When polling, the default limit is 20 QPS across the Alibaba Cloud account and its RAM users. Start with a 2–5 second interval per task and adjust for the number of concurrent tasks.
- To query tasks submitted in the past 24 hours in batches or cancel a task in the
PENDINGstate, see Manage asynchronous tasks.
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}Request headers
AuthorizationstringRequiredUse the API key for the endpoint region, in the format Bearer <API Key>.
Request parameters
task_idstringRequiredUse the output.task_id returned at submission as the {task_id} path segment of the request URL.
Response body
request_idstringThe unique identifier of this call.
outputobjectThe data returned by the query task interface.
task_idstringThe ID of the queried task.
task_statusstringTask status.
PENDING— Queued.RUNNING— Running.SUCCEEDED— When a task contains multiple subtasks, the service marks the entire task asSUCCEEDEDif any subtask succeeds. Checkresults[].subtask_statusfor the transcription status of each file.FAILED— Failed. Checkcodeandmessage.UNKNOWN— The task does not exist or its status is unknown.
submit_timestringThe time the task was submitted.
scheduled_timestringThe time the task was scheduled to run.
end_timestringThe time the task ended.
resultsarray[object]The list of subtask results, one for each audio file to recognize.
subtask_statusstringThe subtask status.
file_urlstringThe URL of the file processed by the file transcription task.
transcription_urlstringURL of the JSON result for a successful subtask. It is valid for 24 hours. For the download command and file format, see Download the transcript.
codestringThe error code of the failed subtask.
NoteReturned only when the subtask fails.
messagestringThe error message of the failed subtask.
NoteReturned only when the subtask fails.
task_metricsobjectOverall execution statistics for the task.
TOTALintegerThe total number of subtasks.
SUCCEEDEDintegerThe number of successful subtasks.
FAILEDintegerThe number of failed subtasks.
codestringError code returned when the task fails.
messagestringError message returned when the task fails.
usageobjectUsage returned after successful transcription.
Note
- qwen-audio-3.0-asr-flash-filetrans is billed by the duration of recognized speech (
duration). - qwen-audio-3.1-asr-flash-filetrans is billed by input and output tokens (
input_tokensandoutput_tokens). Their sum istotal_tokens.
durationintegerProcessed audio duration, in seconds.
Noteqwen-audio-3.0-asr-flash-filetrans bills only the portions identified as speech. Silence and other non-speech segments are excluded.
input_tokensintegerThe number of input tokens consumed by this request.
output_tokensintegerThe number of output tokens consumed by this request.
total_tokensintegerThe total number of tokens consumed by this request, equal to the sum of input_tokens and output_tokens.
Success
curl "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/8df7cbfd-cfec-4036-8ab7-ef02d2130bfc" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
{
"request_id": "f923c588-a529-935d-a48a-57eae0d886d1",
"output": {
"task_id": "8df7cbfd-cfec-4036-8ab7-ef02d2130bfc",
"task_status": "SUCCEEDED",
"submit_time": "2026-11-26 23:40:29.673",
"scheduled_time": "2026-11-26 23:40:29.727",
"end_time": "2026-11-26 23:40:30.392",
"results": [
{
"file_url": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav",
"subtask_status": "SUCCEEDED",
"transcription_url": "https://example.com/result.json"
}
]
},
"usage": {
"duration": 4,
"total_tokens": 59,
"output_tokens": 12,
"input_tokens": 47
}
}
Failure
curl "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/e293951a-5739-474a-8445-1b4e14a124c2" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
{
"request_id": "2afd5564-5b01-9546-bc4d-079df24185bf",
"output": {
"task_id": "e293951a-5739-474a-8445-1b4e14a124c2",
"task_status": "FAILED",
"submit_time": "2026-11-26 23:40:30.279",
"scheduled_time": "2026-11-26 23:40:30.366",
"end_time": "2026-11-26 23:40:30.860",
"code": "FILE_403_FORBIDDEN",
"message": "FILE_403_FORBIDDEN",
"results": [
{
"file_url": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092-missing.wav",
"subtask_status": "FAILED"
}
]
}
}
Download the transcript
Set TRANSCRIPTION_URL to the transcription_url returned for a successful subtask. The download URL is valid for 24 hours.
file_urlstringURL of the input audio or video file.
propertiesobjectProperties of the source audio.
audio_formatstringThe audio format of the source file.
channelsarray[integer]The track index of the audio in the source file. For single-track audio, [0] is returned; for dual-track audio, [0, 1] is returned; and so on.
original_sampling_rateintegerThe sampling rate (Hz) of the audio in the source file.
original_duration_in_millisecondsintegerThe original audio duration (ms) in the source file.
transcriptsarray[object]Transcripts for individual audio channels.
channel_idintegerThe track index of the transcription result, starting from 0.
content_duration_in_millisecondsintegerDuration in milliseconds of the portions identified as speech on this track. Silence and other non-speech segments are excluded, so this value can be shorter than the original duration.
textstringThe paragraph-level transcription result.
sentencesarray[object]The sentence-level transcription result.
sentence_idintegerThe sentence number, starting from 1.
begin_timeintegerThe start timestamp (ms).
end_timeintegerThe end timestamp (ms).
textstringThe transcription result.
speaker_idintegerThe index of the current speaker, starting from 0, used to distinguish between different speakers.
NoteThis field appears in the recognition result only when speaker diarization is enabled.
wordsarray[object]The word-level transcription result.
begin_timeintegerThe start timestamp (ms).
end_timeintegerThe end timestamp (ms).
textstringThe transcription result.
punctuationstringThe punctuation predicted after the word, if any.
curl --location --output transcription.json "$TRANSCRIPTION_URL"
Basic transcription
{
"file_url": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav",
"properties": {
"audio_format": "pcm_s16le",
"channels": [
0
],
"original_sampling_rate": 16000,
"original_duration_in_milliseconds": 3782
},
"transcripts": [
{
"channel_id": 0,
"content_duration_in_milliseconds": 3640,
"text": "Please send the quarterly project report to Kellera before Friday. ",
"sentences": [
{
"begin_time": 120,
"end_time": 3760,
"text": "Please send the quarterly project report to Kellera before Friday. ",
"sentence_id": 1,
"words": [
{
"begin_time": 120,
"end_time": 320,
"text": "Please",
"punctuation": ""
},
{
"begin_time": 320,
"end_time": 560,
"text": " send",
"punctuation": ""
},
{
"begin_time": 560,
"end_time": 760,
"text": " the",
"punctuation": ""
},
{
"begin_time": 760,
"end_time": 1360,
"text": " quarterly",
"punctuation": ""
},
{
"begin_time": 1360,
"end_time": 1800,
"text": " project",
"punctuation": ""
},
{
"begin_time": 1800,
"end_time": 2120,
"text": " report",
"punctuation": ""
},
{
"begin_time": 2120,
"end_time": 2280,
"text": " to",
"punctuation": ""
},
{
"begin_time": 2280,
"end_time": 2392,
"text": " K",
"punctuation": ""
},
{
"begin_time": 2392,
"end_time": 2560,
"text": "ell",
"punctuation": ""
},
{
"begin_time": 2560,
"end_time": 2800,
"text": "era",
"punctuation": ""
},
{
"begin_time": 2800,
"end_time": 3160,
"text": " before",
"punctuation": ""
},
{
"begin_time": 3160,
"end_time": 3760,
"text": " Friday",
"punctuation": ". "
}
]
}
]
}
]
}
Speaker diarization
{
"file_url": "https://g-adoc.alcasset.com/media/maas_docs/sfm-cn/en/audios/6a4b3c2d1e0f9092.wav",
"properties": {
"audio_format": "pcm_s16le",
"channels": [
0
],
"original_sampling_rate": 16000,
"original_duration_in_milliseconds": 3782
},
"transcripts": [
{
"channel_id": 0,
"content_duration_in_milliseconds": 3640,
"text": "Please send the quarterly project report to Kellera before Friday. ",
"sentences": [
{
"begin_time": 120,
"end_time": 3760,
"text": "Please send the quarterly project report to Kellera before Friday. ",
"sentence_id": 1,
"speaker_id": 0,
"words": [
{
"begin_time": 120,
"end_time": 320,
"text": "Please",
"punctuation": ""
},
{
"begin_time": 320,
"end_time": 560,
"text": " send",
"punctuation": ""
},
{
"begin_time": 560,
"end_time": 760,
"text": " the",
"punctuation": ""
},
{
"begin_time": 760,
"end_time": 1360,
"text": " quarterly",
"punctuation": ""
},
{
"begin_time": 1360,
"end_time": 1800,
"text": " project",
"punctuation": ""
},
{
"begin_time": 1800,
"end_time": 2120,
"text": " report",
"punctuation": ""
},
{
"begin_time": 2120,
"end_time": 2280,
"text": " to",
"punctuation": ""
},
{
"begin_time": 2280,
"end_time": 2392,
"text": " K",
"punctuation": ""
},
{
"begin_time": 2392,
"end_time": 2560,
"text": "ell",
"punctuation": ""
},
{
"begin_time": 2560,
"end_time": 2800,
"text": "era",
"punctuation": ""
},
{
"begin_time": 2800,
"end_time": 3160,
"text": " before",
"punctuation": ""
},
{
"begin_time": 3160,
"end_time": 3760,
"text": " Friday",
"punctuation": ". "
}
]
}
]
}
]
}