Whisper API 'Validation Error' (using Power Automate)

Built a flow as follows:

Getting error upon testing:

1 validation error for Request
body → file
Expected UploadFile, received: <class ‘str’> (type=value_error)

Any idea what this means and how to resolve?

Edit: API Keys in screenshot is revoked for purpose of this post, in case anyone’s wondering. Too lazy to scribble in paint and redact the keys.

You have quite the mishmash of stuff put in the wrong areas of that dialog. Whew!

Have a look at the API Reference linked on the left of the forum. It shows us the format using the curl application.

curl https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F file="@/path/to/file/audio.mp3" \
  -F model="whisper-1"

-F instead of -d is the curl parameter for multipart form data. You can see how http POST is actually created with the binary data of the file object in curl documentation.

Try talking to an AI language model first using that HTTP form. If successful, then you can contemplate if that form will allow you to place a file in the request properly.

Thanks @_j for the reference doc :pray:t2: Helped me realised needed to learn proper structuring of multipart/form-data parameters. Nevertheless, one learning led to another, I ended up creating my own custom connector for API calling (so I can leverage it for other uses).

Proof-of-concept done for successful transcribing, now on my way to creating prototype for a ‘Meeting Minutes Generator’ app.

@rahimin.abdulamin I am also stuck with consuming whisper from Power Automate. I was successful in creating the custom connector to access whisper from Power Apps, however while consuming the same connector from Power Automate, getting various errors. Can you please show how you have consumed the connector from Power Automate.