Title: Auth key can list models, but generateContent returns HTTP 404 NOT_FOUND for gemini-2.5-flash
Hello,
I am encountering a reproducible HTTP 404 NOT_FOUND response when calling the Gemini GenerateContent API with a newly created Google AI Studio authorization key.
Environment:
-
Date tested: August 29, 2026
-
Client OS: Windows 10
-
Python: 3.14.7
-
Google Gen AI SDK: google-genai 2.20.0
-
Model: gemini-2.5-flash
-
API: Gemini Developer API / Generative Language API
-
Key type: Fresh authorization key created in Google AI Studio
-
Generative Language API: Enabled
-
Vertex AI environment configuration: Not enabled
-
HTTP proxy environment configuration: Not present
Successful verification:
-
GET /v1beta/models returned HTTP 200.
-
53 models were returned.
-
gemini-2.5-flash was present.
-
The model advertised support for generateContent.
Failing verification:
-
POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
-
Authentication header: x-goog-api-key
-
Content-Type: application/json
-
Request contained a short, non-sensitive text input.
-
The request included store=false at the request root.
-
Result: HTTP 404
-
Parsed Google error status: NOT_FOUND
-
The response did not provide an ErrorInfo reason that could be safely classified.
The same operation through google-genai 2.20.0 also returned HTTP 404 with ClientError. A direct REST request reproduced the result, so the failure does not appear to be limited to the SDK.
Credential handling was independently verified: the same authorization key successfully completed Models List immediately before the GenerateContent tests. The key, request body, response body, project identifier, service-account identifier, and raw error message have not been disclosed publicly.
Could you please clarify:
-
Whether authorization keys currently support the v1beta models.generateContent endpoint for gemini-2.5-flash.
-
Why Models List succeeds while GenerateContent returns NOT_FOUND for the same key and project.
-
Whether an additional IAM role is required for the service account bound to an authorization key.
-
Whether authorization-key users must use a different endpoint or API operation.
-
Whether this is a known issue with the current authorization-key rollout.
I can provide the project identifier and additional request metadata through a secure, non-public support channel if required.
Thank you.