Not Able to use api key starting with AQ

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.

Hi

To help me with debugging this issue

  1. Have you tested this out using a curl request ? if not can you try making a call using curl ?
  2. if you can share your project ID with me via DM