-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working