Skip to content

Integrate Qwen-ASR with OpenAI & DashScope for Speech Recognition

Reference, synced 2026-06-13.

flowchart TD
  n0["Models"]
  n1["Overview"]
  n2["Products"]
  n3["Solutions"]
  n4["Pricing"]
  n5["Resources"]
  n6["Partners"]
  n7["Support"]
  n8["Language"]
  n0 --> n1
  n1 --> n2
  n2 --> n3
  n3 --> n4
  n4 --> n5
  n5 --> n6
  n6 --> n7
  n7 --> n8

Free access Accelerate Delivery with Fixed-Cost Agentic CodingWatch how it works

Models

Empowering AI innovation for both enterprises and developers with Alibaba Cloud’s best-in-class Qwen models, AI-native apps, and AI solutions.

Alibaba Cloud Model Studio \ Enterprise-grade large model service and application development platform.

Try Visual Model \ Supports image understanding, image generation, and video generation.

Models

HappyHorse-1.0-T2V \ Cinematic creative generation, ultimate dynamic details Qwen3-VL-Plus \ Native VL, spatial reasoning, 1M-context video analysis Wan2.7-VideoEdit \ Supports both localized and global editing with prompt

Qwen3.6-Plus \ Native multimodal, 1M context, agentic coding Wan2.7-Image-Pro \ Interactive editing, long-text rendering, precise prompt following Qwen-Plus \ Balanced intelligence, efficient inference, production-ready performance

Qwen-Image-2.0 \ Professional infographics, exquisite photorealism Z-Image-Turbo \ Ultra-fast image generation, high throughput, cost-optimized inference Qwen3-Coder-Next \ Multi-turn tool interactions, future-ready development support

Wan2.7-T2V \ High-fidelity T2V, 15s duration, advanced camera control Wan2.7-I2V \ Cinematic I2V with emotional depth and visceral impact Wan2.7-R2V \ Up to 5 mixed image/video inputs and audio timbre cloning

GenAI Application

Qoder \ Intelligent coding assistant, available for enterprise-dedicated deployment. Qoder CN \ AI-powered coding assistant that boosts developer productivity with intelligent code completion, AI chat, multi-file editing, and task automation.

AI Service

Model Experience \ Experience full-scale, multimodal model capabilities online. Platform for AI \ An AI-native algorithm engineering platform for end-to-end modeling, training, and inference service deployment. Fine-tune Video Generation Model \ Customize Wan’s text-to-video capabilities through model fine-tuning to meet your unique requirements.

AI Use Case

AI Savings Plan Hot \ Save up to 47% on AI costs. Limited-time offer tailored to your usage. AI Video Creation \ Elevate your professional video production with Wan 2.6.

AI Token Plan \ One plan. Multiple models. Big Savings with a Fixed Subscription. AI Image Creation \ All-in-one creative suite for copywriting, image generation, and poster design.

Overview

As a global full-stack AI leader, Alibaba Cloud aims to make computing accessible to everyone and help worldwide customers accelerate innovation.

Why Alibaba Cloud

About Alibaba Cloud \ AI Powered Cloud Technology Our Global Network \ Explore our global presence and deployment regions around the world Our Global Offices \ With offices in 4 continents, we're always close to where it matters.

Asia Accelerator \ Accelerate Success in Asia with Alibaba Cloud Go Global \ Benefits of our Global Alliance Trust Center \ Empowering enterprises with a secure, compliant, and globally trusted cloud infrastructure

Customers and Insights

Olympic Games \ Alibaba Cloud Powers Olympic Games with AI-powered cloud technology Case Studies \ Learn how customers are scaling their businesses on Alibaba Cloud Analyst Reports \ Learn what the top industry analyst firms are saying about Alibaba Cloud

What's New

Events and Webinars \ Quick access to upcoming and on-demand events Product Updates \ Stay informed of the latest innovations Press Room \ Latest news and media releases

Products

Featured ProductsAI & Machine Learning Computing Container Storage Networking & CDN Security Middleware Database Analytics ComputingMedia ServicesEnterprise Services & Cloud CommunicationDomain Names and WebsitesEnd User ComputingServerlessDeveloper ToolsMigration & O&M ManagementApsara Stack

Alibaba Cloud Model Studio \ Supercharge your AI journey effortlessly with industry-leading GenAI models ApsaraDB RDS \ Store and manage your business data, with automated monitoring and backups Certificate Management Service (Original SSL Certificate) \ Create a safe and secure connection between your website and users

Elastic Compute Service (ECS) \ Host websites anywhere and scale enterprise workloads Container Service for Kubernetes (ACK) \ Run and scale containerized applications on managed Kubernetes infrastructure Object Storage Service (OSS) \ Store large amounts of data in the cloud and access it anywhere, anytime

Simple Application Server (SAS) \ All-in-one services for fast deployment Elastic IP Address (EIP) \ Manage your public IPs independently to improve internet network quality Domain Names and Website \ Get the perfect domain name to suit your every need

Solutions

Solutions by Industry Technical Solutions AI WebsitesNetworking Security and ComplianceData and AnalyticsEnterprise Service and ApplicationCloud MigrationCloud NativeHybrid CloudSMB solutions

Financial Services \ Innovate faster with Alibaba Cloud Games \ Grow your game rapidly with high global availability

New Retail \ Alibaba Cloud enables digital retail transformation to fuel growth and realize an omnichannel customer experience throughout the consumer journey. Media and Entertainment \ Ready your content for today's media market with a digitalized media journey

Supply Chain \ Power your supply chain with intelligent, efficient, and reliable solutions Sports \ Digitizing the sports industry with intelligent tech

Sustainability \ Achieve a sustainable future with low-carbon and energy-efficient technologies

Pricing

Flexible options like pay-as-you-go and clear billing rules to meet diverse business needs.

Overview & Tools

Pricing Calculator \ Get an instant pricing estimate based on your usage and needs Free Trial \ Try our 80+ cloud products for free.

Pricing Options \ Get the most out of Alibaba Cloud with flexible pricing

Optimize your cost

Migrate & Save \ Superior Performance At Lower Pricing. Save up to 50%. Promotion Center \ Unlock the latest Alibaba Cloud offers & promos

Resources

Official documentation, extensive tools, training resources, and a community to grow and innovate in the cloud.

Technical Resources

Documentation \ Product guides and FAQs Architecture Center \ Design reliable, secure, and efficient cloud architecture. Intelligent Solution Explorer \ Find the right solution for you, powered by AI

