Providers / Google Gemini API / AI Studio
AI APIs
Google Gemini API / AI Studio API keys and credentials
What every Google Gemini API / AI Studio credential a founder holds does, whether it expires, and what tends to break. Each fact links to Google Gemini API / AI Studio's own docs.
At a glance
| Credential | Expiry | Permissions |
|---|---|---|
| Standard Gemini API key | Not documented | Can be scoped |
| Auth key (service-account-bound Gemini API key) | Not documented | Can be scoped |
| Google account (AI Studio / Google Cloud login) | Not documented | – |
Each credential
Standard Gemini API key
- Not documented
- Can be scoped
Associates requests with a Google Cloud project for billing and quota, but does not identify the caller. Unrestricted standard keys are rejected by the Gemini API; keys with explicit restrictions still work. Restrict in AI Studio with 'Restrict to Gemini API only', or in Cloud Console (API restrictions and application restrictions such as IP). Restricting requires apikeys.keys.update. Rotation guidance: create a replacement, deploy it, disable the old key only after the new one is verified, then delete. Per the page, from May 7, 2026 the Gemini API blocks unrestricted keys that have been dormant for an extended period (shown with a Blocked tag). Expiry is not described on the page.
Google Gemini API / AI Studio docs
Auth key (service-account-bound Gemini API key)
- Not documented
- Can be scoped
Bound to a Google Cloud service account, so requests run under that identity. Restricted to the Generative Language API by default and supports fast-acting leaked-key enforcement. All new keys created in AI Studio on or after May 28, 2026 are auth keys. Requests with auth keys are not recorded in Google Cloud service account usage metrics. Expiry not described on the page.
Google Gemini API / AI Studio docs
Google account (AI Studio / Google Cloud login)
- Not documented
Keys are created in AI Studio under the Google account that owns the Cloud project.
Google Gemini API / AI Studio docs
What usually goes wrong
- Unrestricted standard key gets rejected after the May 2026 enforcement, breaking production traffic
- Restricting a key to Gemini-only breaks other Google APIs that share the key
- Dormant keys are blocked and show a 'Blocked' tag in AI Studio
- Keys in client-side code are exposed; standard keys identify no caller
- Old standard key deleted before the new auth key is verified
Renewals and billing
Usage is tracked on the AI Studio Usage page; requests that cannot be matched to a named key appear as '(unknown keys)'. Pricing and free tier terms not checked.
What Google Gemini API / AI Studio's docs don't say
We couldn't confirm these from official docs, so don't rely on them either way:
- Whether Gemini API keys expire at all, and any expiry setting
- Whether key expiry or metadata is readable via API
- Billing, pricing, and spend API details
- Google account session policy
Rotating or replacing a Google Gemini API / AI Studio key
The steps are the same for most providers: make the new key, deploy it everywhere the old one is used, check it works, then revoke the old one. Our guides walk through it:
Sources
Related providers
Keep track of every Google Gemini API / AI Studio key
StackHangar stores your Google Gemini API / AI Studio keys in an encrypted vault, grouped by the product they belong to, warns you before they expire, and walks you through rotating them. We can't read your secrets.