ModelHubby

← All guides · provider record →

Google AI Studio (Gemini API) — free tier setup

What you get free

A permanent free tier on the Gemini API with per-model limits. Per the catalog: "Gemini 2.5 Flash: 250,000 tokens/minute, 20 requests/day, 5 requests/minute; Gemini 3.1 Flash-Lite: 250,000 tokens/minute, 500 requests/day, 15 requests/minute; Gemma 3 27B Instruct: 15,000 tokens/minute, 14,400 requests/day, 30 requests/minute (per model)."

The gotcha that matters most: on the free tier, Google trains on your prompts. The official terms state: "Google uses the content you submit to the Services and any generated responses to provide, improve, and develop Google products and services" and "Human reviewers may read, annotate, and process your API input and output." Google's own warning: "Do not submit sensitive, confidential, or personal information to the Unpaid Services." Exception — if you are in the EEA, Switzerland, or the UK, the paid-tier data terms (no training on prompts) apply "even though they are offered free of charge." Treat the free tier as unsuitable for confidential or client data outside those regions.

Friction check

Credit card no
Phone verification unknown
Org/membership no (any Google account)
Est. time to first key ~5m (3 steps)
Trains on your prompts yes (free tier, outside EEA/UK/CH — see above)

Get a key

  1. Sign in with a Google account and go to aistudio.google.com/apikey.
  2. Accept the Terms of Service — new users get an automatically generated default Google Cloud project and API key.
  3. Otherwise, click "Create API key". New keys are automatically created as "auth keys." Copy the key.
  4. Note the regional caveat: repo sources conflict on whether the free tier is available at all in EU/UK/Switzerland — treat availability there as unknown.

First request

Use the OpenAI-compatible base URL from the catalog. Expected success shape: a JSON chat.completion object with choices[0].message.content.

export GEMINI_API_KEY="YOUR_KEY"
curl https://generativelanguage.googleapis.com/v1beta/openai/chat/completions \
  -H "Authorization: Bearer $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "messages": [{"role": "user", "content": "ping"}],
    "max_tokens": 16
  }'

(Native endpoint also available: https://generativelanguage.googleapis.com/v1beta. If both GEMINI_API_KEY and GOOGLE_API_KEY are set, Google's client libraries prefer GOOGLE_API_KEY.)

Limits that will bite you

  • gemini-2.5-flash and gemini-3.5-flash: 5 RPM, 20 RPD, 250K TPM — 20 requests/day exhausts in minutes of interactive use; route bulk work to Gemma.
  • gemma-3-27b-it: 30 RPM, 14,400 RPD, 15K TPM — the workhorse quota on this tier.
  • gemini-2.5-flash-lite is deprecated for new users — catalog probe 2026-07-17 returned 404 "no longer available to new users" on the OpenAI-compat endpoint.
  • "Rate limits are applied per project, not per API key" — extra keys in one project add nothing.
  • Google's official rate-limits page no longer publishes free-tier numbers ("can be viewed in Google AI Studio"); the figures above are repo-sourced and may drift. Check your actual limits in AI Studio.

Key rotation runbook

  • Second key: create additional API keys at aistudio.google.com/apikey; up to 10 projects can be created, and since limits are per project, meaningful rotation means one key per separate project, not per key.
  • Revoke: delete the key on the same API Keys page (exact control label unconfirmed — verify on first signup). Unrestricted "standard" keys are being deprecated (September 2026); prefer restricted/auth keys.
  • ModelHubby integration: export GEMINI_API_KEY_2="..." — the key pool picks it up automatically; state machine cools down rate-limited keys per-key.

ModelHubby usage

pnpm mh show google-ai-studio
pnpm mh probe --live --provider google-ai-studio --apply