# Google Gemini setup for PopMCP

You paste one value into PopMCP: a Gemini API key created in Google AI Studio. Keys made since May 28, 2026 start with AQ., older ones with AIza, and both work.

- Auth: API credentials
- Setup time: 3 min
- API base URL: https://generativelanguage.googleapis.com/v1beta
- Credentials screen: https://aistudio.google.com/apikey
- Provider docs: https://ai.google.dev/gemini-api/docs/api-key

## Before you begin

- A Google account that can sign in to Google AI Studio and accept its terms of service
- A Google Cloud project for the key. New AI Studio users get a default project made for them; if you already use Google Cloud, AI Studio does not create one, so you import a project first
- Permission to create API keys on that project, such as the Editor role (it includes apikeys.keys.create and iam.serviceAccountApiKeyBindings.create)
- Billing linked to the project only if you want image generation, Veo video, Pro models or the Batch API. Creating the key is free

## Get your credentials

### 1. Open the API keys page in Google AI Studio

Sign in at aistudio.google.com with your Google account and accept the terms if asked. Open Dashboard in the left panel and choose API keys, or go straight to the API keys link below.

Screen: https://aistudio.google.com/apikey

### 2. Import your Cloud project, if you already use Google Cloud

New AI Studio users already have a default project and can skip this step. Otherwise open Dashboard → Projects, click Import projects, search for the project by name or ID, select it and click Import.

### 3. Create the API key

Back on API keys, click Create API key. Give the key a name such as `PopMCP`, choose the project it should belong to, confirm, and copy the new key. If Create API key is unavailable, you lack permission to create keys on that project: ask an admin for the Editor role, or use a project that is not tied to an organisation.

Screen: https://aistudio.google.com/apikey

### 4. Set up billing if you need images, video or Pro models

Optional. A free-tier key covers the Flash text models, embeddings and File Search. For image generation, Veo video, Pro models and the Batch API, click Set up billing in the Billing Tier column next to the project, pick or add a Cloud Billing account, and prepay at least $5, or choose a postpay plan if you are offered one.

Screen: https://aistudio.google.com/apikey

### 5. Paste the key into PopMCP

In PopMCP, paste the key into Gemini API key and save. PopMCP lists the models the key can use and runs a free token count to check it, so nothing is billed.

## Fields PopMCP asks for

- Gemini API key (apiKey) [required]: Open Google AI Studio (aistudio.google.com/apikey), click Create API key, and copy it. Creating a key is free; image, video and Pro models need billing enabled on its project. Stored encrypted and used server-side only.

## Verify

PopMCP shows the connection as Connected, labelled Gemini API key followed by the key's last four characters. Ask the AI to list the models the key can use; on a free-tier key, image and Veo models only start working once billing is set up.

## Troubleshooting

### "Google says this API key is not valid" or "Google did not accept this key"

Cause: Part of the key was missed when copying, or the key was deleted. A bad AIza key answers 400 API_KEY_INVALID and a bad AQ. key answers 401.

Fix: Copy the whole key again from the API keys page in AI Studio, or create a new one, and paste only the key with no quotes or spaces.

### "Google blocks this key for the Gemini API" (API_KEY_SERVICE_BLOCKED)

Cause: It is an older AIza key with no API restrictions. The Gemini API rejects unrestricted standard keys.

Fix: Restrict it with Add restrictions → Restrict to Gemini API only on the API keys page, or create a new key in AI Studio.

### "The Gemini API (Generative Language API) is not enabled for this key's Google Cloud project"

Cause: The key was made in the Google Cloud console on a project where the Generative Language API is off.

Fix: Enable the Generative Language API on that project, or create the key in Google AI Studio, which turns it on for you.

### "Google does not offer the Gemini API free tier in this region"

Cause: The free tier is not available where the project is used, so Google answers FAILED_PRECONDITION.

Fix: Click Set up billing for the project in AI Studio, then connect again.

### Image, Veo or Pro model calls fail with 403 or 429 while text works

Cause: The key's project is on the free tier, which does not cover those models.

Fix: Set up billing for the project in AI Studio. The key stays the same, so there is nothing to change in PopMCP.

### 429 RESOURCE_EXHAUSTED during a busy run

Cause: A requests-per-minute, tokens-per-minute or requests-per-day limit ran out. Limits are per project, so every key in the project shares them, and a spend cap over a rolling 10 minutes can apply on paid tiers.

Fix: Wait and retry; daily counts reset at midnight Pacific time. Check AI Studio's rate limit page for the project's current limits, and link billing to move up a tier.

### "This project's prepaid Gemini credits are used up"

Cause: The project is on prepaid billing and its balance reached zero.

Fix: Add credit on the AI Studio Billing page, then retry.

---

Source: https://www.docs.popmcp.com/docs/integrations/google-gemini/