OpenAI Transcribe an audio not working

Describe the problem/error/question

(I generated this with the N8N AI Assistant that helped me with my solution attempts.)

I am using the “@n8n/n8n-nodes-langchain.openAi” node (version 1.8) (aka OpenAI - Transcribe a Recording) in n8n version 1.88.0 to transcribe an audio file. The node is configured to use the “transcribe” operation with the binaryPropertyName set to “data”. The audio file I am working with has the extension .oga and the MIME type audio/ogg;codecs=opus.

The previous node in my workflow provides the following data for the file:

{
  "id": "fi_lnvZHSGLd9zkduCBxceKZ",
  "name": "6560cf73-5aff-4bdb-a1ca-2bfa6c7335de.ogg",
  "mime_type": "audio/ogg;codecs=opus",
  "link": {
    "url": "https://files.superchat.de?token=...",
    "valid_until": "2025-05-22T13:30:22.427883740Z"
  },
  "url": "/files/fi_lnvZHSGLd9zkduCBxceKZ"
}

When executing the OpenAI node, I receive the following error:

Bad request - please check your parameters - [{'type': 'value_error', 'loc': ('body', 'file'), 'msg': "Value error, Expected UploadFile, received: <class 'str'>", 'input': '...binary data...'}]

I have confirmed that the file is accessible and playable in n8n as a binary file, and the MIME type appears to be correct. The OpenAI credentials are set up and working.

What is the issue?

Please share your workflow

I am running N8N Cloud :slight_smile:

Hi @MangoMarkets,

Are you able to assign a name to the file? I feel like something is wrong with having a file without a name.

Hi @mohamed3nan, thanks for your answer. I thought that “data” is the name of the file. I believe I can change that in the previous get request as well.

@Grot also got back to me via DM saying that the whisper API doesn’t support .oga or .ogg which I was able to confirm. But I saw similar workflows using telegrams voice messages, which have the same format without converting to other filetypes.

I am now looking for a way to convert the .oga to .mpa in the cloud version.

Hi @MangoMarkets

Yes, that’s correct, “data” is the name of the “Input Data Field Name”

I just suspect the issue might be due to the file not having a “File Name”, regardless of whether its extension is supported by OpenAI or not.

I think it has a file name though?

I have confirmed with somebody else they send the files straight from telegram in the original format.

The best way to debug this quickly. Would be to test with another file and maybe even a different flow.

Like having the file in question uploaded to gdrive (ore any supported node) and to pass the downloaded binary to the open ai node.

I did that know with exactly the voice message in question. Unfortunately for me it works without issue. The filetype .ogg works even if the documentations says something else, but the file downloaded from drive has .ogg as file extension and audio/ogg instead of audio/ogg;codecs=opus but also a file name.

file that doesn’t work:

file that works:

Is there anything I can do with the get request downloading the file to make sure the binary arrives in n8n differently?

It seems there is no way to receive the file differently than with the wrong mime type. It seems Gdrive optimizes the file and takes the opus encoding out. Is there any way to do that in n8n? I have been looking at cloudconvert but it is not optimal. Are there any alternatives maybe even something else if it is on the hosted version instead?

mohamed3nan you were right. A code node with
"$input.item.binary.data.fileName = ‘myNewFilename.ogg’

return $input.item;"

Did the trick. I would have needed some more help with the code though for a faster solution. Thanks to both of you! @Grot

I’m having the same issue, I can’t work out how to fix from your description, do you think you could describe or put a screenshot of the fix please? Where did you put this: "$input.item.binary.data.fileName = ‘myNewFilename.ogg’

return $input.item;"’

Similar problem got working using the ‘Code’ node and javascript:

$input.item.binary.data.fileName = ‘openai-fm-nova-smooth-jazz-dj.mp3’;

return $input.item;

Can you show your flow and your binary file that you want to transcribe like I did above?

All good sorry I missed the Code node being required. Thanks so much for getting back to me.

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