GEMINI LABJP
NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20
Articles/API / SDK
API / SDK/2026-04-01Beginner

Gemini API Pricing & Billing [2026]: From Free Tier to Token Costs Explained

A clear breakdown of Gemini API pricing in 2026 — free tier limits, token-based billing, model cost comparisons, usage estimation, and spend cap setup to keep your costs under control.

gemini-api277pricing5billing4free-tier2tokens3cost-management8Google AI Studio7

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: 18

After 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:  305

Model 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

  1. Sign in to Google AI Studio
  2. Open SettingsBilling
  3. Enter your desired Monthly Spend Cap (e.g., $10)
  4. 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.

Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

API / SDK2026-06-21
Track Gemini API Costs in Production with usageMetadata — A Per-Request Logging Pattern That Reconciles With Your Bill
A production pattern for capturing Gemini API's usageMetadata per request to attribute spend by endpoint, user, and model — hardened for the 3.5 Flash GA era where the default model can shift under you. Covers pricing keyed on resp.model_version and a nightly audit that flags model drift and unknown models before the invoice does.
API / SDK2026-05-01
Why count_tokens Lies: 5 Reasons Your Gemini API Bill Is Higher Than You Estimated — A Reconciliation Playbook
count_tokens said 1,200 tokens. Cloud Console billed you for 4,800. I made the same mistake building my first indie app on Gemini. This guide walks through the five hidden contributors — thinking, tools, multimodal, history, caching — and how to reconcile them with reproducible code.
API / SDK2026-07-14
Before One Runaway Experiment Drains the Shared Budget: Using AI Studio Spend Caps as Isolation Walls
When you run several Gemini experiments under one billing account, a single runaway loop takes everything else down with it. Here is how I use AI Studio's per-project spend caps as isolation walls, plus a client-side soft ceiling and monthly reconciliation, with working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →