Gemini API credentials (correct) are not recognized

I have been trying to connect the Gemini API and keep getting the same error saying “Couldn’t connect with these settings

Authorization failed - please check your credentials“

Please help if anyone ran into the same problem and managed to solve it. API keys have been generated in cloud and all restrictions (set to Vertex AI only) set as requested.

What if you click on that “More details”?

Hi there,

From the error, it looks like there could be an issue with the exact api key. Can you regenerate one from https://aistudio.google.com/apikey and try again?

Make sure to paste the same api key without any modification.

Cheers!

thanks, I used several api keys from various projects and various accounts, brand new ones, and same effect… I am super frustrated.

“Authorization failed - please check your credentials“

When you say in the cloud, what do you mean? Where exactly in the cloud?

google cloud console, tried api keys from several accounts, same result each time.

Have you tried the key from aistudio?

Create one here and use that:
https://aistudio.google.com/app/apikey

1 Like

this is exactly where I have been generating keys

taking my words back. Google is super confusing, I have been working in Vertex AI Studio , and totally missed that there is a separate Google AI Studio… Thank you @jabbson

1 Like

Feel free to mark any helpful answer as solution here and good luck.

Cheers

Thank you!

Thank you! Looking back, your suggestion was correct. I was trying to use the keys from Vertex AI Studio and was completely oblivious that there is a Google AI Studio…

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