generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

404 Not Found for generateContent despite exhaustive debugging (Server-Side Issue)

Open atharvrana77811 opened this issue 4 months ago • 0 comments

Description of the bug:

Hello,

I am experiencing a persistent 404 Not Found error when trying to use the generateContent method with both gemini-1.0-pro and gemini-pro models. My region is India.

When I run genai.list_models(), the output correctly shows that I have access to these models.

However, any script that calls model.generate_content() or chat.send_message() fails with this error: 404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent.

I have performed exhaustive troubleshooting, including:

A full, clean reinstallation of the google-generativeai library using pip cache purge.

Verifying the environment variable is set and read correctly.

Generating a brand new API key within a brand new Google Cloud project.

Triple-checking the Python code for any typos.

The issue persists across all attempts. This proves the issue is server-side and specific to my account/region, where requests are being incorrectly routed to the v1beta API.

Thank you for your help.

Image

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

atharvrana77811 avatar Sep 06 '25 17:09 atharvrana77811