Persistent 404 Not Found error with Gemini API despite new projects and keys

Hello, I am trying to use the Gemini API with Python but keep getting a 404 Not Found error.

I am getting the following error: 404 Client Error: Not Found for url: https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent?key=MY_API_KEY

Here is what I have already tried:

  • Using multiple models like 'gemini-pro', 'gemini-1.5-flash', and 'gemini-1.0-pro'.

  • Creating completely new Google Cloud projects.

  • Generating multiple new API keys.

  • Confirming that the "Gemini API" is enabled in my project.

  • Confirming that a billing account is linked to my project.

  • Bypassing the Python library and calling the API directly with 'requests', which gives the same 404 error.

  • Trying on different networks (including mobile hotspot).

  • API Status: I have confirmed in the Google Cloud Console that the Gemini API is “Enabled” for my project. The button shows “Manage”.

  • Account Type: I am using a personal @gmail.com account, not a university or corporate managed account.

Even with a brand new project and key, the 404 error persists. I suspect this might be an account-level or regional restriction.

Is there anything else I can check? Thank you.

Can you please try one of the active Gemini models on this list: https://ai.google.dev/gemini-api/docs/models?