Gemini API: models.get returns 200, but generateContent returns 404

Hello,

I am experiencing an issue with the Gemini Developer API.

Environment:

  • Model: gemini-2.5-flash-lite

  • API version: v1beta

  • Python: 3.13.14

  • Google GenAI SDK: 2.34.0

  • Authentication: GEMINI_API_KEY

  • Vertex AI: disabled

Issue:

  • models.get returns HTTP 200 OK.

  • The model’s supported_actions includes generateContent.

  • models.generate_content returns HTTP 404.

The generation request contains only a simple text prompt. The model name, endpoint, request body, and SDK configuration were checked locally and appear correct.

Both operations use the GEMINI_API_KEY environment variable.

Could you please investigate whether there is a model availability, project access, or server-side routing issue?

Thank you for your assistance.

Hi,

The request you are making is most likely fine.
models.get just reads out the public model catalog, so it returns 200 and lists generateContent for any valid key

For some reason access to the 2.5 models is limited to projects that have used them before. Google’s Deprecations page in the AI Studio docs describes this.
So on a new project or a new key you will get a 404 error when trying to call generateContent with gemini-2.5-flash-lite, even if the model itself is not deprecated.

Google staff gave this same answer in two similar threads here in the last week or so (197464 and 197853)

The fix for this is to change the model name you are using to either gemini-3.5-flash-lite (the lite tier, so likely the closest) or gemini-3.8-flash
Only the model name should need to change, though check the output and pricing

Google staff say failed 4xx requests are not billed