创建转录(whisper
方法: POST路径: /v1/audio/transcriptions
要转录的音频文件对象(不是文件名),格式为:flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav 或 webm。
请求参数
Header 参数
text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}Body 参数 multipart/form-data
text
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
bash
curl --location --request POST '/v1/audio/transcriptions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--form 'file=@""' \
--form 'model=""' \
--form 'language=""' \
--form 'prompt=""' \
--form 'response_format=""' \
--form 'temperature=""'返回响应
🟢 200 成功
内容类型: application/json
响应结构
text
text
string
必需示例
json
{
"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."
}