Failed to generate API key: permission denied?

This is pretty frustrating. How come there’s 0 documentation about this issue and 0 answers from google across 5 different threads asking exactly the same thing?

Google dropped the ball hard on this one.

Before you ask:
Yes, gemini API is enabled for all my projects. Yes, I’m the owner of all my projects. Yes, it’s available in my country.

Posting here for visibility as the AI Studio subforum offered no solutions.

2 Likes

Could you provide your email/Gaia ID and an approximate time when you experienced the issue?

I would rather not post my email on a public forum. It’s the same account that I’m using to post this thread. If you’re a google employee you must have access to what my email is.

I have been experiencing this issue non stop since always. If you’re looking for specific error logs tied to my account, you’ll see multiple errors daily from the beginning of April till today when I’ve been trying to create the API key.

Just bumping this for visibility. Still no answer or solution.

1 Like

Could you please check if you have allowed certain permissions in your GCP account?

  • Permissions required on GCP project:
    • apikeys.keys.create
    • resourcemanager.projects.update
    • serviceusage.services.enable

They essentially mean: can create api key in project, can update project, can enable services in project

1 Like

Where can i find these permissions - is there a link you could share?

Please check out the doc here: link.

Thanks.

Incredibly enough, I’ve had this problem for the past months and it just occured me to test the creation of API key with Brave Shields turned off… and it worked haha :rofl:

1 Like

Has there been any updates to this problem? I had no problem generating Gemini API keys a couple weeks ago and suddenly I get the “permission denied” message. I have changed nothing with regards to my permissions in my Google account. It was working fine and then it wasn’t. I cannot find anything other than a list of permissions to enable (which are) and there is no other help other than that.

Lmao, saw your comment
Tried this and it worked.