API中文文档
  1. 音频(Audio)
API中文文档
  • 介绍
  • 项目说明
  • 导言
  • 身份验证
  • 参数详情
  • 音频(Audio)
    • 创建语音
      POST
    • 创建转录
      POST
    • 创建翻译
      POST
  • 聊天(Chat)
    • 聊天完成对象
    • 聊天完成块对象
    • 创建聊天补全
      POST
  • 自动补全(Completions)
    • 完成对象
    • 创建完成
      POST
  • 模型(Models)
    • 模型对象
    • 列出模型
      GET
    • 检索模型
      GET
  1. 音频(Audio)

创建转录

POST
https://www.askapi.chat/v1/audio/transcriptions

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Body 参数multipart/form-data
file
file 
必需
要转录的音频文件对象(不是文件名),格式为:flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav 或 webm。
model
string 
必需
要使用的模型 ID。目前只有 whisper-1 是可用的。
language
string 
可选
输入音频的语言。以 ISO-639-1 格式提供输入语言可以提高准确性和延迟。
prompt
string 
可选
一个可选的文本来指导模型的风格或继续之前的音频段落。提示应该与音频语言匹配。
response_format
string 
可选
默认为 json
转录输出的格式,可选择:json、text、srt、verbose_json 或 vtt。
temperature
number 
可选
默认为 0
采样温度,between 0 和 1。更高的值像 0.8 会使输出更随机,而更低的值像 0.2 会使其更集中和确定性。如果设置为 0,模型将使用对数概率自动增加温度直到达到特定阈值。

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.askapi.chat/v1/audio/transcriptions' \
--form 'file=@""' \
--form 'model=""' \
--form 'language=""' \
--form 'prompt=""' \
--form 'response_format=""' \
--form 'temperature=""'

返回响应

🟢200成功
application/json
Body
text
string 
必需
示例
{
  "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that."
}
上一页
创建语音
下一页
创建翻译
Built with