GPT-4o 转录
![]()
本页保留转录专用型号,目录同时列有 gpt-4o-mini-transcribe;不要将通用聊天型号填入音频转录接口。
▼
Authorization
在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
请求参数
Header 参数
Authorizationstring必需
Bearer Token;从环境变量 tokenba_API_KEY 读取。
Content-Typestring可选
由客户端生成 multipart/form-data 的 boundary,不手工设置。
Body 参数multipart/form-data
filefile必需
本地音频文件;将环境变量 AUDIO_FILE 设置为文件路径。
modelstring必需
示例:gpt-4o-transcribe
response_formatstring可选
示例:json
请求示例代码
curl --fail-with-body --request POST 'https://api.apizt.com/v1/audio/transcriptions' \
--header "Authorization: Bearer ${tokenba_API_KEY}" \
--form "file=@${AUDIO_FILE}" \
--form 'model=gpt-4o-transcribe' \
--form 'response_format=json'async function main() {
const headers = {
"Authorization": "Bearer " + process.env.tokenba_API_KEY
};
const fs = require("node:fs");
const body = new FormData();
body.append("file", new Blob([fs.readFileSync(process.env.AUDIO_FILE)]), "audio.wav");
body.append("model", "gpt-4o-transcribe");
body.append("response_format", "json");
const response = await fetch("https://api.apizt.com/v1/audio/transcriptions", { method: "POST", headers, body });
if (!response.ok) throw new Error("HTTP " + response.status + ": " + await response.text());
console.log(await response.text());
}
main().catch(console.error);import os
import requests
headers = {"Authorization": "Bearer " + os.environ["tokenba_API_KEY"]}
payload = {'model': 'gpt-4o-transcribe', 'response_format': 'json'}
with open(os.environ["AUDIO_FILE"], "rb") as audio:
response = requests.post('https://api.apizt.com/v1/audio/transcriptions', headers=headers, data=payload, files={"file": audio}, timeout=120)
response.raise_for_status()
print(response.text)返回响应
响应参数 🟢 200 OK · application/json
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."
}
当前模型与版本
依据 apizt 价格页,同步于 。以下型号按目录声明的协议与本页用途筛选;不代表所有参数和功能通用。切换前请核对型号说明、令牌分组与参数差异。Gemini 原生接口需同时替换 URL 中的模型 ID。
| 模型 ID | 能力标签 | 支持分组 |
|---|---|---|
whisper-1 | 音频 | 分组(7)
|
gpt-4o-transcribe | 音频 | 分组(6)
|
gpt-4o-mini-transcribe | 音频 | 分组(5)
|
共列入 3 个候选型号。查看完整模型、版本与接口目录。