An error occurred: 403 Generative Language API has not been used in project ends with 4965 before or it is disabled

I recently got this error and I don’t have any GC projects ending with ends with 4965.

If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [links {
  description: "Google developers console API activation"
  url: "https://console.developers.google.com/apis/api/generativelanguage.googleapis.com/overview?project=end with 4965"
}
, reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
  key: "service"
  value: "generativelanguage.googleapis.com"
}
metadata {
  key: "consumer"
  value: "projects/end with 4965"
}

Hello! Welcome to the forums.

From what I’m seeing here, you’re receiving an error because of the project “end with 4965”. However I wouldn’t believe this is an actual project.
What I’d recommend is disable the Generative Language module in your Google Cloud, then re-enable the module via AI Studio in the “Get API Key” tab. From there it’ll automatically set up your project for you and your API key.

Furthermore, you should probably be using a URL like this to get the generative language models:
https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-002:generateContent?key=YourAPIKeyFromAIStudio

Thanks!
Hat

This is not acceptable from a google API.
I’m facing the same problem - API throws error that “service disabled” for a project with id which has nothing to do with any of my projects. And the issue is that the same API key was used for a month without error. Clearly google broke something during service update.

This API (un)reliability just doesn’t allow to build a product on top of Gemini.