Hello,
I am experiencing a persistent authentication issue with a newly created Gemini API Auth key.
The key was created in Google AI Studio and uses the new AQ. format. I am not sharing the API key or any sensitive project identifiers.
Google Cloud configuration verified
- Gemini API (
generativelanguage.googleapis.com) is enabled. - The API key is active.
- The key is restricted to Gemini API.
- The key has a bound service account (
ais-gemini-key-...). - The bound service account is enabled.
- Google Cloud recognizes the credential and shows Gemini API traffic.
- Google AI Studio / Gemini API status reports all systems operational.
- MFA is enabled on the Google account.
Environment
- Node.js
@google/genaiversion2.23.0- Client initialized with:
new GoogleGenAI({ apiKey })
Tests performed
I reproduced the issue independently in two ways.
1. Direct REST request
A request to:
https://generativelanguage.googleapis.com/v1beta/models
using the documented x-goog-api-key header returns:
HTTP 401
UNAUTHENTICATED
2. Official Google SDK
I performed a minimal request using the official @google/genai SDK with the same key.
The request reaches Google but returns:
HTTP 401
UNAUTHENTICATED
ACCESS_TOKEN_TYPE_UNSUPPORTED
The essential error message indicates that the request has invalid authentication credentials and expects an OAuth 2 access token, login cookie, or other valid authentication credential.
The same authentication failure occurs in the application that originally exposed the issue.
Because the error is reproducible both with a direct REST request and with the official Google SDK, it does not appear to be specific to the application implementation.
I also found several recent reports in this forum describing the same 401 / ACCESS_TOKEN_TYPE_UNSUPPORTED behavior with new AQ. keys.
Question
Should a new AQ. Auth key bound to the automatically created AI Studio service account work directly with the Gemini Developer API using x-goog-api-key and new GoogleGenAI({ apiKey }), or is any additional authentication/configuration currently required?
If this configuration should already work, could this indicate an issue with the new Auth key authentication/binding?
I can provide a minimal reproducible request or cURL example if needed. I will not share the API key publicly.
Thank you.