Get the full pricing picture before the bill surprises you
You start out treating the Gemini API as "basically free," and then the first monthly invoice lands at several times what you expected. It happens easily: the per-token rates are published, but once the free-tier boundaries and per-model differences come into play, real-world cost is hard to predict in advance.
This guide walks you through everything you need to know about Gemini API pricing in 2026: how the free tier works, how token-based billing is calculated, a model-by-model cost comparison, real-world usage estimates, and how to set up spend caps to protect yourself from runaway costs.
Making the Most of the Free Tier
The Gemini API offers a generous free tier that's well-suited for personal projects, prototyping, and learning. You can build and test most features without spending a cent.
Free Tier Limits (as of April 2026)
- Gemini 3 Flash: 15 requests/min, 1,500 requests/day
- Gemini 3.1 Flash: 15 requests/min, 500 requests/day
- Gemini 3 Pro / 3.1 Pro: 2 requests/min, 50 requests/day
- Token limits: Bounded by each model's context window per request
One important note: on the free tier, response data may be used to improve Google's AI models, as outlined in Google's terms of service. For production workloads or anything involving sensitive data, upgrading to a paid plan is strongly recommended.
What You Can Build on the Free Tier
All of Gemini's core features are available on the free tier, including:
- Text generation and multi-turn conversations
- Multimodal input (images, PDFs, audio files)
- Function Calling and Structured Output
- System Instructions
- Streaming responses
A great starting point is to grab your API key from Google AI Studio and start building your prototype — no credit card required.
How Token-Based Billing Works
Once you move to a paid plan, usage is billed by tokens. A token is the smallest unit of text that the model processes. In English, one token is roughly 4 characters (or about ¾ of a word). In Japanese, most characters correspond to 1–2 tokens.
Input Tokens vs Output Tokens
Gemini API bills input tokens and output tokens separately:
- Input tokens: Your prompt, System Instructions, any uploaded files — everything you send in
- Output tokens: The text the model generates in response (including Function Calling outputs)
Output tokens are priced higher than input tokens, so use cases that require long, detailed responses will accumulate costs faster. Being intentional about your output length can make a meaningful difference.
Checking Token Counts Before You Call
You can count tokens before making a full API call using Python:
import google.generativeai as genai
genai.configure(api_key="YOUR_GEMINI_API_KEY")
model = genai.GenerativeModel("gemini-3-flash-latest")
# Count tokens without consuming API quota
prompt = "Explain how Gemini API pricing works, including the free tier details."
token_count = model.count_tokens(prompt)
print(f"Input token count: {token_count.total_tokens}")
# Example output: Input token count: 18After a generation call, usage_metadata shows the full breakdown:
response = model.generate_content(prompt)
usage = response.usage_metadata
print(f"Input tokens: {usage.prompt_token_count}")
print(f"Output tokens: {usage.candidates_token_count}")
print(f"Total tokens: {usage.total_token_count}")
# Example output:
# Input tokens: 18
# Output tokens: 287
# Total tokens: 305Model Pricing Comparison (2026)
Choosing the right model is the single most impactful decision for cost control. Here's how the main models compare:
Gemini 3 Flash / 3.1 Flash — Best for Cost Efficiency
- Input: ~$0.075 per 1M tokens
- Output: ~$0.30 per 1M tokens
- Best for: Chatbots, summarization, classification, high-volume batch jobs
Gemini 3 Pro / 3.1 Pro — Best for Accuracy
- Input: ~$1.25 per 1M tokens
- Output: ~$5.00 per 1M tokens
- Best for: Code generation, complex reasoning, high-accuracy multimodal tasks
Gemini 3 Flash Lite — Best for Lightweight Workloads
- Input: ~$0.01875 per 1M tokens
- Output: ~$0.075 per 1M tokens
- Best for: Simple classification, template completion, extremely high-volume processing
⚠️ Heads up: These figures are approximate references based on published pricing as of April 2026. Always check the official Google AI pricing page for the most current rates — Google updates them periodically.
Multimodal Input Pricing
When you send images, video, or audio, Gemini converts these to token equivalents:
- Images: ~258 tokens each (for Gemini 3 Flash)
- Video: ~263 tokens per second (plus audio if included)
- Audio: ~32 tokens per second
For workflows involving large volumes of media, context caching can meaningfully reduce input costs by storing repeated prefixes (like System Instructions or large documents) rather than resending them every time.
Real-World Cost Estimates by Use Case
Let's put the numbers into practice with two concrete scenarios.
Use Case 1: Customer-Facing Chatbot (1,000 conversations/day)
- Input: 500 tokens × 1,000 = 500K tokens/day
- Output: 300 tokens × 1,000 = 300K tokens/day
- Model: Gemini 3.1 Flash
- Monthly estimate:
- Input: 15M tokens × $0.075/1M = $1.13/month
- Output: 9M tokens × $0.30/1M = $2.70/month
- Total: ~$3.83/month
Use Case 2: Document Summarization Service (100 PDFs/day)
- Input: 5,000 tokens × 100 = 500K tokens/day
- Output: 500 tokens × 100 = 50K tokens/day
- Model: Gemini 3 Flash
- Monthly estimate:
- Input: 15M tokens × $0.075/1M = $1.13/month
- Output: 1.5M tokens × $0.30/1M = $0.45/month
- Total: ~$1.58/month
These estimates show just how affordable production-grade AI can be when you choose the right model. For a deeper dive into techniques that can cut these costs even further, see Gemini API Cost Optimization Complete Guide.
Setting Up Spend Caps to Protect Your Budget
Before going live, setting a spend cap is one of the simplest and most important steps you can take to avoid bill shock. When your monthly spend reaches the cap, API calls stop rather than continuing to accumulate charges.
How to Set a Spend Cap in Google AI Studio
- Sign in to Google AI Studio
- Open Settings → Billing
- Enter your desired Monthly Spend Cap (e.g., $10)
- Save — once the cap is reached, API calls will return an error until the next billing period
Handling Rate Limits and Spend Cap Errors in Code
import google.generativeai as genai
from google.api_core import exceptions
import time
genai.configure(api_key="YOUR_GEMINI_API_KEY")
model = genai.GenerativeModel("gemini-3-flash-latest")
def safe_generate(prompt: str, max_retries: int = 3) -> str:
"""Handles rate limit (429) and spend cap errors gracefully."""
for attempt in range(max_retries):
try:
response = model.generate_content(prompt)
return response.text
except exceptions.ResourceExhausted as e:
# 429: rate limit hit or spend cap reached
if attempt < max_retries - 1:
wait_time = 2 ** attempt # Exponential backoff
print(f"Rate limit reached. Retrying in {wait_time}s...")
time.sleep(wait_time)
else:
raise RuntimeError(f"API call failed after retries: {e}")
return ""
result = safe_generate("Summarize the key points of today's meeting notes.")
print(result)For a full breakdown of quota management strategies, refer to Gemini API Rate Limiting and Quota Management, and for spend cap configuration details, see Gemini API Spend Caps Guide.
Monitoring Costs in Production
Once your service is live, cost visibility becomes just as important as uptime. Google Cloud Billing provides dashboards for tracking spend by project and service — essential for catching unexpected cost spikes early.
For teams running production workloads, building observability into your API usage (logging token counts per request, setting up cost alerts, tracking model utilization over time) is a practice that pays off quickly. The Gemini API Production Observability Complete Guide covers these patterns in depth — highly recommended for anyone scaling a commercial service.
Key Takeaways
Here are the key takeaways for Gemini API pricing in 2026:
- The free tier is genuinely useful: Personal projects and prototypes can run entirely on the free tier
- Token billing = input tokens + output tokens: Each priced separately, with output tokens costing more
- Model choice drives cost: Flash tiers are 10–20x cheaper than Pro tiers for most workloads
- Set a spend cap first: A simple safeguard every developer should configure before going live
- Monitor in production: Cost visibility tools are essential for scaling sustainably
Understanding pricing is the foundation for building confidently with the Gemini API. Start with the free tier, prototype your idea, and revisit your model choices as your usage grows.