Hello Google AI team and community,
I’m integrating the Gemini API into my application, Uploadify, using the official @google/genai SDK (version 2.28.0).
I’m consistently receiving this error when attempting to list available models and generate content:
401 UNAUTHENTICATED: ACCESS_TOKEN_TYPE_UNSUPPORTED
What I’ve checked:
-
Gemini API is enabled in my Google Cloud project.
-
The API key appears in both Google AI Studio and Google Cloud Credentials.
-
The key is bound to a service account as required by the console.
-
The key’s API restriction is set to Gemini API.
-
The configured model is
gemini-3.5-flash-lite. -
The same error occurs with the official SDK and direct REST requests using the
x-goog-api-keyheader. -
I also tested a non-sensitive JPEG image for multimodal generation, but it returned the same error.
Environment:
-
SDK:
@google/genaiv2.28.0 -
API: Gemini API
-
Billing tier shown in AI Studio: Free tier
-
Error:
ACCESS_TOKEN_TYPE_UNSUPPORTED
Could you clarify whether this is an issue with service-account-bound API key authentication, key provisioning, or another configuration requirement? What steps should I take to resolve it?
Thank you.