Blog \ Latest cloud insights and developer trends Whitepapers \ Research that explores the how and why behind our technology

Training&Certification

Alibaba Cloud Academy \ Build cloud skills and earn certifications with expert-led training.

Developer Hub

Alibaba Cloud Project Hub \ Explore real-world projects built by developers using our platform. Our Developer MVPs \ Celebrating the developers who lead, build, and inspire our community

Partners

Partner-first strategy offering collaborative product, sales, and service models, plus high-quality partner solutions that complement Alibaba Cloud’s capabilities.

Marketplace

AI Alliance for ISVs \ Partner with us to build and grow AI solutions together ISV Benefits \ Unlock resources, market access, and go-to-market support as an ISV partner

Alibaba Cloud Marketplace \ Explore ready-to-deploy solutions from our partners and ISVs

Find a Partner

Partner Hub \ Find your ideal partner in no time

Become a Partner

Partner Network \ A partner portal for Alibaba Cloud Channel, Technology, MSP partner and other partner programs

Support

Full-lifecycle support and expert services, from cloud advisory and migration to operations.

Support & Professional Services

Professional Services \ Expert-led services to design, migrate, and optimize your cloud journey Support Plans \ Flexible support for every stage — from startup to enterprise

Partner Support Program \ Priority technical support for partners, with dedicated managers and faster issue resolution

Contact us

Connect With Us \

Talk to a sales expert and get a custom quote for your business

Language

  • English
  • 简体中文
  • 繁體中文
  • 日本語
  • Bahasa Indonesia

Locale

Visit aliyun.com

Documentation

Alibaba Cloud Model Studio

User Guide (Models) User Guide (Application) API Reference (Models) API Reference (Application)

Search for Help Content

Getting Started

The Beginner's Guide

Well-Architected Framework

AI & Machine Learning

Platform For AI

Alibaba Cloud Model Studio

DashVector

Artificial Intelligence Recommendation

OpenSearch

Image Search

Machine Translation

Intelligent Speech Interaction

Optimization Solver

Intelligent Computing LINGJUN

Computing

Elastic Compute Service

Elastic GPU Service

Elastic Container Instance

Dedicated Host

Compute Nest

Simple Application Server

Cloud Box

Auto Scaling

Elastic High Performance Computing

Batch Compute (Deprecated)

Function Compute

Serverless App Engine

ENS

Elastic Desktop Service

App Streaming

WUYING Terminal

Cloud Phone

Edge Network Acceleration

Alibaba Cloud Linux

AgentBay

Container

Container Service for Kubernetes

Container Compute Service

Container Registry

Storage

Object Storage Service

Cloud Parallel File Storage

File Storage NAS

Tablestore

Storage Capacity Unit

Simple Log Service

Cloud Backup

Intelligent Media Management

Drive and Photo Service

Data Transport

Cloud Storage Gateway

Data Online Migration

Hybrid Cloud Storage Array

Storage Services Overview

Backup and Disaster Recovery Center

Networking and CDN

Server Load Balancer

Elastic IP Address

Internet Shared Bandwidth

Data Transfer Plan

Virtual Private Cloud

NAT Gateway

PrivateLink

Alibaba Cloud DNS PrivateZone

Network Intelligence Service

Cloud Data Transfer

IPv6 Gateway

Anycast Elastic IP Address

Cloud Enterprise Network

Global Accelerator

VPN Gateway

Smart Access Gateway

Express Connect

CDN

Edge Security Acceleration

Cloud Network Well-architected Design Guidelines

Security

Anti-DDoS

Web Application Firewall

Cloud Firewall

Security Center

Bastionhost

Secure Access Service Edge

Certificate Management Service

Key Management Service

Data Security Center

Identity as a Service

Fraud Detection

AI Guardrails

Captcha

Blockchain as a Service

ID Verification

Managed Security Service

Middleware

Enterprise Distributed Application Service

Microservices Engine

Alibaba Cloud Service Mesh

SchedulerX

ApsaraMQ for RocketMQ

ApsaraMQ for Kafka

ApsaraMQ for RabbitMQ

ApsaraMQ for MQTT

Simple Message Queue (formerly MNS)

CloudFlow

EventBridge

Application Real-Time Monitoring Service

Managed Service for Prometheus

Managed Service for Grafana

Managed Service for OpenTelemetry

Performance Testing

STAROps

Databases

ApsaraDB Console

PolarDB

ApsaraDB RDS

ApsaraDB for OceanBase (Deprecated)

Tair (Redis® OSS-Compatible)

Lindorm

Time Series Database

ApsaraDB for MongoDB

ApsaraDB for HBase

ApsaraDB for Memcache

ApsaraDB for MyBase

AnalyticDB

ApsaraDB for ClickHouse

ApsaraDB for SelectDB

Data Transmission Service

Database Autonomy Service

Data Management

Database Gateway - Deprecated

ApsaraDB for Cassandra - Deprecated

Analytics Computing

MaxCompute

Hologres

Realtime Compute for Apache Flink

Elasticsearch

Vector Retrieval Service for Milvus

E-MapReduce

Data Lake Formation

DataV

Quick BI

Quick Audience

Quick Tracking

DataWorks

DataHub

Dataphin

Media Services

ApsaraVideo VOD

ApsaraVideo Live

Intelligent Media Services

ApsaraVideo Media Processing

Apsara Video SDK

Enterprise Services & Cloud Communication

Energy Expert

CloudQuotation

Salesforce on Alibaba Cloud

GoChina ICP Filing Assistant

Marketplace

Alibaba Mail

Direct Mail

Short Message Service

Voice Service

Phone Number Verification Service

Cell Phone Number Service

Chat App Message Service

Financial Intelligence Engine

Domain Names and Websites

Domain Names

ICP Filing

Alibaba Cloud DNS

End User Computing

Elastic Desktop Service

App Streaming

WUYING Terminal

Cloud Phone

AgentBay

Internet of Things

IoT Platform

Serverless

Serverless App Engine

CloudFlow

EventBridge

Simple Message Queue (formerly MNS)

Function Compute

Developer Tools

OpenAPI Explorer

Alibaba Cloud SDK

Cloud Shell

Resource Orchestration Service

Alibaba Cloud CLI

BSS OpenAPI

Terraform

Pulumi

Ticket System API

Mobile Platform as a Service

Alibaba Cloud DevOps

API Gateway

Cloud Control API

AI Coding Assistant Lingma

