Keys / Google

GOOGLE_API_KEY

A Google Cloud API key. The Gemini API client libraries read it to call Gemini models.

Expires
the docs don't say
API
create, list and delete, with the Google Cloud API Keys API

Get it

Create one on aistudio.google.com/apikey. The steps aren't recorded yet.

Set it

GOOGLE_API_KEY=...

The Google Gen AI SDKs for Python, JavaScript, Go and Java read it from this variable when you don't pass a key. If GEMINI_API_KEY is also set, they use this one. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Open the key on the Cloud console's Credentials page and click Rotate key. The new key keeps the old key's restrictions. A key made in AI Studio doesn't, so add them yourself. keypin rotate copies the restrictions itself, using a service account with API Keys Admin; it refuses a key bound to a service account.
  2. Deploy it everywhere that uses the old key. Keep the old key until the new one works.
  3. Delete the old key. You can restore a deleted key within 30 days.
Sources, checked 2026-11-16