AQ. auth key returns ACCESS_TOKEN_TYPE_UNSUPPORTED via raw curl — issue #2391 still not fixed

Issue #2391 was closed as fixed, but I’m still seeing ACCESS_TOKEN_TYPE_UNSUPPORTED with a new AQ. auth key via raw curl (no SDK involved).

Curl command used:

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent" \
  -H "x-goog-api-key: [REDACTED]" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"contents":[{"parts":[{"text":"Hello"}]}]}'

Error response: ACCESS_TOKEN_TYPE_UNSUPPORTED

Account created June 2026. AIza keys are no longer generated for my account — only AQ. keys. Can you check if the generativelanguage.googleapis.com endpoint is enabled for auth keys on my account/project?

Did you link the API key with your GCP project? You can check the key that was created from the GCP console; by right, it should be granted with the Gemini API only. I cannot reproduce your issue; maybe it is related to your account?

The gemini-2.0-flash model has been deprecated and longer available via the API or AI studio. You should use 3.5 Flash or 3.1 Flash-Lite instead.

Project ID: [AZM PROJECT]

Account created: [“2026”]

Key type: Auth key (AQ. prefix) — this is the only type AI Studio will issue for new keys on this account; regenerating the key multiple times has not produced a Standard/AIza key.

What I’ve tried, all failing identically with the same error:

  1. client.models.generate_content(model="gemini-2.5-flash", contents="Hello") via the google-genai Python SDK
  2. client.interactions.create(model="gemini-3.5-flash", input="Hello") via the same SDK (the newer Interactions API)
  3. Confirmed pip install --upgrade google-genai to the latest SDK version before retesting
  4. Regenerated the API key 3 times — always issued as AQ. prefix, never AIza
  5. Confirmed via AI Studio that the Generative Language API is enabled on the project

Exact error (same reason code across all attempts):

401 UNAUTHENTICATED. {'error': {'code': 401, 'message': 'Request had invalid authentication
credentials. Expected OAuth 2 access token, login cookie or other valid authentication
credential.', 'status': 'UNAUTHENTICATED', 'details': [{'@type':
'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_TYPE_UNSUPPORTED',
'metadata': {'service': 'generativelanguage.googleapis.com'}}]}}

Environment: Python 3.12, google-genai SDK (latest as of July 2026), macOS.