Can't do Telegram speech to text with Gemini

Hey, I’m trying to transform an audio file from telegram into a text by using Gemini. But I see that almost everyone is using the OpenAi node to do it.
ANy help or suggestion would be appreciated thanks.

Describe the problem/error/question

Since there isn’t a specific node to do this with Gemini, I tried to call the API directly with a HTTP request but I can’t make it work. It maybe is because of the format of the file but I’m not sure.

What is the error message (if any)?

Bad request - please check your parameters

  • GenerateContentRequest.contents: contents is not specified

Please share your workflow

Share the output returned by the last node

The output is the error

Information on your n8n setup

  • n8n version: 1.84.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): 8n cloud
  • Operating system: W11

The Gemini API requires a few more steps before transcribing the audio.
I was able to make it work like this. Try it and let me know if this solves your problem.

.

By the way, I see that you still don’t have a Google Gemini credential configured. Take a look at how I use the credential on my HTTP node and try to do the same. It’s safer to use credentials than it is to write the key in the workflow.

Your simply the goat man thank you very much

Thank you so much! This is absolutely incredible. I have been looking for an open AI alternative and it is an absolute god send to find this here.

The n8n comunity is great!