Speech to Text (ASR)
Convert the speech content in an audio or video file into text. Supports multiple language codes and can return sentence-level or word-level timestamps.
Create Task
Basic Information
| Item | Value |
|---|
| Request Method | POST |
| Request Path | /task/asr |
| Content-Type | application/json |
| Authentication | Raw API key in the Authorization header |
Request Body
| Parameter | Type | Required | Default | Description |
|---|
file_id | string | Yes | - | Uploaded audio or video file ID |
language | string | No | "zh-CN" | Standard locale language code. See the full supported list below |
word_level | boolean | No | false | Whether to return word-level timestamps |
Supported Language Codes
Pass the standardized locale code in language. The current implementation accepts 101 values:
Request language | Language name |
|---|
zh-CN | Chinese (China) |
en-US | English (United States) |
ja-JP | Japanese (Japan) |
ko-KR | Korean (South Korea) |
fr-FR | French (France) |
de-DE | German (Germany) |
es-MX | Spanish (Mexico) |
pt-BR | Portuguese (Brazil) |
ru-RU | Russian (Russia) |
zh-HK | Chinese (Hong Kong SAR China) |
id-ID | Indonesian (Indonesia) |
fil-PH | Filipino (Philippines) |
ms-MY | Malay (Malaysia) |
th-TH | Thai (Thailand) |
ar-SA | Arabic (Saudi Arabia) |
af-ZA | Afrikaans (South Africa) |
am-ET | Amharic (Ethiopia) |
as-IN | Assamese (India) |
az-AZ | Azerbaijani (Azerbaijan) |
ba-RU | Bashkir (Russia) |
be-BY | Belarusian (Belarus) |
bg-BG | Bulgarian (Bulgaria) |
bn-IN | Bangla (India) |
bo-CN | Tibetan (China) |
br-FR | Breton (France) |
bs-BA | Bosnian (Bosnia & Herzegovina) |
ca-ES | Catalan (Spain) |
cs-CZ | Czech (Czechia) |
cy-GB | Welsh (United Kingdom) |
da-DK | Danish (Denmark) |
el-GR | Greek (Greece) |
et-EE | Estonian (Estonia) |
eu-ES | Basque (Spain) |
fa-IR | Persian (Iran) |
fi-FI | Finnish (Finland) |
fo-FO | Faroese (Faroe Islands) |
gl-ES | Galician (Spain) |
gu-IN | Gujarati (India) |
ha-NG | Hausa (Nigeria) |
haw-US | Hawaiian (United States) |
he-IL | Hebrew (Israel) |
hi-IN | Hindi (India) |
hr-HR | Croatian (Croatia) |
ht-HT | Haitian Creole (Haiti) |
hu-HU | Hungarian (Hungary) |
hy-AM | Armenian (Armenia) |
is-IS | Icelandic (Iceland) |
it-IT | Italian (Italy) |
jw-ID | Javanese (Indonesia) |
ka-GE | Georgian (Georgia) |
kk-KZ | Kazakh (Kazakhstan) |
km-KH | Khmer (Cambodia) |
kn-IN | Kannada (India) |
la-VA | Latin (Vatican City) |
lb-LU | Luxembourgish (Luxembourg) |
ln-CD | Lingala (Congo - Kinshasa) |
lo-LA | Lao (Laos) |
lt-LT | Lithuanian (Lithuania) |
lv-LV | Latvian (Latvia) |
mg-MG | Malagasy (Madagascar) |
mi-NZ | Māori (New Zealand) |
mk-MK | Macedonian (North Macedonia) |
ml-IN | Malayalam (India) |
mn-MN | Mongolian (Mongolia) |
mr-IN | Marathi (India) |
mt-MT | Maltese (Malta) |
my-MM | Burmese (Myanmar (Burma)) |
ne-NP | Nepali (Nepal) |
nl-NL | Dutch (Netherlands) |
nn-NO | Norwegian Nynorsk (Norway) |
no-NO | Norwegian (Norway) |
oc-FR | Occitan (France) |
pa-IN | Punjabi (India) |
pl-PL | Polish (Poland) |
ps-AF | Pashto (Afghanistan) |
ro-RO | Romanian (Romania) |
sa-IN | Sanskrit (India) |
sd-IN | Sindhi (India) |
si-LK | Sinhala (Sri Lanka) |
sk-SK | Slovak (Slovakia) |
sl-SI | Slovenian (Slovenia) |
sn-ZW | Shona (Zimbabwe) |
so-SO | Somali (Somalia) |
sq-AL | Albanian (Albania) |
sr-RS | Serbian (Serbia) |
su-ID | Sundanese (Indonesia) |
sv-SE | Swedish (Sweden) |
sw-KE | Swahili (Kenya) |
ta-IN | Tamil (India) |
te-IN | Telugu (India) |
tg-TJ | Tajik (Tajikistan) |
tk-TM | Turkmen (Turkmenistan) |
tl-PH | Filipino (Philippines) |
tr-TR | Turkish (Türkiye) |
tt-RU | Tatar (Russia) |
uk-UA | Ukrainian (Ukraine) |
ur-PK | Urdu (Pakistan) |
uz-UZ | Uzbek (Uzbekistan) |
vi-VN | Vietnamese (Vietnam) |
yi-DE | Yiddish (Germany) |
yo-NG | Yoruba (Nigeria) |
Tip: fil-PH and tl-PH are both accepted. For Cantonese content from Hong Kong, prefer zh-HK.
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/asr \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "537489015178246",
"language": "zh-CN",
"word_level": true
}'
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "asr",
"status": "queued"
}
}
Query Task Result
Basic Information
| Item | Value |
|---|
| Request Method | GET |
| Request Path | /task/asr/{task_id} |
| Authentication | Raw API key in the Authorization header |
Output Result (output_result)
| Parameter | Type | Description |
|---|
text | string | Full recognition text |
sentence_list | array | Sentence-level timestamp list |
sentence_list[].text | string | Sentence text |
sentence_list[].start_time | number | Sentence start time in seconds |
sentence_list[].end_time | number | Sentence end time in seconds |
word_list | array | Word-level timestamps, returned only when word_level: true |
word_list[].text | string | Word or token text |
word_list[].start_time | number | Start time in seconds |
word_list[].end_time | number | End time in seconds |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"text": "Hello world, this is a test clip.",
"sentence_list": [
{
"text": "Hello world, this is a test clip.",
"start_time": 0.0,
"end_time": 3.5
}
],
"word_list": [
{ "text": "Hello", "start_time": 0.0, "end_time": 0.6 },
{ "text": "world", "start_time": 0.6, "end_time": 1.1 }
]
},
"create_time": "2026-04-05T08:00:00Z",
"update_time": "2026-04-05T08:00:10Z"
}
}
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6015 | 400 | Unsupported language code | Use one of the supported codes listed above, such as zh-CN or en-US |
6004 | 404 | File not found | Verify the file_id |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |