Qwen-Audio-ASR-Filetrans HTTP API

Updated at:

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

POSThttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/asr/transcription

Request headers

AuthorizationstringRequired

Use the API key for the endpoint region, in the format Bearer <API Key>.

Content-TypestringRequired

The media type of the request body. Fixed to application/json.

X-DashScope-AsyncstringRequired

The 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

modelstringRequired

The model name.

inputobjectRequired

The input parameter object.

file_urlsarray[string]Required

List 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]Optional

Optional conversation context.

rolestringRequired

Role of the context message.

  • user — Supplies text from a previous user turn.
  • assistant — Supplies the corresponding model reply.
contentarray[object]Required

The list of message content items.

typestringRequired

Context content type.

  • input_text — For a user message. Pass the user text in text.
  • text — For an assistant message. Pass the model reply in text.
textstringRequired

Context 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_text and text). If this limit is exceeded, only the 5 most recent messages are kept.
  • Text length: The combined length of the user and assistant text fields 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 user message (input_text) must precede its corresponding assistant message (text).
parametersobjectRequired

Always include parameters, using an empty object {} if no options are needed. Omitting this field causes the submitted transcription task to fail.

channel_idarray[integer]Optional

Zero-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_enabledbooleanOptional

Enables 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_countintegerOptional

NoteApplies 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_dialectbooleanOptional

NoteApplies 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]Optional

The 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: Chinese
  • en: English
  • ja: Japanese
  • ko: Korean
  • vi: Vietnamese
  • th: Thai
  • id: Indonesian
  • ms: Malay
  • tl: Filipino
  • hi: Hindi
  • ar: Arabic
  • fr: French
  • de: German
  • es: Spanish
  • pt: Portuguese
  • ru: Russian
  • it: Italian
  • nl: Dutch
  • sv: Swedish
  • da: Danish
  • fi: Finnish
  • no: Norwegian
  • el: Greek
  • pl: Polish
  • cs: Czech
  • hu: Hungarian
  • ro: Romanian
  • bg: Bulgarian
  • hr: Croatian
  • sk: Slovak
vocabulary_idstringOptional

The 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.

vocabularyobjectOptional

Use 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_filterstringOptional

Configure 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, default true, that controls whether to also use the built-in word list. Custom rules still apply when it is false.

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_idstring

The unique identifier of this call.

outputobject

The data returned by the submit task interface.

task_idstring

The task ID. Pass this ID as the string in the Query task interface.

task_statusstring

The 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 PENDING state, see Manage asynchronous tasks.
GEThttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}

Request headers

AuthorizationstringRequired

Use the API key for the endpoint region, in the format Bearer <API Key>.

Request parameters

task_idstringRequired

Use the output.task_id returned at submission as the {task_id} path segment of the request URL.

Response body

request_idstring

The unique identifier of this call.

outputobject

The data returned by the query task interface.

task_idstring

The ID of the queried task.

task_statusstring

Task status.

  • PENDING — Queued.
  • RUNNING — Running.
  • SUCCEEDED — When a task contains multiple subtasks, the service marks the entire task as SUCCEEDED if any subtask succeeds. Check results[].subtask_status for the transcription status of each file.
  • FAILED — Failed. Check code and message.
  • UNKNOWN — The task does not exist or its status is unknown.
submit_timestring

The time the task was submitted.

scheduled_timestring

The time the task was scheduled to run.

end_timestring

The time the task ended.

resultsarray[object]

The list of subtask results, one for each audio file to recognize.

subtask_statusstring

The subtask status.

file_urlstring

The URL of the file processed by the file transcription task.

transcription_urlstring

URL 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.

codestring

The error code of the failed subtask.

NoteReturned only when the subtask fails.

messagestring

The error message of the failed subtask.

NoteReturned only when the subtask fails.

task_metricsobject

Overall execution statistics for the task.

TOTALinteger

The total number of subtasks.

SUCCEEDEDinteger

The number of successful subtasks.

FAILEDinteger

The number of failed subtasks.

codestring

Error code returned when the task fails.

messagestring

Error message returned when the task fails.

usageobject

Usage 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_tokens and output_tokens). Their sum is total_tokens.
durationinteger

Processed 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_tokensinteger

The number of input tokens consumed by this request.

output_tokensinteger

The number of output tokens consumed by this request.

total_tokensinteger

The 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_urlstring

URL of the input audio or video file.

propertiesobject

Properties of the source audio.

audio_formatstring

The 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_rateinteger

The sampling rate (Hz) of the audio in the source file.

original_duration_in_millisecondsinteger

The original audio duration (ms) in the source file.

transcriptsarray[object]

Transcripts for individual audio channels.

channel_idinteger

The track index of the transcription result, starting from 0.

content_duration_in_millisecondsinteger

Duration 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.

textstring

The paragraph-level transcription result.

sentencesarray[object]

The sentence-level transcription result.

sentence_idinteger

The sentence number, starting from 1.

begin_timeinteger

The start timestamp (ms).

end_timeinteger

The end timestamp (ms).

textstring

The transcription result.

speaker_idinteger

The 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_timeinteger

The start timestamp (ms).

end_timeinteger

The end timestamp (ms).

textstring

The transcription result.

punctuationstring

The 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": ". "
            }
          ]
        }
      ]
    }
  ]
}