Paraformer-V2
ali/paraformer-v2
异步任务:POST /v1/tasks/generations 提交 → GET /v1/tasks/generations/{request_id} 轮询结果(POST 发送后 request_id 自动填入 GET)。
BASE URL
https://router.shengsuanyun.com/api认证方式
Authorization: Bearer YOUR_API_KEY端点列表
POST/v1/tasks/generationsAli 语音转录-异步
异步任务:POST 提交后返回 request_id,再用 GET /v1/tasks/generations/{request_id} 轮询结果。
请求体
application/json
| 字段 | 类型 | 说明 |
|---|---|---|
files | array | 展开结构
数组元素
|
file | string | |
vocabulary_id | string | |
resource_id | string | |
resource_type | string | |
channel_id | array | 展开结构
数组元素
|
disfluency_removal_enabled | boolean | |
timestamp_alignment_enabled | boolean | |
special_word_filter | string | |
language_hints | array | 展开结构
数组元素
|
diarization_enabled | boolean | |
speaker_count | integer | |
model必填 | string | 路由模型,本页固定为 ali/paraformer-v2 |
{
"files": [],
"file": "string",
"vocabulary_id": "string",
"resource_id": "string",
"resource_type": "string",
"channel_id": [
"0"
],
"disfluency_removal_enabled": false,
"timestamp_alignment_enabled": false,
"special_word_filter": "string",
"language_hints": [
"zh"
],
"diarization_enabled": false,
"speaker_count": 1,
"model": "ali/paraformer-v2"
}请求示例
参考地址:https://router.shengsuanyun.com/api。路径参数与凭据需替换;非 JSON 请求体需按对应格式准备。
curl -X POST 'https://router.shengsuanyun.com/api/v1/tasks/generations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data '{
"files": [],
"file": "string",
"vocabulary_id": "string",
"resource_id": "string",
"resource_type": "string",
"channel_id": [
"0"
],
"disfluency_removal_enabled": false,
"timestamp_alignment_enabled": false,
"special_word_filter": "string",
"language_hints": [
"zh"
],
"diarization_enabled": false,
"speaker_count": 1,
"model": "ali/paraformer-v2"
}'响应
200 提交成功,返回 request_id / task_id
application/json
未提供结构定义。
{
"code": "success",
"message": "",
"data": {
"request_id": "REQ_xxx",
"task_id": "TASK_xxx",
"action": "GENERATION",
"status": "PENDING",
"progress": "0%"
}
}400 请求参数错误
401 未授权(API Key 无效)
429 请求过于频繁
500 服务器内部错误
GET/v1/tasks/generations/{request_id}查询异步任务状态与产物
通过 POST /v1/tasks/generations 返回的 request_id 轮询任务状态、进度与产物 URL(image_urls / video_urls / audio_urls / file_urls / text)。下方「在线测试」填入 request_id 即可发送查询;若上方 POST 已发送成功,request_id 会自动填入。
请求参数
| 参数 | 位置 / 类型 | 说明 |
|---|---|---|
request_id必填 | path / string | POST /v1/tasks/generations 返回的请求 ID |
请求示例
参考地址:https://router.shengsuanyun.com/api。路径参数与凭据需替换;非 JSON 请求体需按对应格式准备。
curl -X GET 'https://router.shengsuanyun.com/api/v1/tasks/generations/{request_id}' \
-H 'Authorization: Bearer YOUR_API_KEY'响应
200 任务状态与产物
application/json
未提供结构定义。
{
"file_url": "https://shengsuanyun.oss-cn-shanghai.aliyuncs.com/modelinfo/example3.mp3",
"properties": {
"audio_format": "mp3",
"channels": [
0
],
"original_sampling_rate": 44100,
"original_duration_in_milliseconds": 15490
},
"transcripts": [
{
"channel_id": 0,
"content_duration_in_milliseconds": 15480,
"text": "How many roads must a man walk down before they call him a man? How many seas must a White dove sail before she sleeps in the sand? How many times must the cannon balls fly before their forever band? The answer, my friend, is blowing in the wind. ",
"sentences": [
{
"begin_time": 0,
"end_time": 4197,
"text": "How many roads must a man walk down before they call him a man? ",
"sentence_id": 1,
"words": [
{
"begin_time": 0,
"end_time": 262,
"text": "How ",
"punctuation": ""
},
{
"begin_time": 262,
"end_time": 524,
"text": "many ",
"punctuation": ""
},
{
"begin_time": 524,
"end_time": 1049,
"text": "roads ",
"punctuation": ""
},
{
"begin_time": 1049,
"end_time": 1311,
"text": "must ",
"punctuation": ""
},
{
"begin_time": 1311,
"end_time": 1574,
"text": "a ",
"punctuation": ""
},
{
"begin_time": 1574,
"end_time": 1836,
"text": "man ",
"punctuation": ""
},
{
"begin_time": 1836,
"end_time": 2098,
"text": "walk ",
"punctuation": ""
},
{
"begin_time": 2098,
"end_time": 2361,
"text": "down ",
"punctuation": ""
},
{
"begin_time": 2361,
"end_time": 2886,
"text": "before ",
"punctuation": ""
},
{
"begin_time": 2886,
"end_time": 3148,
"text": "they ",
"punctuation": ""
},
{
"begin_time": 3148,
"end_time": 3410,
"text": "call ",
"punctuation": ""
},
{
"begin_time": 3410,
"end_time": 3673,
"text": "him ",
"punctuation": ""
},
{
"begin_time": 3673,
"end_time": 3935,
"text": "a ",
"punctuation": ""
},
{
"begin_time": 3935,
"end_time": 4197,
"text": "man",
"punctuation": "? "
}
]
},
{
"begin_time": 4197,
"end_time": 8395,
"text": "How many seas must a White dove sail before she sleeps in the sand? ",
"sentence_id": 2,
"words": [
{
"begin_time": 4197,
"end_time": 4460,
"text": "How ",
"punctuation": ""
},
{
"begin_time": 4460,
"end_time": 4722,
"text": "many ",
"punctuation": ""
},
{
"begin_time": 4722,
"end_time": 4985,
"text": "seas ",
"punctuation": ""
},
{
"begin_time": 4985,
"end_time": 5247,
"text": "must ",
"punctuation": ""
},
{
"begin_time": 5247,
"end_time": 5509,
"text": "a ",
"punctuation": ""
},
{
"begin_time": 5509,
"end_time": 5772,
"text": "White ",
"punctuation": ""
},
{
"begin_time": 5772,
"end_time": 6034,
"text": "dove ",
"punctuation": ""
},
{
"begin_time": 6034,
"end_time": 6296,
"text": "sail ",
"punctuation": ""
},
{
"begin_time": 6296,
"end_time": 6821,
"text": "before ",
"punctuation": ""
},
{
"begin_time": 6821,
"end_time": 7084,
"text": "she ",
"punctuation": ""
},
{
"begin_time": 7084,
"end_time": 7608,
"text": "sleeps ",
"punctuation": ""
},
{
"begin_time": 7608,
"end_time": 7871,
"text": "in ",
"punctuation": ""
},
{
"begin_time": 7871,
"end_time": 8133,
"text": "the ",
"punctuation": ""
},
{
"begin_time": 8133,
"end_time": 8395,
"text": "sand",
"punctuation": "? "
}
]
},
{
"begin_time": 8395,
"end_time": 12331,
"text": "How many times must the cannon balls fly before their forever band? ",
"sentence_id": 3,
"words": [
{
"begin_time": 8395,
"end_time": 8658,
"text": "How ",
"punctuation": ""
},
{
"begin_time": 8658,
"end_time": 8920,
"text": "many ",
"punctuation": ""
},
{
"begin_time": 8920,
"end_time": 9183,
"text": "times ",
"punctuation": ""
},
{
"begin_time": 9183,
"end_time": 9445,
"text": "must ",
"punctuation": ""
},
{
"begin_time": 9445,
"end_time": 9707,
"text": "the ",
"punctuation": ""
},
{
"begin_time": 9707,
"end_time": 10232,
"text": "cannon ",
"punctuation": ""
},
{
"begin_time": 10232,
"end_time": 10494,
"text": "balls ",
"punctuation": ""
},
{
"begin_time": 10494,
"end_time": 10757,
"text": "fly ",
"punctuation": ""
},
{
"begin_time": 10757,
"end_time": 11282,
"text": "before ",
"punctuation": ""
},
{
"begin_time": 11282,
"end_time": 11544,
"text": "their ",
"punctuation": ""
},
{
"begin_time": 11544,
"end_time": 12069,
"text": "forever ",
"punctuation": ""
},
{
"begin_time": 12069,
"end_time": 12331,
"text": "band",
"punctuation": "? "
}
]
},
{
"begin_time": 12331,
"end_time": 15480,
"text": "The answer, my friend, is blowing in the wind. ",
"sentence_id": 4,
"words": [
{
"begin_time": 12331,
"end_time": 12593,
"text": "The ",
"punctuation": ""
},
{
"begin_time": 12593,
"end_time": 13118,
"text": "answer",
"punctuation": ", "
},
{
"begin_time": 13118,
"end_time": 13381,
"text": "my ",
"punctuation": ""
},
{
"begin_time": 13381,
"end_time": 13905,
"text": "friend",
"punctuation": ", "
},
{
"begin_time": 13905,
"end_time": 14168,
"text": "is ",
"punctuation": ""
},
{
"begin_time": 14168,
"end_time": 14692,
"text": "blowing ",
"punctuation": ""
},
{
"begin_time": 14692,
"end_time": 14955,
"text": "in ",
"punctuation": ""
},
{
"begin_time": 14955,
"end_time": 15217,
"text": "the ",
"punctuation": ""
},
{
"begin_time": 15217,
"end_time": 15480,
"text": "wind",
"punctuation": ". "
}
]
}
]
}
]
}