主题
音频转文字 gpt-4o-transcribe
POST
https://az.gptplus5.com/v1/audio/transcriptions
官方文档:https://platform.openai.com/docs/guides/speech-to-text
请求参数
Authorization
在 Header 添加参数Authorization,其值为在 Bearer 之后拼接 Token
示例:Authorization: Bearer ********************
Header 参数
| 参数名 | 类型 | 必需 | 说明 | 示例 |
|---|---|---|---|---|
Content-Type | string | 可选 | multipart/form-data |
Body 参数 (multipart/form-data)
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
file | file | 必需 | 要转录的音频文件对象(不是文件名),格式为:flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav 或 webm。 |
model | string | 必需 | 要使用的模型 ID。目前只有 whisper-1,gpt-4o-mini-transcribe 是可用的。 |
language | string | 可选 | 输入音频的语言。以 ISO-639-1 格式提供输入语言可以提高准确性和延迟。 |
prompt | string | 可选 | 一个可选的文本来指导模型的风格或继续之前的音频段落。提示应该与音频语言匹配。 |
response_format | string | 可选 | 默认为 json 转录输出的格式,可选择:json、text |
temperature | number | 可选 | 默认为 0,采样温度,between 0 和 1。更高的值像 0.8 会使输出更随机,而更低的值像 0.2 会使其更集中和确定性。如果设置为 0,模型将使用对数概率自动增加温度直到达到特定阈值。 |
cURL 示例
bash
curl --location --request POST 'https://az.gptplus5.com/v1/audio/transcriptions' \
--header 'Authorization: Bearer <token>' \
--form 'file=@"C:\\Users\\Administrator\\Desktop\\test.m4a"' \
--form 'model="gpt-4o-transcribe"' \
--form 'response_format="json"'返回响应
🟢200成功
响应 Body
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
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."
}