Gpt-4o-transcribe returns "audio file might be corrupted or unsupported"

Thanks! It seems file types and names are strictly enforced, which is good. The issue got resolved.

1 Like

It seems that there is an error in the openai-java library. I still get the following error when switching to gpt-4o-mini-transcribe, while it works perfectly with whisper-1.

File audioFile = new File(getCacheDir(), "audio.mp3");

TranscriptionCreateParams transcriptionCreateParams = TranscriptionCreateParams.builder()
        .file(audioFile.toPath())
        .model(AudioModel.GPT_4O_MINI_TRANSCRIBE)
        .responseFormat(AudioResponseFormat.JSON)  // gpt-4o-transcribe only supports json
        .build();

Transcription transcription = client.audio().transcriptions().create(transcriptionCreateParams).asTranscription();
String resultText = transcription.text();
com.openai.errors.BadRequestException: 400: Audio file might be corrupted or unsupported
at com.openai.errors.BadRequestException$Builder.build(BadRequestException.kt:87)
at com.openai.core.handlers.ErrorHandler$withErrorHandler$1.handle(ErrorHandler.kt:48)
at com.openai.services.blocking.audio.TranscriptionServiceImpl$WithRawResponseImpl$create$1.invoke(TranscriptionServiceImpl.kt:74)
at com.openai.services.blocking.audio.TranscriptionServiceImpl$WithRawResponseImpl$create$1.invoke(TranscriptionServiceImpl.kt:72)
at com.openai.core.http.HttpResponseForKt$parseable$1.parse(HttpResponseFor.kt:14)
at com.openai.services.blocking.audio.TranscriptionServiceImpl.create(TranscriptionServiceImpl.kt:41)
at com.openai.services.blocking.audio.TranscriptionService.create(TranscriptionService.kt:22)
at net.devemperor.dictate.core.DictateInputMethodService.lambda$startWhisperApiRequest$24$net-devemperor-dictate-core-DictateInputMethodService(DictateInputMethodService.java:792)

It’s really weird, because the same request with curl also works fine.

curl https://api.openai.com/v1/audio/transcriptions \                                                                     
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F file="@src.mp3" \
  -F model="gpt-4o-mini-transcribe" -F response_format="json"

Maybe you could take a look at the openai-java library, because the new transcription models don’t seem to work at all there.

1 Like

Hi,

Thank you very much; it appears to be resolved.
That works for me.
Best regards,

Julien

1 Like

Its not fixed for me. My code, works, if the model is “whisper-1” and I get an error if it is “gpt-4o-mini-transcribe”. Thats all I change.

Error code: 400 - {'error': {'message': 'Audio file might be corrupted or unsupported', 'type': 'invalid_request_error', 'param': 'file', 'code': 'invalid_value'}}

Not sure if that matters, but it happens on “openai==1.68.2” and “openai==1.68.1”

Happens with mp3 and webm.

Okay, I actually found what’s wrong. I did not have an mp3 file or a webm file. I had an ogg file from Telegram but I named it .mp3, and somehow the Whisper model can still transcribe it, even if the file format and the file name ending (mp3) do not mach. It seems like “gpt-4o-mini-transcribe” can not do that.

Or may be whisper supports ogg and gpt-4o-mini-transcribe does not.

1 Like

Hello, same issue happens with some WAV files.

Works with whisper-1:
req_f02d777a48c1f0e447706219eb7ce694

But doesn’t work with gpt-4o-transcribe:
req_16be933c7dfa04d91e47e0e357c59ecf

Thanks for mentioning this. Seems like this was the problem for me too, now it works great with the new models.

I’m also using springboot openai library on java, and I found this in lib sources

MultiValueMap<String, Object> multipartBody = new LinkedMultiValueMap<>();
		multipartBody.add("file", new ByteArrayResource(requestBody.file()) {

			@Override
			public String getFilename() {
				return "audio.webm"; <----------- file name extension worng
			}
		});
		multipartBody.add("model", requestBody.model());
		multipartBody.add("language", requestBody.language());
		multipartBody.add("prompt", requestBody.prompt());
		multipartBody.add("response_format", requestBody.responseFormat().getValue());
		multipartBody.add("temperature", requestBody.temperature());

But my inputstream is “wav” file. Can it be the issue?

Can you please look into my request?
req_6d02b398e398255afe892411e39d919d

The output is:
BadRequestError: Error code: 400 - {‘error’: {‘message’: ‘Audio file might be corrupted or unsupported’, ‘type’: ‘invalid_request_error’, ‘param’: ‘file’, ‘code’: ‘invalid_value’}}

Environment:
openai-1.50.2
WSL2 Ubuntu 22.04
file properties:
Container: MP3
Codec: libmp3lame, mono
Sample rate: 24 kHz
Bit-rate: 32 kb/s
Size: 16.4 MB

I used this command to convert the file:
ffmpeg -i clean.wav -ac 1 -ar 24000 -codec:a libmp3lame -b:a 32k clean.mp3

