AI 语音识别(ASR)大模型 API 接口
通过我们的 AI 语音识别大模型 API 接口,您可以轻松将音频转化为高精度文本。接口采用先进的深度学习技术,支持多语言、多场景语音识别,准确率高,响应速度快,适用于会议记录、语音助手、客户服务、视频转写等各类应用。无论是实时语音转写还是批量处理,均能提供稳定、灵活的服务。立即接入我们的 ASR API,提升您的智能语音体验。
接口地址
POST https://wcode.net/api/audio/gpt/audio-to-text/v3/transcription
快速开始
(注:以下请求示例中的 API_KEY
需要替换后再发起请求。 获取 API_KEY
入口:https://wcode.net/get-apikey)
请求示例(paraformer-v2模型)
curl --request POST 'https://wcode.net/api/audio/gpt/audio-to-text/v3/transcription' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY' \
--data '{
"file_url": "https://zdkjdemo.oss-cn-shanghai.aliyuncs.com/hello.mp3",
"model": "paraformer-v2"
}'
计费方式
按调用次数计费,费用充值:https://wcode.net/apikey-recharge,费用发票:https://wcode.net/get-fapiao
模型ID | 价格(元/小时) | 模型说明 |
---|---|---|
paraformer-v2 | 0.63 | Paraformer-v2 语音识别模型,支持多个语种的语音识别。 |
请求方法
POST
请求头(Request Headers)
Header | 值 | 备注 | 示例 | 相关链接 |
---|---|---|---|---|
Authorization | Bearer API_KEY |
格式:Bearer + 空格 + API_KEY | Bearer sk-..... |
获取 API_KEY 入口:https://wcode.net/get-apikey |
Content-Type | application/json |
固定为 application/json |
请求参数
🚀 model
| ✅️必填 | string
| 模型ID
模型ID | 价格(元/小时) | 模型说明 |
---|---|---|
paraformer-v2 | 0.63 | Paraformer-v2 语音识别模型,支持多个语种的语音识别。 |
🚀 file_url
| ✅️必填 | string
| 需要进行识别的语音文件 URL,需支持公网访问。示例:https://zdkjdemo.oss-cn-shanghai.aliyuncs.com/hello.mp3
返回参数
不同模型返回参数可能存在差异,请以实际返回为准。
返回参数 | 数据类型 | 说明 |
---|---|---|
status | string | 请求成功返回success ,失败返回failed |
error_message | string | 接口返回的错误消息。当status 为success 时,error_message 为空字符串 |
error_code | int 或 null | 接口返回的错误码。当status 为success 时,error_code 为 null |
data | object 或 null | 接口返回的数据。当status 为failed 时,data 为 null |
data.result.text | string | 语音识别结果 |
data.usage | object | 本次调用的费用信息 |
data.usage.total_cost | float | 本次调用产生的费用 |
data.api_version | string | 当前所使用的 API 的版本,免费版为free ,付费版为paid |
data.api_docs | string | 当前所使用的 API 的文档链接 |
响应头(Response Headers)
Header | 说明 | 示例 | 相关链接 |
---|---|---|---|
X-Account-Balance | API_KEY 余额(元) | 123.0165 |
API_KEY 费用充值入口:https://wcode.net/apikey-recharge |
Python 代码示例(Requests)
import requests
import json
url = "https://wcode.net/api/audio/gpt/audio-to-text/v3/transcription"
payload = json.dumps({
"file_url": "https://zdkjdemo.oss-cn-shanghai.aliyuncs.com/hello.mp3",
"model": "paraformer-v2"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY' # TODO: 这里的 API_KEY 需要替换,获取 API_KEY 入口:https://wcode.net/get-apikey
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
...其他编程语言可参考下方 curl http 请求示例进行调用
请求示例 1(使用 paraformer-v2 模型)
curl --request POST 'https://wcode.net/api/audio/gpt/audio-to-text/v3/transcription' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY' \
--data '{
"file_url": "https://zdkjdemo.oss-cn-shanghai.aliyuncs.com/hello.mp3",
"model": "paraformer-v2"
}'
响应示例 1
{
"status": "success",
"error_message": "",
"error_code": null,
"data": {
"result": {
"text": "您好,这里是万码云开发平台技术研发中心。"
},
"api_usage": {
"total_cost": 0.0007,
"total_cost_currency": "CNY",
"total_cost_currency_symbol": "¥"
},
"api_version": "paid"
}
}