Current (2023-03-01) OpenAI Whisper API expects a file uploaded as part of multipart/form-data
in POST request.
I initially struggled to use this API inside Node.js with an audio file stored inside an AWS s3 bucket, so I decided to share this snippet:
The API usage example from the OpenAI docs:
curl --request POST \
--url https://api.openai.com/v1/audio/transcriptions \
--header 'Authorization: Bearer TOKEN' \
--header 'Content-Type: multipart/form-data' \