统一模型接入与用量管理 立即注册
蓝天
原站参考文档

以下为胜算云公开资料。文中的原站账号、地址、定价和专有服务不属于蓝天;蓝天可用模型以当前 sub2api 配置为准。接入蓝天请先查看 快速开始。

查看原文

Paraformer-V2

ali/paraformer-v2
异步任务:POST /v1/tasks/generations 提交 → GET /v1/tasks/generations/{request_id} 轮询结果(POST 发送后 request_id 自动填入 GET)。

BASE URLhttps://router.shengsuanyun.com/api
认证方式Authorization: Bearer YOUR_API_KEY

端点列表

← 上一页
语音转录 STT · 阿里 Paraformer · 接口汇总
下一页 →
Tripo 3D生成与模型后处理 · 接口汇总

接口参考

以下为原文协议定义与示例,原站地址不代表蓝天已开通对应能力。蓝天接入地址和模型以本地配置为准。

蓝天 API 密钥
POST/v1/tasks/generationsAli 语音转录-异步

异步任务:POST 提交后返回 request_id,再用 GET /v1/tasks/generations/{request_id} 轮询结果。

请求体

application/json
字段类型说明
filesarray
展开结构

array

数组元素

string

filestring
vocabulary_idstring
resource_idstring
resource_typestring
channel_idarray
展开结构

array

数组元素

integer · 0 | 1

disfluency_removal_enabledboolean
timestamp_alignment_enabledboolean
special_word_filterstring
language_hintsarray
展开结构

array

数组元素

string · "zh" | "en"

diarization_enabledboolean
speaker_countinteger
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 / stringPOST /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": ". "
            }
          ]
        }
      ]
    }
  ]
}
400 请求参数错误
401 未授权(API Key 无效)
429 请求过于频繁
500 服务器内部错误