My code:
import openai
from openai import OpenAI
OPENAI_API_KEY = “the key is here”
client = OpenAI(api_key = OPENAI_API_KEY)
try:
with open(“clean.mp3”, “rb”) as f:
transcription = client.audio.transcriptions.create(
model=“gpt-4o-transcribe”,
file=f,
)
except openai.BadRequestError as e:
print(e.response.headers[“x-request-id”])

Thank you.

@itv Any updates? The problem keeps occurring.

If anyone else is still having this issue, double check you are using the right content-type - if your original file is, say, ogg and you are sending it as wav, it wont work (whisper doesnt seem to care but gpt-40- seems more “strict”)

Same issue here. My file starts ID3 and ext is .mp3. Works with a short file, fails with a longer one (1.5 hours phone call). Maybe mine is just too big for the new model. It’s a shame I was hoping for faster transcription, may need to use Google API for this.

Hey everyone, thanks for your continued reports and patience.

If you're seeing the "Audio file might be corrupted or unsupported" error with gpt-4o-transcribe or gpt-4o-mini-transcribe, here are some things to check:

  • Make sure the file’s format matches its extension and Content-Type header. For example, don’t rename an .ogg file to .mp3. It might work with whisper-1 but not GPT-4o models.
  • Use supported formats only: .mp3, .mp4, .mpeg, .mpga, .m4a, .wav, or .webm. Double-check that the encoding is valid (e.g. WebM files should use Opus).
  • If you're using Java or Spring Boot libraries, confirm that the file stream and filename match. Some libraries may hardcode the filename or content-type incorrectly.
  • If you're using audio/webm, try removing ;codecs=opus from the content-type header if you still hit issues.
  • Long files (e.g., over 1 hour) can sometimes lead to silent failures, so I'd recommend splitting them if possible.

If none of this works, please include the x-request-id from the response headers either here or in a message to support@openai.com so we can investigate further!

2 Likes

I still have the same issue. the mp3 file is perfectly fine

curl -v -X POST "https://api.openai.com/v1/audio/transcriptions" \
-H "Authorization: Bearer sk-proj-REDACTED" \
-H "Content-Type: multipart/form-data" \
-F "file=@/Users/pltc/Downloads/ff2ef4cf658f4379a85c3da78d62acc5.mp3" \
-F "model=gpt-4o-transcribe"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Host api.openai.com:443 was resolved.
......
* [HTTP/2] [1] OPENED stream for https://api.openai.com/v1/audio/transcriptions
* [HTTP/2] [1] [:method: POST]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: api.openai.com]
* [HTTP/2] [1] [:path: /v1/audio/transcriptions]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [authorization: Bearer sk-proj-REDACTED]
* [HTTP/2] [1] [content-length: 41386282]
* [HTTP/2] [1] [content-type: multipart/form-data; boundary=------------------------rlNbopMuvYQ6JY6fpIbdi6]
> POST /v1/audio/transcriptions HTTP/2
> Host: api.openai.com
...
< x-request-id: req_3c3f42a46939267be9907bbe6db230ab
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< cf-cache-status: DYNAMIC
< set-cookie: __cf_bm=U6JcuJvo9xiDZ6Q11aTVo8Ag4D5yjbuBDowUQ.zooOU-1750291575-1.0.1.1-WsqHmj5.DRVdXjP3r1Mk1rSXWj5VXkGg11TVCaAECBe2TktrfXft7wL_rS_I9vPLQJzR8lUzOEb__QIejEqZah8zllsGqbRY8YZ5HzRAdpU; path=/; expires=Thu, 19-Jun-25 00:36:15 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
< x-content-type-options: nosniff
< set-cookie: _cfuvid=iPQ5YWzoDnpI9t5mjY1RUp0vDr9b7pyDM19PWuSGCb0-1750291575474-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
< server: cloudflare
< cf-ray: 951ec740bb713087-SEA
< alt-svc: h3=":443"; ma=86400
< 
{
  "error": {
    "message": "Audio file might be corrupted or unsupported",
    "type": "invalid_request_error",
    "param": "file",
    "code": "invalid_value"
  }
* Connection #0 to host api.openai.com left intact

Thanks for sharing the detailed error output.

The error message "audio file might be corrupted or unsupported" from the gpt-4o-transcribe endpoint typically indicates that the file format, encoding, or headers might not fully meet what the model expects—even if the file plays without issues on your system.

A few things to try:

  1. Double-check encoding
    Ensure the file is using a standard encoding like mp3 with CBR (constant bitrate) and not VBR (variable bitrate), which can sometimes cause parsing issues.
  2. Use whisper-1 as a fallback
    Some users have found that whisper-1 handles edge cases more robustly. If your workflow allows, it's worth checking if the issue reproduces with that model.

If you’ve already tried these steps and the issue persists, feel free to share more about how the file was generated (e.g., recording software or export settings), and we can dig deeper.

Let us know how it goes!

1 Like