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' \
--form file=@/path/to/file/openai.mp3 \
--form model=whisper-1
See the Node.js + AWS S3 example below:
good, thanks. Love it.