$npx -y skills add cinience/alicloud-skills --skill aliyun-qwen-asrUse when transcribing non-realtime speech with Alibaba Cloud Model Studio Qwen ASR models (qwen3-asr-flash, qwen-audio-asr, qwen3-asr-flash-filetrans). Use when converting recorded audio files to text, generating transcripts with timestamps, or documenting DashScope/OpenAI-
| 1 | Category: provider |
| 2 | |
| 3 | # Model Studio Qwen ASR (Non-Realtime) |
| 4 | |
| 5 | ## Validation |
| 6 | |
| 7 | ```bash |
| 8 | mkdir -p output/aliyun-qwen-asr |
| 9 | python -m py_compile skills/ai/audio/aliyun-qwen-asr/scripts/transcribe_audio.py && echo "py_compile_ok" > output/aliyun-qwen-asr/validate.txt |
| 10 | ``` |
| 11 | |
| 12 | Pass criteria: command exits 0 and `output/aliyun-qwen-asr/validate.txt` is generated. |
| 13 | |
| 14 | ## Output And Evidence |
| 15 | |
| 16 | - Store transcripts and API responses under `output/aliyun-qwen-asr/`. |
| 17 | - Keep one command log or sample response per run. |
| 18 | |
| 19 | Use Qwen ASR for recorded audio transcription (non-realtime), including short audio sync calls and long audio async jobs. |
| 20 | |
| 21 | ## Critical model names |
| 22 | |
| 23 | Use one of these exact model strings: |
| 24 | - `qwen3-asr-flash` |
| 25 | - `qwen3-asr-flash-2026-02-10` |
| 26 | - `qwen-audio-asr` |
| 27 | - `qwen3-asr-flash-filetrans` |
| 28 | - `qwen3-asr-flash-filetrans-2025-11-17` |
| 29 | |
| 30 | Selection guidance: |
| 31 | - Use `qwen3-asr-flash`, `qwen3-asr-flash-2026-02-10`, or `qwen-audio-asr` for short/normal recordings (sync). |
| 32 | - Use `qwen3-asr-flash-filetrans` or `qwen3-asr-flash-filetrans-2025-11-17` for long-file transcription (async task workflow). |
| 33 | |
| 34 | ## Prerequisites |
| 35 | |
| 36 | - Install SDK dependencies (script uses Python stdlib only): |
| 37 | |
| 38 | ```bash |
| 39 | python3 -m venv .venv |
| 40 | . .venv/bin/activate |
| 41 | ``` |
| 42 | |
| 43 | - Set `DASHSCOPE_API_KEY` in environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials`. |
| 44 | |
| 45 | ## Normalized interface (asr.transcribe) |
| 46 | |
| 47 | ### Request |
| 48 | - `audio` (string, required): public URL or local file path. |
| 49 | - `model` (string, optional): default `qwen3-asr-flash`. |
| 50 | - `language_hints` (array<string>, optional): e.g. `zh`, `en`. |
| 51 | - `sample_rate` (number, optional) |
| 52 | - `vocabulary_id` (string, optional) |
| 53 | - `disfluency_removal_enabled` (bool, optional) |
| 54 | - `timestamp_granularities` (array<string>, optional): e.g. `sentence`. |
| 55 | - `async` (bool, optional): default false for sync models, true for `qwen3-asr-flash-filetrans`. |
| 56 | |
| 57 | ### Response |
| 58 | - `text` (string): normalized transcript text. |
| 59 | - `task_id` (string, optional): present for async submission. |
| 60 | - `status` (string): `SUCCEEDED` or submission status. |
| 61 | - `raw` (object): original API response. |
| 62 | |
| 63 | ## Quick start (official HTTP API) |
| 64 | |
| 65 | Sync transcription (OpenAI-compatible protocol): |
| 66 | |
| 67 | ```bash |
| 68 | curl -sS --location 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions' \ |
| 69 | --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ |
| 70 | --header 'Content-Type: application/json' \ |
| 71 | --data '{ |
| 72 | "model": "qwen3-asr-flash", |
| 73 | "messages": [ |
| 74 | { |
| 75 | "role": "user", |
| 76 | "content": [ |
| 77 | { |
| 78 | "type": "input_audio", |
| 79 | "input_audio": { |
| 80 | "data": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" |
| 81 | } |
| 82 | } |
| 83 | ] |
| 84 | } |
| 85 | ], |
| 86 | "stream": false, |
| 87 | "asr_options": { |
| 88 | "enable_itn": false |
| 89 | } |
| 90 | }' |
| 91 | ``` |
| 92 | |
| 93 | Async long-file transcription (DashScope protocol): |
| 94 | |
| 95 | ```bash |
| 96 | curl -sS --location 'https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription' \ |
| 97 | --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ |
| 98 | --header 'X-DashScope-Async: enable' \ |
| 99 | --header 'Content-Type: application/json' \ |
| 100 | --data '{ |
| 101 | "model": "qwen3-asr-flash-filetrans", |
| 102 | "input": { |
| 103 | "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" |
| 104 | } |
| 105 | }' |
| 106 | ``` |
| 107 | |
| 108 | Poll task result: |
| 109 | |
| 110 | ```bash |
| 111 | curl -sS --location "https://dashscope.aliyuncs.com/api/v1/tasks/<task_id>" \ |
| 112 | --header "Authorization: Bearer $DASHSCOPE_API_KEY" |
| 113 | ``` |
| 114 | |
| 115 | ## Local helper script |
| 116 | |
| 117 | Use the bundled script for URL/local-file input and optional async polling: |
| 118 | |
| 119 | ```bash |
| 120 | python skills/ai/audio/aliyun-qwen-asr/scripts/transcribe_audio.py \ |
| 121 | --audio "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" \ |
| 122 | --model qwen3-asr-flash \ |
| 123 | --language-hints zh,en \ |
| 124 | --print-response |
| 125 | ``` |
| 126 | |
| 127 | Long-file mode: |
| 128 | |
| 129 | ```bash |
| 130 | python skills/ai/audio/aliyun-qwen-asr/scripts/transcribe_audio.py \ |
| 131 | --audio "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" \ |
| 132 | --model qwen3-asr-flash-filetrans \ |
| 133 | --async \ |
| 134 | --wait |
| 135 | ``` |
| 136 | |
| 137 | ## Operational guidance |
| 138 | |
| 139 | - For local files, use `input_audio.data` (data URI) when direct URL is unavailable. |
| 140 | - Keep `language_hints` minimal to reduce recognition ambiguity. |
| 141 | - For async tasks, use 5-20s polling interval with max retry guard. |
| 142 | - Save normalized outputs under `output/aliyun-qwen-asr/transcripts/`. |
| 143 | |
| 144 | ## Output location |
| 145 | |
| 146 | - Default output: `output/aliyun-qwen-asr/transcripts/` |
| 147 | - Override base dir with `OUTPUT_DIR`. |
| 148 | |
| 149 | ## Workflow |
| 150 | |
| 151 | 1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating. |
| 152 | 2) Run one minimal read-only query first to verify connectivity and permissions. |
| 153 | 3) Execute the tar |