OpenAI Whisper- Send Bytes (python) instead of filename


I hope you’re well. Really enjoying using the OpenAI api, recently had some challenges and was looking for some help.

I don’t want to save audio to disk and delete it with a background task.

My FastAPI application uses a an UploadFile (meaning users upload the file, and I then have access a SpooledTemporaryFile).

Previously using the free version of Whisper on Github, I was able to send the bytes to the model, whereas this API isn’t working this way.

Can anyone else advise on how they are transcribing audio in python without saving videos/audio to disk?


Hi, I am using the openai-whisper from github in my django app and I am sending bytes just like you but it is not working.

Can you please share your code?