AQ key 401 ACCESS_TOKEN_TYPE_UNSUPPORTED: Flutter fix

Standard Gemini "traffic" keys are retired after the Truffle privilege-escalation find, and AI Studio now issues only service-account-bound AQ. auth keys. Here is the 5-step Flutter migration — including why most 401s are not a broken key format at all.

Your AQ key 401 ACCESS_TOKEN_TYPE_UNSUPPORTED is almost certainly not Google shipping broken keys. That is the contrarian truth hiding in every one of the half-dozen forum threads about it: Google's own engineers state the AQ. format is fully supported by the Gemini API, official SDKs, and REST endpoints — and independent community tests confirm that a valid Gemini-bound AQ. key returns HTTP 200 through x-goog-api-key , ?key= , and the SDK alike. The 401 means something else: your key is truncated, unlinked, restricted to the wrong service, or being sent as an Authorization: Bearer token. Underneath the error sits a bigger shift — standard AIza "traffic" keys are being retired after Truffle Security's privilege-escalation finding, and AI Studio now issues only service-account-bound auth keys. So the fix is a migration, not a retry: this guide walks it in five steps with working Dart. What you'll learn What ACCESS_TOKEN_TYPE_UNSUPPORTED actually means (and the four causes behind it) The standard-key retirement timeline — why you cannot "just regenerate the old kind" The 5-step migration: new auth key → restrictions → server-side storage → proxy/AI Logic → verify Correct header usage: x-goog-api-key vs ?key= vs Authorization: Bearer (with a decision table) The Flutter-safe architecture that keeps keys out of your app bundle forever How to verify the new key with one curl command and handle 401s gracefully in Dart 🎬 Watch: AI Studio's 2026-changed API key creation and the "Failed to generate API key — the request is suspicious" error, plus the Google Cloud project fallback method. Key creation changed under everyone in 2026 — watch where the new auth-key flow lives in AI Studio before you touch your Flutter config. Data unavailable ⏱ Data unavailable ·…

Explore