Cloud Skills Portal

Migration & O&M Management

CloudOps Orchestration Service

Cloud Monitor

Intelligent Advisor

Cloud Governance Center

ActionTrail

Cloud Config

Resource Access Management

Resource Management

Cloud Architect Design Tools

Migration Hub

Server Migration Center

Service Catalog

Logic Composer

Quota Center

CloudSSO

HTTPDNS

Solutions

SAP

SuperApp

OpenLake

Membership Service

Expenses and Costs

Account Center

More

Support

Legal

Tech Share Terms and Conditions

After Sales Support

China Gateway Program

Service Level Objectives

Management Console

Security Control

Input and output parameters for the Qwen-ASR model. Call the API using the OpenAI compatible or DashScope protocol.

User guide: See Non-real-time speech recognition.

Model connection types

Different models support different connection types.

ModelConnection type
ModelConnection type
Qwen3-ASR-Flash-FiletransOnly DashScope asynchronous invocation is supported
Qwen3-ASR-FlashOpenAI compatible and DashScope synchronous

OpenAI compatible

Important

The OpenAI-compatible mode is not available in the US region.

URL

Singapore

China (Beijing)

HTTP request address: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions

base_url for SDK calls: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1

Replace WorkspaceId with your actual Workspace ID.

HTTP request address: POST https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions

base_url for SDK calls: https://dashscope.aliyuncs.com/compatible-mode/v1

