Why am I getting a Bad Request? Multipart request to whisper API

Hi!
I’m hitting the whisper API at https://api.openai.com/v1/audio/transcriptions and getting a 400 error. I’m making a multipart request with binary of the file and getting a very brief error with no explanation.

{
  "error": {
    "message": "",
    "type": "server_error",
    "param": null,
    "code": null
  }
}

This is the multipart request:

--boundary12345
Content-Disposition: form-data; name="model"

whisper-1
--boundary12345
Content-Disposition: form-data; name="file";
Content-Type: video/mp4

@{body('Get_file_content')}
--boundary12345--

Any ideas? Thank you! :grinning:

Welcome to the community!

MP4 is on the accepted list…

https://help.openai.com/en/articles/7031512-whisper-audio-api-faq

Do other files work okay? Can you try an MP3 or wav maybe?

That is an odd error without a code…

1 Like

Hi and thanks for the welcome!
Same thing with mp3. The file is less than 10 mb as well.

I’m using Power Automate, so it’s no code. However, the multipart form snippet I sent is what I’m POST-ing. Even if I omit the binary of the file, I still expect a more verbose error or even 200 range.

Welcome @bb-devs

The Error: 400, aka a Bad Request error, indicates that the server could not understand the request due to invalid syntax.

This means that something about the request you’re sending is improperly formatted or contains incorrect data. This could be due to issues such as invalid headers, incorrect file types, misconfigured form-data, or missing required parameters.

Starting with this, I believe the correct type would be audio/mp4

1 Like

Thank you for the response @sps !

Changing the Content-Type did not seem to work. I might try creating a script/small service to handle this since using Power Automate doesn’t leave me with much leverage.