# Not Able to use api key starting with AQ

**URL:** <https://discuss.ai.google.dev/t/not-able-to-use-api-key-starting-with-aq/174115>\
**Category:** Gemini API\
**Tags:** help\_request\
**Created:** [July 8, 2026, 8:21pm UTC](https://discuss.ai.google.dev/t/not-able-to-use-api-key-starting-with-aq/174115 "2026-07-08T20:21:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azeem\_Nazim](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/azeem_nazim/32/31627_2.png) [@Azeem\_Nazim](https://discuss.ai.google.dev/u/Azeem_Nazim)\
**Post date:** [July 8, 2026, 8:21pm UTC](https://discuss.ai.google.dev/t/not-able-to-use-api-key-starting-with-aq/174115/1 "2026-07-08T20:21:34Z")

</div>

**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):**

```auto
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.

---

<div class="post-metadata">

**Author:** ![Mustan\_lokhand](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/mustan_lokhand/32/86726_2.png) [@Mustan\_lokhand](https://discuss.ai.google.dev/u/Mustan_lokhand)\
**Post date:** [July 8, 2026, 10:44pm UTC](https://discuss.ai.google.dev/t/not-able-to-use-api-key-starting-with-aq/174115/2 "2026-07-08T22:44:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/system/32/1_2.png) [@system](https://discuss.ai.google.dev/u/system)\
**Post date:** [November 5, 2026, 6:43pm UTC](https://discuss.ai.google.dev/t/not-able-to-use-api-key-starting-with-aq/174115/3 "2026-11-05T18:43:15Z")

</div>

Closed on November 5, 2026, 6:43pm UTC

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.
