# Gemini API 401 ACCESS\_TOKEN\_TYPE\_UNSUPPORTED with AI Studio AQ authorization key

**URL:** <https://discuss.ai.google.dev/t/gemini-api-401-access-token-type-unsupported-with-ai-studio-aq-authorization-key/197473>\
**Category:** Gemini API\
**Tags:** gemini-api, ai-studio, api, bug, api-key\
**Created:** [November 2, 2026, 4:08am UTC](https://discuss.ai.google.dev/t/gemini-api-401-access-token-type-unsupported-with-ai-studio-aq-authorization-key/197473 "2026-11-02T04:08:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hasan\_Shurrab](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/hasan_shurrab/32/164433_2.png) [@Hasan\_Shurrab](https://discuss.ai.google.dev/u/Hasan_Shurrab)\
**Post date:** [November 2, 2026, 4:08am UTC](https://discuss.ai.google.dev/t/gemini-api-401-access-token-type-unsupported-with-ai-studio-aq-authorization-key/197473/1 "2026-11-02T04:08:45Z")

</div>

Hello Google Gemini API Support,

I am experiencing an authentication problem with my Google AI Studio Paid Tier 1 project.

My AI Studio project has:

- An active GEMINI\_API\_KEY secret.
- An enabled Generative Language API.
- Paid Tier 1 billing.
- An automatically provisioned AQ-format authorization key.

When calling the Gemini Developer API using the official [@google](https://discuss.ai.google.dev/groups/google)/genai SDK, version 2.32.0, the request fails.

Endpoint: [generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent](http://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent)

HTTP response: 401 UNAUTHENTICATED

Error: ACCESS\_TOKEN\_TYPE\_UNSUPPORTED

Message: API key not valid. Please pass a valid API key.

I reproduced the same error with an isolated direct API request, outside my application, confirming that this is not caused by my application’s PDF upload code.

The Generative Language API is already enabled, and the key is supplied through the documented GEMINI\_API\_KEY environment variable.

Could you investigate whether my authorization key or its associated service account/project has an authentication or provisioning problem?

I can provide my Google Cloud project ID and sanitized request details privately if required.

Thank you.

---

<div class="post-metadata">

**Author:** ![Pooja\_Kapse](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/pooja_kapse/32/24754_2.png) [@Pooja\_Kapse](https://discuss.ai.google.dev/u/Pooja_Kapse)\
**Post date:** [November 2, 2026, 10:50am UTC](https://discuss.ai.google.dev/t/gemini-api-401-access-token-type-unsupported-with-ai-studio-aq-authorization-key/197473/2 "2026-11-02T10:50:16Z")

</div>

Hello @Hasan_Shurrab ,

`AQ.`-prefix API keys created in [Google AI Studio](https://aistudio.google.com/app/apikey) work directly with the Gemini Developer API via the `x-goog-api-key` header and official SDKs with no additional setup required.

Please test a single request with a newly copied key pasted inline (rather than read from an environment variable) against gemini-3.8-flash:

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

---

<div class="post-metadata">

**Author:** ![Hasan\_Shurrab](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/hasan_shurrab/32/164433_2.png) [@Hasan\_Shurrab](https://discuss.ai.google.dev/u/Hasan_Shurrab)\
**Post date:** [November 2, 2026, 1:55pm UTC](https://discuss.ai.google.dev/t/gemini-api-401-access-token-type-unsupported-with-ai-studio-aq-authorization-key/197473/3 "2026-11-02T13:55:48Z")

</div>

I will try that see if it works