### Request bodyInput: audio file URL Input: Base64-encoded audio file Python SDK Node.js SDK cURL python from openai import OpenAI import os try: client = OpenAI( # API Keys for the Singapore/US and Beijing regions are different. To obtain an API Key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key # If the environment variable is not configured, replace the following line with your Model Studio API Key: api_key = "sk-xxx", api_key=os.getenv("DASHSCOPE_API_KEY"), # Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1", ) stream_enabled = False # Whether to enable streaming output completion = client.chat.completions.create( model="qwen3-asr-flash", messages=[ { "content": [ { "type": "input_audio", "input_audio": { "data": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" } } ], "role": "user" } ], stream=stream_enabled, # When stream is False, stream_options cannot be set # stream_options={"include_usage": True}, extra_body={ "asr_options": { # "language": "zh", "enable_itn": False } } ) if stream_enabled: full_content = "" print("Streaming output:") for chunk in completion: # When stream_options.include_usage is True, the choices field of the last chunk is an empty list and must be skipped (you can get token usage via chunk.usage) print(chunk) if chunk.choices and chunk.choices[0].delta.content: full_content += chunk.choices[0].delta.content print(f"Full content: {full_content}") else: print(f"Non-streaming output: {completion.choices[0].message.content}") except Exception as e: print(f"Error: {e}") nodejs // Preparations before running: // Common to Windows/Mac/Linux: // 1. Make sure Node.js is installed (version >= 14 recommended) // 2. Run the following command to install the required dependency: npm install openai import OpenAI from "openai"; const client = new OpenAI({ // API Keys for the Singapore/US and Beijing regions are different. To obtain an API Key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key // If the environment variable is not configured, replace the following line with your Model Studio API Key: apiKey: "sk-xxx", apiKey: process.env.DASHSCOPE_API_KEY, // Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. baseURL: "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1", }); async function main() { try { const streamEnabled = false; // Whether to enable streaming output const completion = await client.chat.completions.create({ model: "qwen3-asr-flash", messages: [ { role: "user", content: [ { type: "input_audio", input_audio: { data: "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" } } ] } ], stream: streamEnabled, // When stream is False, stream_options cannot be set // stream_options: { // "include_usage": true // }, extra_body: { asr_options: { // language: "zh", enable_itn: false } } }); if (streamEnabled) { let fullContent = ""; console.log("Streaming output:"); for await (const chunk of completion) { console.log(JSON.stringify(chunk)); if (chunk.choices && chunk.choices.length > 0) { const delta = chunk.choices[0].delta; if (delta && delta.content) { fullContent += delta.content; } } } console.log(`Full content: ${fullContent}`); } else { console.log(`Non-streaming output: ${completion.choices[0].message.content}`); } } catch (err) { console.error(`Error: ${err}`); } } main(); Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. curl curl -X POST 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions' \ -H "Authorization: Bearer $DASHSCOPE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3-asr-flash", "messages": [ { "content": [ { "type": "input_audio", "input_audio": { "data": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" } } ], "role": "user" } ], "stream":false, "asr_options": { "enable_itn": false } }' You can also pass Base64-encoded audio as a data URL, in the format data:<mediatype>;base64,<data>. - <mediatype>: The MIME type. The value varies by audio format. For example: - WAV: audio/wav - MP3: audio/mpeg - <data>: The Base64-encoded string of the audio data. Base64 encoding inflates the payload size. Keep the source file small enough that the encoded data still fits within the 10 MB input limit. - Example: data:audio/wav;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//PAxABQ/BXRbMPe4IQAhl9 View sample code python import base64, pathlib # input.mp3 is the local audio file. Replace the path with your own file and verify that it meets the audio requirements. file_path = pathlib.Path("input.mp3") base64_str = base64.b64encode(file_path.read_bytes()).decode() data_uri = f"data:audio/mpeg;base64,{base64_str}" java import java.nio.file.*; import java.util.Base64; public class Main { /** * filePath is the local audio file. Replace it with the path to your own file and verify that it meets the audio requirements. */ public static String toDataUrl(String filePath) throws Exception { byte[] bytes = Files.readAllBytes(Paths.get(filePath)); String encoded = Base64.getEncoder().encodeToString(bytes); return "data:audio/mpeg;base64," + encoded; } // Example usage public static void main(String[] args) throws Exception { System.out.println(toDataUrl("input.mp3")); } } Python SDK Node.js SDK The example uses this audio file: welcome.mp3. python import base64 from openai import OpenAI import os import pathlib try: # Replace with the actual path to your audio file file_path = "welcome.mp3" # Replace with the actual MIME type of your audio file audio_mime_type = "audio/mpeg" file_path_obj = pathlib.Path(file_path) if not file_path_obj.exists(): raise FileNotFoundError(f"Audio file not found: {file_path}") base64_str = base64.b64encode(file_path_obj.read_bytes()).decode() data_uri = f"data:{audio_mime_type};base64,{base64_str}" client = OpenAI( # API Keys for the Singapore/US and Beijing regions are different. To obtain an API Key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key # If the environment variable is not configured, replace the following line with your Model Studio API Key: api_key = "sk-xxx", api_key=os.getenv("DASHSCOPE_API_KEY"), # Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1", ) stream_enabled = False # Whether to enable streaming output completion = client.chat.completions.create( model="qwen3-asr-flash", messages=[ { "content": [ { "type": "input_audio", "input_audio": { "data": data_uri } } ], "role": "user" } ], stream=stream_enabled, # When stream is False, stream_options cannot be set # stream_options={"include_usage": True}, extra_body={ "asr_options": { # "language": "zh", "enable_itn": False } } ) if stream_enabled: full_content = "" print("Streaming output:") for chunk in completion: # When stream_options.include_usage is True, the choices field of the last chunk is an empty list and must be skipped (you can get token usage via chunk.usage) print(chunk) if chunk.choices and chunk.choices[0].delta.content: full_content += chunk.choices[0].delta.content print(f"Full content: {full_content}") else: print(f"Non-streaming output: {completion.choices[0].message.content}") except Exception as e: print(f"Error: {e}") The example uses this audio file: welcome.mp3. nodejs // Preparations before running: // Common to Windows/Mac/Linux: // 1. Make sure Node.js is installed (version >= 14 recommended) // 2. Run the following command to install the required dependency: npm install openai import OpenAI from "openai"; import { readFileSync } from 'fs'; const client = new OpenAI({ // API Keys for the Singapore/US and Beijing regions are different. To obtain an API Key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key // If the environment variable is not configured, replace the following line with your Model Studio API Key: apiKey: "sk-xxx", apiKey: process.env.DASHSCOPE_API_KEY, // Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. baseURL: "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1", }); const encodeAudioFile = (audioFilePath) => { const audioFile = readFileSync(audioFilePath); return audioFile.toString('base64'); }; // Replace with the actual path to your audio file const dataUri = `data:audio/mpeg;base64,${encodeAudioFile("welcome.mp3")}`; async function main() { try { const streamEnabled = false; // Whether to enable streaming output const completion = await client.chat.completions.create({ model: "qwen3-asr-flash", messages: [ { role: "user", content: [ { type: "input_audio", input_audio: { data: dataUri } } ] } ], stream: streamEnabled, // When stream is False, stream_options cannot be set // stream_options: { // "include_usage": true // }, extra_body: { asr_options: { // language: "zh", enable_itn: false } } }); if (streamEnabled) { let fullContent = ""; console.log("Streaming output:"); for await (const chunk of completion) { console.log(JSON.stringify(chunk)); if (chunk.choices && chunk.choices.length > 0) { const delta = chunk.choices[0].delta; if (delta && delta.content) { fullContent += delta.content; } } } console.log(`Full content: ${fullContent}`); } else { console.log(`Non-streaming output: ${completion.choices[0].message.content}`); } } catch (err) { console.error(`Error: ${err}`); } } main();
modelstring (Required) The model name. This parameter applies only to the Qwen3-ASR-Flash model.
messagesarray (Required) The list of messages. Message types System Messageobject (Optional) The goal or role of the model. If you use a system message, it must be the first message in the messages list. Properties rolestring (Required) Set to system. User Messageobject (Required) The message sent by the user to the model. Properties contentarray (Required) The content of the user message. Only one message is allowed in the array. Properties typestring (Required) Set to input_audio, which indicates that the input is audio. input_audiostring (Required) The audio to be recognized. For more information about how to use this parameter, see Quick start. In OpenAI-compatible mode, the Qwen3-ASR-Flash model supports two input formats: Base64-encoded files and URLs of audio files that are accessible over the public network. When you use an SDK, if the audio file is stored in OSS, temporary URLs that start with oss:// are not supported. When you use a RESTful API, if the audio file is stored in OSS, temporary URLs that start with oss:// are supported. Note: Important - Temporary URLs are valid for 48 hours. After expiration, they cannot be used. Do not use them in production environments. - The file upload credential API is rate-limited to 100 QPS and cannot be scaled up. Do not use it in production, high-concurrency, or stress testing scenarios. - For production environments, we recommend using stable storage services such as Alibaba Cloud OSS to ensure long-term file availability and avoid rate limiting issues. rolestring (Required) The role of the user message. Set to user.
asr_optionsobject(Optional) Specifies whether to enable certain features. > asr_options is not a standard OpenAI parameter. If you use an OpenAI SDK, pass it through extra_body. Properties language string (Optional) No default value If the language of the audio is known, you can specify it using this parameter to improve recognition accuracy. You can specify only one language. If the audio language is uncertain or includes multiple languages (such as a mix of Chinese, English, Japanese, and Korean), do not specify this parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish enable_itnboolean (Optional) Defaults to: false Specifies whether to enable Inverse Text Normalization (ITN). This feature applies only to Chinese and English audio. - true - false (default)
streamboolean(Optional) Defaults to: false Specifies whether to use streaming output. See Streaming output. Valid values: - false: The model returns the complete content after generation. - true: The model generates and outputs content simultaneously. A data block (chunk) is returned each time a part of the content is generated. You must read these blocks in real time to assemble the complete reply. Set to true to reduce the risk of request timeouts.
stream_optionsobject(Optional) The configuration items for streaming output. This parameter takes effect only when stream is set to true. Properties include_usageboolean(Optional) Defaults to: false Specifies whether to include token consumption information in the last data block of the response. Valid values: - true - false (default) > During streaming output, token consumption information appears only in the last data block of the response.
### Response bodyNon-streaming output Streaming output json { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "annotations": [ { "emotion": "neutral", "language": "zh", "type": "audio_info" } ], "content": "Welcome to Alibaba Cloud.", "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 } } json data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","created":1767685989,"object":"chat.completion.chunk","usage":null,"choices":[{"logprobs":null,"index":0,"delta":{"content":"","role":"assistant"}}]} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"annotations":[{"type":"audio_info","language":"zh","emotion":"neutral"}],"content":"Welcome","role":null},"index":0}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"annotations":[{"type":"audio_info","language":"zh","emotion":"neutral"}],"content":" to","role":null},"index":0}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"annotations":[{"type":"audio_info","language":"zh","emotion":"neutral"}],"content":" Alibaba","role":null},"index":0}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"annotations":[{"type":"audio_info","language":"zh","emotion":"neutral"}],"content":" Cloud","role":null},"index":0}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"annotations":[{"type":"audio_info","language":"zh","emotion":"neutral"}],"content":".","role":null},"index":0}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: {"model":"qwen3-asr-flash","id":"chatcmpl-3fb97803-d27f-9289-8889-xxxxx","choices":[{"delta":{"role":null},"index":0,"finish_reason":"stop"}],"created":1767685989,"object":"chat.completion.chunk","usage":null} data: [DONE]
idstring The unique identifier for this call.
choicesarray The output information from the model. Properties finish_reasonstring Valid values: - null: The output is still being generated. - stop: The output ended naturally or was terminated by a stop condition. - length: The output exceeded the maximum length limit. indexinteger The index of the current object in the choices array. messageobject The message object output by the model. Properties rolestring The role of the output message. Set to assistant. contentarray The speech recognition result. annotationsarray The output annotation information, such as the language. Properties languagestring The language of the recognized audio. If the language request parameter is specified, this value is the same as the specified parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish typestring Set to audio_info, which indicates audio information. emotionstring The emotion of the recognized audio. The following emotions are supported: - surprised: surprised - neutral: neutral - happy: happy - sad: sad - disgusted: disgusted - angry: angry - fearful: fearful
createdinteger The UNIX timestamp (in seconds) when the request was created.
modelstring The model used for this request.
objectstring Always chat.completion.
usageobject The token consumption information for this request. Properties completion_tokensinteger The number of tokens in the model output. completion_tokens_detailsobject The fine-grained details of the tokens in the model output. Properties text_tokensinteger The number of tokens in the model output text. prompt_tokensobject The number of tokens in the input. prompt_tokens_detailsobject The fine-grained details of the tokens in the input. Properties audio_tokensinteger The length of the input audio in tokens. Audio-to-token conversion rule: Each second of audio is converted to 25 tokens. Durations less than 1 second are counted as 1 second. text_tokensinteger You can ignore this parameter. secondsinteger The audio duration in seconds. total_tokensinteger The total number of input and output tokens (total_tokens = completion_tokens + prompt_tokens).

