OpenAI Whisper problem

hello, I can’t turn an audio into text with Whisper. can you help me?

error:
{“status”:“rejected”,“reason”:{“message”:“400 - "{\n \"error\": {\n \"message\": \"1 validation error for Request\\nbody → file\\n Expected UploadFile, received: <class ‘str’> (type=value_error)\",\n \"type\": \"invalid_request_error\",\n \"param\": null,\n \"code\": null\n }\n}"”,“name”:“Error”,“stack”:“Error: 400 - "{\n \"error\": {\n \"message\": \"1 validation error for Request\\nbody → file\\n Expected UploadFile, received: <class ‘str’> (type=value_error)\",\n \"type\": \"invalid_request_error\",\n \"param\": null,\n \"code\": null\n }\n}"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”}}

hi @laschuk
a couple of suggestions on how to make it work.

  • First, you don’t have to pass the URL of the file, but the file itself (as binary data). So you need an HTTP request that retrieves the audio file and sends it to the next node
  • Then, in the second HTTP request node, you send that file by referencing the field name (“file” in my example), and be sure to select the Parameter Type “n8n Binary Data”.
    You can find a full example here:

Hope it helps :slight_smile:
Let me know if it works and you need more assistance

Best

2 Likes

@laschuk did this get resolved? Zapier are having issues with calling Whisper-1 also and I am looking for an alternative. But I don’t want to commit to N8N unless it can do this properly & the support is good. it forces a credit card on the free trial which is pants.

hi @cooper,
the solution I proposed should be working, but let’s wait for @laschuk to confirm it!

If you want to avoid adding your credit card, you can install the self-hosted version of n8n by following these guidelines:

Let me know if I can support you in any other way
Best

This works perfectly, thanks for your help!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.