gpt-4o-transcribe client.audio.transcriptions.create fails on all supported audio types (“This model does not support the format you provided.”)
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- api, audio-video-rtc
调研方向
首先,使用 issue 中的 WAV、MP3、M4A 和 BytesIO 示例,通过 client.audio.transcriptions.create 重现报告的调用。检查转录请求路径,并将行为与 whisper-1 进行比较;完成的标准是,受支持的音频输入不再导致 gpt-4o-transcribe 失败,或明确确定库与 API 之间的边界。
由索引模型根据 Issue 内容生成。
描述
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
When calling client.audio.transcriptions.create(model="gpt-4o-transcribe", file=...) I consistently receive:
openai.BadRequestError: Error code: 400 - {'error': {'message': 'This model does not support the format you provided.', 'type': 'invalid_request_error', 'param': 'messages', 'code': 'unsupported_format'}}
regardless of supplying the file as:
- wav (PCM‑16, 16 kHz, mono)
- mp3
- m4a (AAC)
- an in‑memory BytesIO buffer with .name set to the proper extension
The same code works fine with the whisper-1 model, but gpt-4o-transcribe/mini always rejects the input, even though I have verified via ffprobe/sox that my files are valid PCM‑16 WAV, standard MP3, or AAC.
To Reproduce
from openai import OpenAI
from dotenv import load_dotenv
from io import BytesIO
import os
load_dotenv()
client = OpenAI()
# 1) Try WAV on disk
with open("audio.wav", "rb") as f:
resp = client.audio.transcriptions.create(
model="gpt-4o-transcribe",
file=f
)
print(resp)
# 2) Try MP3 on disk
with open("audio.mp3", "rb") as f:
resp = client.audio.transcriptions.create(
model="gpt-4o-transcribe",
file=f
)
print(resp)
# 3) Try M4A on disk
with open("audio.m4a", "rb") as f:
resp = client.audio.transcriptions.create(
model="gpt-4o-transcribe",
file=f
)
print(resp)
# 4) Try BytesIO wrapper
data = open("audio.wav", "rb").read()
buffer = BytesIO(data)
buffer.name = "audio.wav"
buffer.seek(0)
resp = client.audio.transcriptions.create(
model="gpt-4o-transcribe",
file=buffer
)
print(resp)
Code snippets
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
client = OpenAI()
audio_file = open("temp/audio.wav", "rb")
transcription = client.audio.transcriptions.create(
model="gpt-4o-transcribe", file=audio_file
)
print(transcription.text)
OS
Windows 11
Python version
3.13
Library version
openai==1.97.0
- 主要语言
- Python
- 星标
- 31.8k
- 派生
- 8k
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 137
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openai/openai-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
openai/openai-python#4022 · 20 条评论 ·
维护者通常 1 天内回复
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providers可能已有人在做 @mohmedmm 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
openai/openai-python#4017 · 3 条评论 ·
维护者通常 1 天内回复
-
Querystring drops explicit empty-string scalar values可能已有人在做 @sylvesterkaczmarek 于 35 天前认领。 未关闭sdk-breaking-change v4
难度 2/5 1-3 小时 新手友好度 86/100
openai/openai-python#3837 ·
维护者通常 1 天内回复
-
Define + export `ServiceTiers` string literal可能已有人在做 @SparshGarg999 于 61 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
openai/openai-python#3556 · 3 条评论 ·
维护者通常 1 天内回复
-
Empty OPENAI_BASE_URL prevents fallback to default API endpoint可能已有人在做 @Sehastrajit-S 于 27 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
openai/openai-python#2927 · 6 条评论 ·
维护者通常 1 天内回复
查看 openai/openai-python 的全部 Issue
相似的 Issue
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops it未关闭
难度 2/5 1-3 小时 新手友好度 82/100
docling-project/docling#4846 ·
维护者通常 1 天内回复
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#138914 · 1 条评论 ·
维护者通常 1 天内回复
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typo未关闭documentation
难度 2/5 1-3 小时 新手友好度 75/100
elastic/oblt-aw#2382 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复