DashScope synchronous

URL

Singapore

US (Virginia)

China (Beijing)

HTTP request address: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation

base_url for SDK calls: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1

Replace WorkspaceId with your actual Workspace ID.

If you select the US deployment scope, model inference compute resources are restricted to the United States. Static data is stored in your selected region. Supported region: US (Virginia).

HTTP request address: POST https://dashscope-us.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation

base_url for SDK calls: https://dashscope-us.aliyuncs.com/api/v1

HTTP request address: POST https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation

base_url for SDK calls: https://dashscope.aliyuncs.com/api/v1

### Request bodyThe following example shows how to recognize an audio file from a URL. For an example of how to recognize a local audio file, see Quick start. cURL Java Python julia curl -X POST "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation" \ -H "Authorization: Bearer $DASHSCOPE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3-asr-flash", "input": { "messages": [ { "content": [ { "text": "" } ], "role": "system" }, { "content": [ { "audio": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" } ], "role": "user" } ] }, "parameters": { "asr_options": { "enable_itn": false } } }' ```pgsql import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation; import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam; import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult; import com.alibaba.dashscope.common.MultiModalMessage; import com.alibaba.dashscope.common.Role; import com.alibaba.dashscope.exception.ApiException; import com.alibaba.dashscope.exception.NoApiKeyException; import com.alibaba.dashscope.exception.UploadFileException; import com.alibaba.dashscope.utils.Constants; import com.alibaba.dashscope.utils.JsonUtils; public class Main { public static void simpleMultiModalConversationCall() throws ApiException, NoApiKeyException, UploadFileException { MultiModalConversation conv = new MultiModalConversation(); MultiModalMessage userMessage = MultiModalMessage.builder() .role(Role.USER.getValue()) .content(Arrays.asList( Collections.singletonMap("audio", "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3"))) .build(); Map<String, Object> asrOptions = new HashMap<>(); asrOptions.put("enable_itn", false); // asrOptions.put("language", "zh"); // Optional. If the audio language is known, use this parameter to specify the language to improve recognition accuracy. MultiModalConversationParam param = MultiModalConversationParam.builder() // API Keys for the Singapore/US and Beijing regions are different. To obtain an API Key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key // If the environment variable is not configured, replace the following line with your Model Studio API Key: .apiKey("sk-xxx") .apiKey(System.getenv("DASHSCOPE_API_KEY")) // To use a model in the US region, append the "-us" suffix to the model name, for example, qwen3-asr-flash-us .model("qwen3-asr-flash") .message(userMessage) .parameter("asr_options", asrOptions) .build(); MultiModalConversationResult result = conv.call(param); System.out.println(JsonUtils.toJson(result)); } public static void main(String[] args) { try { // Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region. Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1"; simpleMultiModalConversationCall(); } catch (ApiException
modelstring (Required) The model name. This parameter applies only to the Qwen3-ASR-Flash model.
messagesarray (Required) The list of messages. > When you make an HTTP call, place messages in the input object. Message types System Messageobject (Optional) This defines the model's goal or role. If you set a system message, place it at the beginning of the messages list. Only Qwen3-ASR-Flash supports this parameter. Properties rolestring (Required) Set to system. User Messageobject (Required) The message sent by the user to the model. Properties contentarray (Required) The content of the user message. Only one message is allowed in the array. Properties audiostring (Required) The audio to be recognized. For more information about how to use this parameter, see Quick start. When you use DashScope, the Qwen3-ASR-Flash model supports three input formats: Base64-encoded files, absolute paths of local files, and URLs of audio files that are accessible over the public network. When you use an SDK, if the audio file is stored in OSS, temporary URLs that start with oss:// are not supported. When you use a RESTful API, if the audio file is stored in OSS, temporary URLs that start with oss:// are supported. Note: Important - Temporary URLs are valid for 48 hours. After expiration, they cannot be used. Do not use them in production environments. - The file upload credential API is rate-limited to 100 QPS and cannot be scaled up. Do not use it in production, high-concurrency, or stress testing scenarios. - For production environments, we recommend using stable storage services such as Alibaba Cloud OSS to ensure long-term file availability and avoid rate limiting issues. rolestring (Required) The role of the user message. Set to user.
asr_optionsobject(Optional) Specifies whether to enable certain features. This parameter is supported only by the Qwen3-ASR-Flash model. Properties language string (Optional) No default value If the language of the audio is known, you can specify it using this parameter to improve recognition accuracy. You can specify only one language. If the audio language is uncertain or includes multiple languages (such as a mix of Chinese, English, Japanese, and Korean), do not specify this parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish enable_itnboolean (Optional) Defaults to: false Specifies whether to enable Inverse Text Normalization (ITN). This feature applies only to Chinese and English audio. - true - false (default)
### Response bodyjson { "output": { "choices": [ { "finish_reason": "stop", "message": { "annotations": [ { "language": "zh", "type": "audio_info", "emotion": "neutral" } ], "content": [ { "text": "Welcome to Alibaba Cloud." } ], "role": "assistant" } } ] }, "usage": { "input_tokens_details": { "text_tokens": 0 }, "output_tokens_details": { "text_tokens": 6 }, "seconds": 1 }, "request_id": "568e2bf0-d6f2-97f8-9f15-a57b11dc6977" }
request_idstring The unique identifier for this call. > The parameter returned by the Java SDK is requestId
outputobject The call result information. Properties choicesarray The model output. Returned when result_format is message. Properties finish_reasonstring Valid values: - null: The output is still being generated. - stop: The output ended naturally or was terminated by a stop condition. - length: The output exceeded the maximum length limit. messageobject The message object output by the model. Properties rolestring The role of the output message. Set to assistant. contentarray The content of the output message. Properties textstring The speech recognition result. annotationsarray The output annotation information, such as the language. Properties languagestring The language of the recognized audio. If the language request parameter is specified, this value is the same as the specified parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish typestring Set to audio_info, which indicates audio information. emotionstring The emotion of the recognized audio. The following emotions are supported: - surprised: surprised - neutral: neutral - happy: happy - sad: sad - disgusted: disgusted - angry: angry - fearful: fearful
usageobject The token consumption information for this request. Properties input_tokens_detailsobject The length of the input content for Qwen3-ASR-Flash in tokens. Properties text_tokensinteger You can ignore this parameter. output_tokens_detailsobject The length of the output content from Qwen3-ASR-Flash in tokens. Properties text_tokensinteger The length of the recognized text output by Qwen3-ASR-Flash in tokens. secondsinteger The audio duration for Qwen3-ASR-Flash in seconds.

