aifree.dev

How to Get a Free Gemini API Key

Create a free Gemini API key in Google AI Studio: which models are free, how rate limits work, and why free-tier prompts may be used by Google.

Time
5 minutes
You need
Google account · Age 18 or older · Located in a country where Google AI Studio is available
Last checked

Google's Gemini Developer API has a free tier: you create a key in Google AI Studio and call Flash models, Gemini 2.5 Pro and Gemma 4 without adding billing. This guide covers the setup, what the free tier includes, and the trade-off you accept by staying on it.

What you get

  • Free input and output tokens on every model Google lists with a free tier, including gemini-3.8-flash, gemini-3.6-flash, gemini-3.5-flash-lite, gemini-3.1-flash-lite, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, Gemma 4, gemini-embedding-2, and several Live, Transcribe and TTS models. Older models such as Gemini 3.5 Flash, 3.7 Flash and 2.0 Flash are no longer on the pricing page.
  • Per-model rate limits measured in requests per minute (RPM), input tokens per minute (TPM) and requests per day (RPD). Google does not publish a fixed free-tier table; your active limits are shown in AI Studio. Daily limits reset at midnight Pacific time.
  • Google Search grounding free up to 500 requests per day on gemini-2.5-flash and gemini-2.5-flash-lite (shared between the two). Grounding is not available on the free tier for Gemini 2.5 Pro or any Gemini 3 or newer model; the "5,000 free search requests per month" on those models applies to the paid tier only.
  • No card required and no expiry date.

Full details are on the Gemini Developer API free tier page.

Steps

  1. Go to Google AI Studio at aistudio.google.com and sign in with your Google account. You must be 18 or older and in a supported country.
  2. Accept the terms of service. For new users, AI Studio creates a default Google Cloud project and an API key automatically.
  3. Open the API Keys page (aistudio.google.com/apikey). Click Create API key if you need a new one. If you already use Google Cloud, first import your project under Dashboard > Projects > Import projects.
  4. Copy the key and save it as an environment variable, for example export GEMINI_API_KEY=your_key in ~/.zshrc or ~/.bashrc. The official SDKs read GEMINI_API_KEY or GOOGLE_API_KEY (the latter wins if both are set).
  5. Install the Google Gen AI SDK (pip install google-genai) and send a test prompt to a free model such as gemini-2.5-flash or gemini-3.8-flash.
  6. Check your current limits in AI Studio before you build anything that depends on volume.

Never commit the key to a repository or ship it in client-side code.

Limits and the catch

  • Your data is used. Google's pricing page marks free-tier content as "used to improve our products", and the API terms say human reviewers may read and annotate free-tier inputs and outputs. Do not send sensitive, confidential or personal information. Paid-tier content is not used this way.
  • Not every model is free. Gemini 4 Argon, gemini-3.1-pro-preview, the Gemini Omni Flash models, image models (Nano Banana and the Flash Image models), Veo, Lyria and gemini-2.5-pro-preview-tts have no free tier.
  • Regional rules. The Gemini API terms have specific rules for the EEA, Switzerland and the UK, including that you may only use paid services when making an app available to users in the EEA. Read the terms if you ship to users there.
  • Upgrading costs money. Leaving the free tier means setting up billing in AI Studio and prepaying at least $5 in credits.

If it doesn't work

  • 429 or rate-limit errors: you hit an RPM, TPM or RPD limit. Slow down, add retries with backoff, or wait for the daily reset at midnight Pacific time.
  • "You do not have permission to create a key in this project": ask a project admin for a role such as Project Editor, or create a new Cloud project that isn't tied to an organization.
  • Your keys don't appear in AI Studio: import the Cloud project that holds them.
  • Key rejected: the API rejects unrestricted standard keys. In AI Studio, find the key labeled Unrestricted, click Add restrictions, choose Restrict to Gemini API only, then Restrict key. Long-dormant unrestricted keys may show a Blocked tag; create a new key instead.
  • AI Studio won't open: this is usually a region restriction, the 18+ age requirement, or account verification.
  • A model call fails on a free key: check that the model is listed with a free tier on the pricing page.

Offers in this guide

Understand it

A few minutes of play-along, no sign-up.

Frequently asked questions

Is the Gemini API really free?
Yes, for models Google lists with a free tier, such as Gemini 2.5 Pro, Gemini 2.5 Flash and Gemini 3.8 Flash. Usage is capped by per-model rate limits, and no card is needed.
Does Google use my free-tier prompts?
Yes. Google's pricing page says free-tier content is used to improve its products, and the terms say human reviewers may read inputs and outputs. Paid-tier content is not used this way.
What are the exact free-tier rate limits?
They vary by model and are shown in Google AI Studio for your project. Limits cover requests per minute, input tokens per minute and requests per day; daily limits reset at midnight Pacific time.
Can I use Gemini 3.1 Pro or image generation for free?
No. Gemini 4 Argon, gemini-3.1-pro-preview, the image models, Veo and Lyria have no free tier. Gemini 2.5 Pro is free within rate limits.

Sources

Steps and limits were checked against these official pages.

More guides

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer