跳转至

音频接口

本节列出该能力下当前已实现的接口。

音频转录

POST /v1/audio/transcriptions

将音频转换为文本

鉴权

  • Bearer Token (Authorization: Bearer <token>)

请求体

  • Content-Type: multipart/form-data
字段 类型 必填 说明
file string yes 音频文件
model string yes -
language string no ISO-639-1 语言代码
prompt string no -
response_format string no -
temperature number no -
timestamp_granularities array[string] no -

返回

状态码 说明 Schema
200 成功转录 AudioTranscriptionResponse

音频翻译

POST /v1/audio/translations

将音频翻译为英文文本

鉴权

  • Bearer Token (Authorization: Bearer <token>)

请求体

  • Content-Type: multipart/form-data
字段 类型 必填 说明
file string yes -
model string yes -
prompt string no -
response_format string no -
temperature number no -

返回

状态码 说明 Schema
200 成功翻译 AudioTranscriptionResponse

文本转语音

POST /v1/audio/speech

将文本转换为音频

鉴权

  • Bearer Token (Authorization: Bearer <token>)

请求体

  • Content-Type: application/json
  • Schema: SpeechRequest
字段 类型 必填 说明
model string yes -
input string yes 要转换的文本
voice string yes -
response_format string no -
speed number no -

返回

状态码 说明 Schema
200 成功生成音频 string