"How much will the Gemini API cost me?" is usually the first question before anyone writes a single line of code.
The short answer: for personal projects, learning, and prototyping, the free tier is enough most of the time. Here's what the limits actually are, and three projects you can build without spending anything.
The Actual Free Tier Numbers
As of April 2026, the Gemini API free tier includes:
Gemini 2.0 Flash (Free Tier):
- RPM (requests per minute): 15
- RPD (requests per day): 1,500
- TPM (tokens per minute): 1,000,000
- Input types: text, images, audio, video
- Context window: 1,048,576 tokens
Gemini 2.5 Pro (Free Tier):
- RPM: 5
- RPD: 25
- TPM: 250,000
- Context window: 1,048,576 tokens
Check the current rate limits page for the latest values — these do change.
In practice: 1,500 requests per day with Gemini 2.0 Flash is plenty for personal projects and learning. You'd have to be systematically hammering the API to hit the daily cap. The 15 RPM limit is the one that bites you if you're looping without any delay, so keep that in mind.
Getting Your API Key
- Go to Google AI Studio
- Click "Get API key" → "Create API key"
- Select a project (or create a new one)
- Copy and store the key somewhere safe
No credit card required for the free tier. A Google account is all you need.
Starter Project 1: A Simple Chat Assistant
The most useful first project is one you'll actually interact with.
import google.generativeai as genai
# Configure with your API key (use env vars in real projects)
genai.configure(api_key="YOUR_GEMINI_API_KEY")
# Flash gives you more free-tier headroom than Pro
model = genai.GenerativeModel("gemini-2.0-flash")
# Start a multi-turn chat session
chat = model.start_chat(history=[])
print("Gemini Chat (type 'quit' to exit)")
while True:
user_input = input("You: ")
if user_input.lower() == "quit":
break
response = chat.send_message(user_input)
print(f"Gemini: {response.text}\n")pip install google-generativeai
python chat.pyOnce this works, try adding a system_instruction to give the assistant a persona. Something like "You are a concise technical editor. Rewrite every response to be 30% shorter without losing meaning." suddenly makes this a useful tool.
Starter Project 2: Image Description Tool
Gemini 2.0 Flash is multimodal, which means you can pass in images and ask questions about them.
import google.generativeai as genai
import PIL.Image
genai.configure(api_key="YOUR_GEMINI_API_KEY")
model = genai.GenerativeModel("gemini-2.0-flash")
# Load a local image
image = PIL.Image.open("sample.jpg")
# Ask something about it
response = model.generate_content([
image,
"Describe what's in this image in detail. "
"Note anything unusual or particularly interesting."
])
print(response.text)pip install google-generativeai PillowPractical uses: reading receipts, describing food photos, transcribing handwritten notes, or extracting structured data from screenshots. All of this works on the free tier.
As an indie developer, this is the project that mirrors how I actually started. When I added an image-classification feature to one of my own apps, I ran the first few hundred images entirely on the free tier — just to confirm the model's output was reliable enough — before moving the production batch job to a paid plan. Validating "is this good enough?" for free first, rather than paying to experiment, saved me a fair amount of wasted effort.
Starter Project 3: Document Summarizer
This is the one that tends to be most immediately useful for real work.
import google.generativeai as genai
genai.configure(api_key="YOUR_GEMINI_API_KEY")
model = genai.GenerativeModel("gemini-2.0-flash")
def summarize_file(filepath: str) -> str:
"""Read a text file and return a structured summary."""
with open(filepath, "r", encoding="utf-8") as f:
content = f.read()
prompt = f"""Summarize the following document.
Format your response as:
1. Overview (3 sentences max)
2. Key points (3-5 bullet points)
3. Action items (if any are implied)
---
{content}
"""
response = model.generate_content(prompt)
return response.text
# Example usage
summary = summarize_file("meeting_notes.txt")
print(summary)The 1M token context window on Gemini 2.0 Flash means you can feed in surprisingly long documents without chunking. A 200-page PDF transcribed to text still fits comfortably.
The Rate Limit Error You'll Probably See
If you loop over a list of inputs without any delay, you'll hit the 429 error eventually.
import time
import google.generativeai as genai
from google.api_core.exceptions import ResourceExhausted
model = genai.GenerativeModel("gemini-2.0-flash")
def safe_generate(prompt: str, max_retries: int = 3) -> str:
"""Generate content with automatic retry on rate limit errors."""
for attempt in range(max_retries):
try:
response = model.generate_content(prompt)
return response.text
except ResourceExhausted:
wait_seconds = 60 * (attempt + 1) # 60s, 120s, 180s
print(f"Rate limited. Waiting {wait_seconds}s before retry...")
time.sleep(wait_seconds)
raise Exception("Max retries exceeded")Add this wrapper around any batch processing and you won't need to babysit your scripts.
This is close to the exact backoff I run in my own batch jobs. Because the free tier's RPM ceiling is low, a plain retry-with-delay is usually enough to leave a script running overnight without supervision — far simpler than reaching for elaborate concurrency control before you actually need it.
When to Move to a Paid Plan
The free tier stops being enough at two points: when you're serving real users and 1,500 requests per day isn't close to sufficient, or when you need Gemini 2.5 Pro's reasoning capabilities at scale (the 25 RPD limit on Pro is the real constraint there).
For everything before that point — learning the API, building something for yourself, testing ideas — the free tier is a genuinely useful starting point, not just a demo.
Get the API key, run the chat example, and adjust something to make it your own. You'll have a better sense of what you want to build next within about twenty minutes.