DashScope asynchronous invocation

Process description

Asynchronous invocation is designed for long audio files or time-consuming tasks. It uses a two-step "submit-poll" process to prevent request timeouts:

  1. Step 1: Submit a task
    • The client initiates an asynchronous processing request.

    • After validating the request, the server does not execute the task immediately. Instead, it returns a unique task_id, indicating that the task has been successfully created.

  2. Step 2: Obtain the result
    • The client uses the task_id to poll the result query API.

    • When the task is complete, the result query API returns the final recognition result.

You can choose to use an SDK or call the RESTful API directly based on your integration environment.

  • Use an SDK. For sample code, see QuickStart. For request parameters, see the Request body of the Submit a task operation. For information about the response, see Description of asynchronous call results.

SDKs handle the underlying API call details automatically.

  1. Submit a task: Call the async_call() (Python) or asyncCall() (Java) method to submit the task. This method returns a task object containing a task_id.

  2. Obtain the result: Use the task object returned in the previous step or the task_id to call the fetch() method to retrieve the result. The SDK automatically handles the internal polling logic until the task is complete or times out.

  • Use a RESTful API

Calling the RESTful API directly provides maximum flexibility.

  1. Submit the task. If the request is successful, the response body will contain a task_id.

  2. Use the task_id from the previous step to retrieve the task execution result.

Submit a task

URL

Singapore

China (Beijing)

HTTP request address: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/asr/transcription

base_url for SDK calls: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1

Replace WorkspaceId with your actual Workspace ID.

HTTP request address: POST https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription

base_url for SDK calls: https://dashscope.aliyuncs.com/api/v1

