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-flashandgemini-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
- 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.
- Accept the terms of service. For new users, AI Studio creates a default Google Cloud project and an API key automatically.
- 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.
- Copy the key and save it as an environment variable, for example
export GEMINI_API_KEY=your_keyin~/.zshrcor~/.bashrc. The official SDKs readGEMINI_API_KEYorGOOGLE_API_KEY(the latter wins if both are set). - Install the Google Gen AI SDK (
pip install google-genai) and send a test prompt to a free model such asgemini-2.5-flashorgemini-3.8-flash. - 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 andgemini-2.5-pro-preview-ttshave 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
- Google Gemini Developer API Free Tier · Free tier · no card
Free Gemini API tier with rate-limited access to Flash models and Gemini 2.5 Pro
Understand it
A few minutes of play-along, no sign-up.
- Why is the mini or flash model the free one? · Knowledge distillation (teacher and student models) · 5 min
- Why does it forget what I said 20 messages ago? · Context window · 3 min
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
- How Students Can Get ChatGPT Plus Free
- How Students Can Get Google Gemini (AI Pro) Free
- How to Use an AI Coding Agent for Free
- How to Get a Free GPU for AI
- How to Apply for AI Startup Credits
- How to Get Free Claude API Credits
- How to Get a Free Groq API Key
- Free AI Image Generation: In the Browser and by API
- Free OpenAI API Access in 2026: What's Actually Free
- Free Embeddings and Reranking APIs in 2026
- Free Text-to-Speech APIs in 2026
- Free Speech-to-Text APIs in 2026
- Free AI Video Generators in 2026
- Free Image Generation APIs in 2026
- Free Web Search APIs for LLM Agents in 2026
- Free Vector Databases for RAG in 2026
- Free DeepSeek API in 2026: What Is Actually Free
- OpenRouter Free Models: Limits, Credits and API Setup
- Free Hugging Face Inference: Credits, ZeroGPU and Spaces
- Free AI APIs With No Credit Card in 2026
- Track Free-Tier Changes Automatically
- How to Run AI Locally for Free
- Free Vision APIs: Read Images and Screenshots for Free
- Free Reasoning Model APIs: Thinking Models for Free
- Free AI courses