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.

I’m still having the same problem today in 2025:

  1. I use curl to start upload a file and then use the uploadUri to upload file successfully all by curl.
  2. then I use openAPI to generate swift code to mimic the process again. Now I got the uploadUrl which include my key correctly, however the second request using uploadUri got a 403 response with non-existing project id.

Not to mention the curl commands in Gemini Document have lots of minor errors ( I doubt no one verify by running test at lease once), this weird response really waste my development time.

I tried this approach but still got the 403 with an nonexisting project id. I even change my api key into paid plan, but no help. This clueless issue really block my schedule now.

Anyone can help?