语音转文本

将输入的音频内容,转为文本输出。

请求方式

POST

调用地址

https://api.gptbots.ai/v1/identify

调用验证

详情参见API概述的鉴权方式说明。

请求

请求示例

curl -X POST https://api.gptbots.ai/v1/identify \
  -H 'Authorization: Bearer your_apikey' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@'

请求头

字段类型描述

Authorization

Bearer ${token}

使用Authorization: Bearer ${token}进行调用验证,请在API密钥页面获取密钥作为token

Content-Type

application/json

数据类型,取值为application/json

请求体

字段类型必填描述

file

multipart/form-data

语音文件,最多25 MB,支持的文件格式:mp3

响应

响应示例

{
  "text": "Hi, is there anything I can help you?"
}

成功响应

字段类型描述

text

string

识别的文本内容。

失败响应

字段类型描述

code

int

错误码。

message

string

错误详情。

错误码

CodeMessage

40000

参数错误

40107

凭据已过期

40127

开发者鉴权失败

40325

文件类型无效,仅支持‘m4a’,‘mp3’,‘webm’,‘mp4’,‘mpga’,‘wav’,‘mpeg’

50000

系统内部错误

Last updated