Skip to Content
模型用法GPT 转录

GPT 转录系列

OpenAI 的语音转录模型,通过 POST /v1/audio/transcriptions 上传音频,返回文字。

模型 ID(调用时原样复制)
GPT Transcribeopenai/gpt-transcribe按音频秒数计费
GPT-4o mini Transcribeopenai/gpt-4o-mini-transcribe按 token 计费

接口的通用参数见 Audio Transcriptions API。实时价格请参阅模型页 。需要逐词时间戳或说话人分离时,请使用 ElevenLabs Scribe v2。

调用示例

gpt_transcribe.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"]) with open("meeting.mp3", "rb") as f: result = client.audio.transcriptions.create( model="openai/gpt-transcribe", file=f, language="zh", prompt="以下是普通话的句子,请使用简体中文。", ) print(result.text) print(result.usage)

参数与计费

要点转录普通话时,请同时传入 language 与 prompt,指定使用简体中文,否则可能输出繁体字。
项目说明
language 与 prompt实测 gpt-transcribe 只传 language: "zh" 时,4 次中仍有 1 次输出繁体;同时传入 prompt: "以下是普通话的句子,请使用简体中文。" 后,4 次均为简体
response_format仅支持 json(默认)。verbose_json、text、srt、vtt 均返回 400
返回内容text 与 usage,不含逐词时间戳
计费gpt-transcribe 按音频秒数,usage 为 {"type": "duration", "seconds": ...};gpt-4o-mini-transcribe 按 token,usage 中含 input_tokens、output_tokens

实测约 9 秒的中文对话,转录约 2 至 3 秒返回。

常见报错

HTTP报错原文原因处理方法
400response_format 'verbose_json' is not compatible with model 'gpt-transcribe'.GPT 转录模型不支持 verbose_json改用 json
400Unsupported response_format 'srt'. Only 'json' and 'verbose_json' are supported on this gateway使用了 text、srt、vtt改用 json
400Unsupported file format txt上传的不是音频文件上传 mp3、wav 等音频

更多报错见 Audio Transcriptions API。

官方文档

常见问题

GPT 转录中文输出了繁体字?

同时传入 language: "zh" 与 prompt: "以下是普通话的句子,请使用简体中文。"。实测只传 language 时仍偶尔输出繁体,加上 prompt 后稳定输出简体。

GPT 转录能输出 srt 字幕吗?

不能,仅支持 json。需要时间戳生成字幕时,请使用 ElevenLabs Scribe v2,它返回逐词的起止时间。

gpt-transcribe 和 gpt-4o-mini-transcribe 怎么计费?

gpt-transcribe 按音频秒数计费;gpt-4o-mini-transcribe 按 token 计费,用量见响应的 usage。单价见模型页。

最后更新于