I am testing a script to convert audio to text. However, while calling the API I am getting an error.
Here is the path I am using
'https://api.openai.com/v1/audio/transcriptions?engine=whisper-1';
And the error I am getting is
"error": {
"message": "you must provide a model parameter",
"type": "invalid_request_error",
"param": null,
"code": null
}
I have tried model=whisper-1
and model=davinci-002
, both of them are raising the same error. Is there anything that I am missing?
Take a look at the official OpenAI documentation.
If you want to use the Whisper API, note the following:
https://api.openai.com/v1/audio/transcriptions
file
model
Try this:
fetch('https://api.openai.com/v1/audio/transcriptions', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk-xxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'multipart/form-data',
},
body: {
file: 'YOUR_AUDIO_FILE.mp3',
model: 'whisper-1',
}
});