#### Request bodycURL Java Python curl # ======= Important ======= # The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription # The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key # === Delete this comment before running the command. === curl --location --request POST 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/asr/transcription' \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ --header "Content-Type: application/json" \ --header "X-DashScope-Async: enable" \ --data '{ "model": "qwen3-asr-flash-filetrans", "input": { "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" }, "parameters": { "channel_id":[ 0 ], "enable_itn": false } }' For SDK examples, see QuickStart. java import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import okhttp3.*; import java.io.IOException; public class Main { // The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription private static final String API_URL = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/asr/transcription"; public static void main(String[] args) { // The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key // If the environment variable is not configured, replace the following line with your Model Studio API key: String apiKey = "sk-xxx" String apiKey = System.getenv("DASHSCOPE_API_KEY"); OkHttpClient client = new OkHttpClient(); Gson gson = new Gson(); /*String payloadJson = """ { "model": "qwen3-asr-flash-filetrans", "input": { "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" }, "parameters": { "channel_id": [0], "enable_itn": false, "language": "zh", "corpus": { "text": "" } } } """;*/ String payloadJson = """ { "model": "qwen3-asr-flash-filetrans", "input": { "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" }, "parameters": { "channel_id": [0], "enable_itn": false } } """; RequestBody body = RequestBody.create(payloadJson, MediaType.get("application/json; charset=utf-8")); Request request = new Request.Builder() .url(API_URL) .addHeader("Authorization", "Bearer " + apiKey) .addHeader("Content-Type", "application/json") .addHeader("X-DashScope-Async", "enable") .post(body) .build(); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful() && response.body() != null) { String respBody = response.body().string(); // Parse JSON using Gson ApiResponse apiResp = gson.fromJson(respBody, ApiResponse.class); if (apiResp.output != null) { System.out.println("task_id: " + apiResp.output.taskId); } else { System.out.println(respBody); } } else { System.out.println("task failed! HTTP code: " + response.code()); if (response.body() != null) { System.out.println(response.body().string()); } } } catch (IOException e) { e.printStackTrace(); } } static class ApiResponse { @SerializedName("request_id") String requestId; Output output; } static class Output { @SerializedName("task_id") String taskId; @SerializedName("task_status") String taskStatus; } } For SDK examples, see QuickStart. python import requests import json import os # The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription url = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/asr/transcription" # The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key # If the environment variable is not configured, replace the following line with your Model Studio API key: DASHSCOPE_API_KEY = "sk-xxx" DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY") headers = { "Authorization": f"Bearer {DASHSCOPE_API_KEY}", "Content-Type": "application/json", "X-DashScope-Async": "enable" } payload = { "model": "qwen3-asr-flash-filetrans", "input": { "file_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/audios/welcome.mp3" }, "parameters": { "channel_id": [0], # "language": "zh", "enable_itn": False # "corpus": { # "text": "" # } } } response = requests.post(url, headers=headers, data=json.dumps(payload)) if response.status_code == 200: print(f"task_id: {response.json()["output"]["task_id"]}") else: print("task failed!") print(response.json())
modelstring (Required) The model name. This parameter applies only to the Qwen3-ASR-Flash-Filetrans model.
inputobject (Required) Properties file_urlstring (Required) The URL of the audio file to be recognized. The URL must be accessible over the public network. When you use an SDK, if the audio file is stored in OSS, temporary URLs that start with oss:// are not supported. When you use a RESTful API, if the audio file is stored in OSS, temporary URLs that start with oss:// are supported. Note: Important - Temporary URLs are valid for 48 hours. After expiration, they cannot be used. Do not use them in production environments. - The file upload credential API is rate-limited to 100 QPS and cannot be scaled up. Do not use it in production, high-concurrency, or stress testing scenarios. - For production environments, we recommend using stable storage services such as Alibaba Cloud OSS to ensure long-term file availability and avoid rate limiting issues.
parametersobject(Optional) Properties language string (Optional) No default value If the language of the audio is known, you can specify it using this parameter to improve recognition accuracy. You can specify only one language. If the audio language is uncertain or includes multiple languages (such as a mix of Chinese, English, Japanese, and Korean), do not specify this parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish enable_itnboolean (Optional) Defaults to: false Specifies whether to enable Inverse Text Normalization (ITN). This feature applies only to Chinese and English audio. - true - false (default) enable_wordsboolean(Optional) Defaults to: false Specifies whether to return word-level timestamps: - false: Returns sentence-level timestamps. - true: Returns word-level timestamps. Word-level timestamps are supported only for the following languages: Chinese, English, Japanese, Korean, German, French, Spanish, Italian, Portuguese, and Russian. Accuracy for other languages cannot be guaranteed. This parameter also affects the sentence segmentation rules: - false: Sentence segmentation is based on Voice Activity Detection (VAD). - true: Sentence segmentation is based on VAD and punctuation. channel_idarray(Optional) Defaults to: [0] Specifies the indexes of the audio tracks to be recognized in a multi-track audio file. The index starts from 0. For example, [0] indicates that the first audio track is recognized, and [0, 1] indicates that the first and second audio tracks are recognized simultaneously. If this parameter is omitted, the first audio track is processed by default. Important Each specified audio track is billed separately. For example, requesting [0, 1] for a single file will incur two separate charges.
#### Response bodyjson { "request_id": "92e3decd-0c69-47a8-************", "output": { "task_id": "8fab76d0-0eed-4d20-************", "task_status": "PENDING" } }
request_idstring The unique identifier for this call.
outputobject The call result information. Properties task_idstring The task ID. This ID is passed as a request parameter in the API for querying speech recognition tasks. task_statusstring The task status: - PENDING - RUNNING - SUCCEEDED - FAILED - UNKNOWN: The task does not exist or its status is unknown.

Get the task execution result

URL

Singapore

China (Beijing)

HTTP request address: GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

base_url for SDK calls: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1

Replace WorkspaceId with your actual Workspace ID.

HTTP request address: GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

base_url for SDK calls: https://dashscope.aliyuncs.com/api/v1

