Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

gpt-4o-transcribe client.audio.transcriptions.create fails on all supported audio types (“This model does not support the format you provided.”)

未关闭
#2,477 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@LuminaX-alt 已经在做这个了。

开始于 2025年7月31日。

  • #8 来自 @LuminaX-alt —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

首先,使用 issue 中的 WAV、MP3、M4A 和 BytesIO 示例,通过 client.audio.transcriptions.create 重现报告的调用。检查转录请求路径,并将行为与 whisper-1 进行比较;完成的标准是,受支持的音频输入不再导致 gpt-4o-transcribe 失败,或明确确定库与 API 之间的边界。

由索引模型根据 Issue 内容生成。

描述

bug
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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openai/openai-python 的其他 Issue

查看 openai/openai-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。