#### Request bodycURL Java Python curl # ======= Important ======= # The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}. Note that you must replace {task_id} with the ID of the task to be queried. # The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key # === Delete this comment before running the command. === curl --location --request GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ --header "Content-Type: application/json" For SDK examples, see QuickStart. java import okhttp3.*; import java.io.IOException; public class Main { public static void main(String[] args) { // Replace with the actual task_id. String taskId = "xxx"; // The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key // If the environment variable is not configured, replace the following line with your Model Studio API key: String apiKey = "sk-xxx" String apiKey = System.getenv("DASHSCOPE_API_KEY"); // The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}. Note that you must replace {task_id} with the ID of the task to be queried. String apiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/" + taskId; OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url(apiUrl) .addHeader("Authorization", "Bearer " + apiKey) .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(); } } } For SDK examples, see QuickStart. python import os import requests # The API keys for the Singapore and Beijing regions are different. For more information about how to obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key # If the environment variable is not configured, replace the following line with your Model Studio API key: DASHSCOPE_API_KEY = "sk-xxx" DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY") # Replace with the actual task_id. task_id = "xxx" # The following URL is for the Singapore region. Replace {WorkspaceId} with your actual Workspace ID. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}. Note that you must replace {task_id} with the ID of the task to be queried. url = f"https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}" headers = { "Authorization": f"Bearer {DASHSCOPE_API_KEY}", "Content-Type": "application/json" } response = requests.get(url, headers=headers) print(response.json())
task_idstring (Required) The task ID. Pass the task_id from the response of the Submit a task operation to query the speech recognition result.
#### Response bodyRUNNING SUCCEEDED FAILED json { "request_id": "6769df07-2768-4fb0-ad59-************", "output": { "task_id": "9be1700a-0f8e-4778-be74-************", "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 } } } json { "request_id": "1dca6c0a-0ed1-4662-aa39-************", "output": { "task_id": "8fab76d0-0eed-4d20-929f-************", "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": "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/pre/pre-funasr-mlt-v1/20251027/13%3A57/7a3a8236-ffd1-4099-a280-0299686ac7da.json?Expires=1761631066&OSSAccessKeyId=LTAI**************&Signature=1lKv4RgyWCarRuUdIiErOeOBnwM%3D&response-content-disposition=attachment%3Bfilename%3D7a3a8236-ffd1-4099-a280-0299686ac7da.json" } }, "usage": { "seconds": 3 } } json { "request_id": "3d141841-858a-466a-9ff9-************", "output": { "task_id": "c58c7951-7789-4557-9ea3-************", "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" } }
request_idstring The unique identifier for this call.
outputobject The call result information. Properties task_idstring The task ID. This ID is passed as a request parameter in the API for querying speech recognition tasks. task_statusstring The task status: - PENDING - RUNNING - SUCCEEDED - FAILED - UNKNOWN: The task does not exist or its status is unknown. resultobject The speech recognition result. Properties transcription_urlstring The download URL for the recognition result file. The link is valid for 24 hours. After the link expires, you cannot query the task or download the result using the previous URL. The recognition result is saved as a JSON file. You can download the file from this link or read the file content directly using an HTTP request. For more information, see Description of asynchronous call results. submit_timestring The time when the task was submitted. schedule_timestring The time when the task was scheduled, which is the start time of execution. end_timestring The time when the task ended. task_metricsobject Task metrics, which include statistics on the status of subtasks. Properties TOTALinteger The total number of subtasks. SUCCEEDEDinteger The number of successful subtasks. FAILEDinteger The number of failed subtasks. codestring The error code. This is returned only when the task fails. messagestring The error message. This is returned only when the task fails. usageobject The token consumption information for this request. Properties secondsinteger The audio duration for Qwen3-ASR-Flash in seconds.
### Description of asynchronous call resultsjson { "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": "," }, { "begin_time": 1680, "end_time": 1920, "text": " Principal ", "punctuation": "" }, { "begin_time": 2000, "end_time": 2320, "text": "Doris ", "punctuation": "" }, { "begin_time": 2320, "end_time": 2960, "text": "Jackson", "punctuation": "," }, { "begin_time": 3360, "end_time": 3840, "text": " Wakefield ", "punctuation": "" }, { "begin_time": 3840, "end_time": 4480, "text": "faculty", "punctuation": "," }, { "begin_time": 4800, "end_time": 4960, "text": " and ", "punctuation": "" }, { "begin_time": 4960, "end_time": 5040, "text": "of ", "punctuation": "" }, { "begin_time": 5040, "end_time": 5520, "text": "course ", "punctuation": "" }, { "begin_time": 5520, "end_time": 5680, "text": "my ", "punctuation": "" }, { "begin_time": 5760, "end_time": 6000, "text": "fellow ", "punctuation": "" }, { "begin_time": 6000, "end_time": 6720, "text": "classmates", "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": "" }, { "begin_time": 12588, "end_time": 12828, "text": "honored ", "punctuation": "" }, { "begin_time": 12908, "end_time": 12908, "text": "to ", "punctuation": "" }, { "begin_time": 12908, "end_time": 13068, "text": "have ", "punctuation": "" }, { "begin_time": 13068, "end_time": 13228, "text": "been ", "punctuation": "" }, { "begin_time": 13228, "end_time": 13628, "text": "chosen ", "punctuation": "" }, { "begin_time": 13628, "end_time": 13708, "text": "to ", "punctuation": "" }, { "begin_time": 13708, "end_time": 14028, "text": "speak ", "punctuation": "" }, { "begin_time": 14028, "end_time": 14268, "text": "before ", "punctuation": "" }, { "begin_time": 14268, "end_time": 14428, "text": "my ", "punctuation": "" }, { "begin_time": 14428, "end_time": 15148, "text": "classmates ", "punctuation": "" }, { "begin_time": 15308, "end_time": 15468, "text": "as ", "punctuation": "" }, { "begin_time": 15468, "end_time": 15628, "text": "well ", "punctuation": "" }, { "begin_time": 15628, "end_time": 15788, "text": "as ", "punctuation": "" }, { "begin_time": 15788, "end_time": 15788, "text": "the ", "punctuation": "" }, { "begin_time": 15788, "end_time": 16188, "text": "students ", "punctuation": "" }, { "begin_time": 16188, "end_time": 16588, "text": "across ", "punctuation": "" }, { "begin_time": 16588, "end_time": 16988, "text": "America ", "punctuation": "" }, { "begin_time": 16988, "end_time": 17388, "text": "today", "punctuation": "." } ] } ] } ] }
file_urlstring The URL of the recognized audio file.
audio_infoobject Information about the recognized audio file. Properties formatstring The audio format. sample_rateinteger The audio sampling rate.
transcriptsarray A list of complete recognition results. Each element corresponds to the recognized content of an audio track. Properties channel_idinteger The audio track index, starting from 0. textstring The recognized text. sentencesobject A list of sentence-level recognition results. Properties begin_timeinteger The start timestamp of the sentence in milliseconds. end_timeinteger The end timestamp of the sentence in milliseconds. textstring The recognized text. sentence_idinteger The sentence index, starting from 0. languagestring The language of the recognized audio. If the language request parameter is specified, this value is the same as the specified parameter. Valid values - zh: Chinese (Mandarin, Sichuanese, Minnan, and Wu) - yue: Cantonese - en: English - ja: Japanese - de: German - ko: Korean - ru: Russian - fr: French - pt: Portuguese - ar: Arabic - it: Italian - es: Spanish - hi: Hindi - id: Indonesian - th: Thai - tr: Turkish - uk: Ukrainian - vi: Vietnamese - cs: Czech - da: Danish - fil: Filipino - fi: Finnish - is: Icelandic - ms: Malay - no: Norwegian - pl: Polish - sv: Swedish emotionstring The emotion of the recognized audio. The following emotions are supported: - surprised - neutral - happy - sad - disgusted - angry - fearful wordsobject A list of word-level recognition results. This result is displayed when the enable_words request parameter is set to true. Properties begin_timeinteger The start timestamp in milliseconds. end_timeinteger The end timestamp in milliseconds. textstring The recognized text. punctuationstring The punctuation mark.

Previous: Java SDKNext: RESTful API

Is this page helpful?

Model connection types

OpenAI compatible

URL

Request body

Response body

DashScope synchronous

URL

Request body

Response body

DashScope asynchronous invocation

Process description

Submit a task

Get the task execution result

Description of asynchronous call results

Contact Us

Sales Support

Live-chat with our sales team or get in touch with a business development professional in your region.

Contact Sales

Technical Support

Open a ticket and get quick help from our technical team.

Open a Ticket >

Connect & Report Abuse

We look forward to your suggestion.

Post a Suggestion > Report Abuse >

\ \ Hi, I'm Alibaba Cloud AI Assistant!\ \ I can help with questions and solutions.

Why Alibaba Cloud

About Alibaba Cloud

Asia Accelerator

Our Global Network

Global Offices

Trust Center

Case Studies

Analyst Reports

Products & Pricings

Pricing Calculator

ECS

SAS

Model Studio

Database

Security

SMS

Solutions

Financial Services

Retail Services

Media Services

Gaming Services

ISV Solutions

Engage

Developer Community

Partner Network

Startups

Marketplace

Join Alibaba Cloud

Resources & Support

Developer Learning Hub

Documentation Center

Training & Certification

Service Notices

Submit a Ticket

Security Report

Qwen Cloud

Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links

© 2009-2026 Copyright by Alibaba Cloud All rights reserved

© 2009-2026 Copyright by Alibaba Cloud All rights reserved

Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links