Try Bifrost Enterprise free for 14 days. Request access

Gemini API Pricing in 2026 and How to Cut What You Pay

Gemini API Pricing in 2026 and How to Cut What You Pay

TL;DR

  • Gemini 3.8 Flash, 3.7 Flash, and 3.6 Flash all bill at $0.75 per million input tokens and $3.75 per million output tokens on the standard paid tier, and all three rates double on January 1, 2027.
  • Gemini output pricing includes thinking tokens, so reasoning-heavy prompts bill at the output rate even when the visible answer is short.
  • Gemini API pricing runs four service tiers for the same model: Batch and Flex at half the standard rate, Priority at 1.8x, so the tier a request lands on changes the bill more than the model does.
  • Routing Gemini through Bifrost gives one place to apply model routing, semantic caching, per-team budgets, and cost attribution across 25+ providers instead of reconciling separate provider consoles.
  • Bifrost adds 11 microseconds of overhead per request at 5,000 requests per second in sustained benchmarks, so consolidating providers does not trade latency for control.

Gemini 3.8 Flash costs $0.75 per million input tokens and $3.75 per million output tokens on Google's standard paid tier, and both rates double on January 1, 2027. Gemini API pricing is only half of what a team actually pays, because the bill is also shaped by thinking tokens, the service tier a request lands on, context caching, and how much traffic reaches an expensive model that a cheaper one could have served. Bifrost, the open-source AI gateway built in Go by Maxim AI, is the best choice for enterprises running mission-critical AI workloads that require best-in-class performance, scalability, and reliability, and it places Gemini and every other provider behind one API where those levers become configuration rather than code. This post covers what Gemini costs today, how those rates compare with OpenAI and Anthropic, and the gateway controls that reduce the total.

Gemini API Pricing by Model

Gemini API pricing is per token, split into input and output rates that vary by model tier. Pro models carry the highest rates and add a surcharge above 200,000 tokens of context. Flash models sit in the middle. Flash-Lite models are the cheapest current option, and every Gemini model ships a 1-million-token context window.

Rates below are the standard paid-tier text rates published on Google's Gemini API pricing page, per million tokens in USD, as of September 2026.

Model Input Output (incl. thinking) Cached input Notes
Gemini 3.1 Pro Preview $2.00 (≤200K) / $4.00 (>200K) $12.00 / $18.00 $0.20 / $0.40 Cache storage $4.50 per 1M tokens per hour
Gemini 3.8 Flash $0.75 $3.75 $0.075 Doubles January 1, 2027
Gemini 3.7 Flash $0.75 $3.75 $0.075 Doubles January 1, 2027
Gemini 3.6 Flash $0.75 $3.75 $0.075 Doubles January 1, 2027
Gemini 3 Flash Preview $0.50 text / $1.00 audio $3.00 $0.05 Legacy Flash model
Gemini 3.5 Flash-Lite $0.30 $2.50 $0.03 Cache storage $1.00 per 1M tokens per hour
Gemini 3.1 Flash-Lite $0.25 text / $0.50 audio $1.50 $0.025 Cheapest current generation
Gemini 2.5 Flash-Lite $0.10 text / $0.30 audio $0.40 $0.01 Previous generation

Two details in that table decide most budgets. The first is the 5x gap between Flash-Lite and Pro on input and the 8x gap on output, which is the entire argument for routing by request complexity rather than defaulting a whole application to one model. The second is the introductory pricing footnote: three Flash models are currently priced at a promotional rate that expires at the end of 2026, so any forecast built on today's Flash rate needs a second column for 2027.

Bifrost tracks these rates in its Model Catalog, which downloads a pricing sheet at startup and re-syncs it every 24 hours. That is what lets per-request cost be computed at the gateway rather than reconstructed from an invoice weeks later. Configuration for the provider itself is covered in the Gemini provider docs.

What Drives Gemini API Cost Beyond the Rate Card

Gemini API cost diverges from the rate card for four reasons: thinking tokens bill as output, the service tier multiplies or halves the rate, context caching carries a storage charge on top of a read charge, and Pro models step up above 200,000 tokens. A forecast that models only input and output rates will come in low.

Thinking tokens bill at the output rate. Google lists output pricing for Gemini 3.x models as including thinking tokens. A reasoning-heavy prompt that returns three sentences can bill for thousands of output tokens, which is why observed cost per request often runs several times higher than a token count taken from the visible response.

The service tier changes the rate more than the model does. The same Gemini model sells at four prices:

Service tier Gemini 3.8 Flash input Gemini 3.8 Flash output Trade-off
Standard $0.75 $3.75 Interactive latency
Flex $0.375 $1.875 Lower priority, variable latency
Batch $0.375 $1.875 Asynchronous, designed to complete within 24 hours
Priority $1.35 $6.75 Highest priority, interactive

Batch and Flex are half the standard rate. Priority is 1.8x. A quoted Gemini figure is meaningless until the tier is named, and moving asynchronous work such as nightly enrichment, evaluation runs, or document backfills onto Batch is a 50% reduction that requires no prompt changes at all. Bifrost supports Gemini batch jobs through the same unified API it uses for interactive traffic.

Context caching has two meters. Cached input on Gemini 3.8 Flash reads at $0.075 per million tokens, a tenth of the fresh input rate, but Google also charges storage at $0.50 per million tokens per hour through the end of 2026. A cache that is written and rarely read is a net loss. On Gemini 3.1 Pro Preview the storage rate is $4.50 per million tokens per hour, high enough that caching only pays when the same prefix is read many times within the hour.

Pro models step up above 200K. Gemini 3.1 Pro Preview doubles input pricing and raises output by 50% once a single prompt exceeds 200,000 tokens. Flash and Flash-Lite models price flat regardless of context length. Applications that grow conversation history without compaction can cross that boundary mid-session and see cost per turn jump without any change in traffic. The broader mechanics of this pattern are covered in our guide to cutting AI spending without sacrificing quality.

LLM Pricing Comparison: Gemini, OpenAI, and Anthropic

An LLM pricing comparison is only useful when models are matched by capability tier rather than by name. The table below places the current frontier, mid, and economy tiers from Google, OpenAI, and Anthropic side by side at standard short-context rates, per million tokens in USD.

Model Provider Input Output Cached input
Gemini 3.1 Pro Preview (≤200K) Google $2.00 $12.00 $0.20
gpt-5.6-terra OpenAI $2.00 $12.00 $0.20
Claude Sonnet 5 Anthropic $2.00 $10.00 $0.20
Claude Haiku 4.5 Anthropic $1.00 $5.00 $0.10
Gemini 3.8 Flash Google $0.75 $3.75 $0.075
Gemini 3.1 Flash-Lite Google $0.25 $1.50 $0.025
gpt-5.6-luna OpenAI $0.20 $1.20 $0.02

OpenAI rates come from the OpenAI pricing page and Anthropic rates from the Claude pricing documentation, both read in September 2026.

The mid tier has converged: $2.00 input is now the going rate at three providers, and the differences that remain are in output pricing, cache economics, and tokenizer behavior rather than headline input cost. That convergence is the practical case for multi-provider access. When capability-matched models cost within a few percent of each other, the provider that serves a given request should be a routing decision made against live price and availability, not a decision frozen into an SDK import two quarters ago. Teams weighing that move can compare approaches in our breakdown of gateway options for routing between OpenAI, Anthropic, and Gemini.

Why Per-Provider Billing Hides Your Real LLM Token Cost

Real LLM token cost is invisible when each provider bills separately, because a provider console reports spend per API key, not per team, feature, customer, or environment. Three services sharing one Gemini key produce one number, and nobody can say which service caused an increase.

The gaps this creates are consistent across organizations:

  • No attribution. Spend cannot be assigned to the team or product that generated it, so cost conversations end in guesswork.
  • No cross-provider view. Gemini, OpenAI, and Anthropic spend live in three consoles with three billing periods and three export formats.
  • Late signal. Provider billing dashboards lag, so a runaway retry loop or a prompt regression is often discovered after the invoice.
  • No per-request detail. Aggregate spend does not identify which endpoint, model, or user is expensive.

Bifrost closes these by recording every request as it passes through. Built-in observability captures inputs, outputs, tokens, cost, and latency for each call, and the logging runs asynchronously so it adds no latency to the response. Because cost is computed at the gateway from the Model Catalog, attribution is available in real time rather than at month end. Our governance resource page covers how that data feeds budget enforcement, and there is a fuller treatment of the metrics worth collecting in LLM observability at the gateway.

Route Gemini and Every Provider Through One LLM Gateway

An LLM gateway is a single API endpoint that fronts multiple model providers, applying routing, caching, governance, and logging to every request before it reaches the provider. The Bifrost AI gateway unifies 25+ providers and 10,000+ models behind one OpenAI-compatible interface, so the same client code can reach Gemini, OpenAI, Anthropic, Bedrock, and Vertex without provider-specific branches.

Adoption does not require rewriting application code. Bifrost works as a drop-in replacement for the SDKs teams already run: point the base URL at the gateway and keep the rest. It accepts the native auth header of each provider style, including x-goog-api-key for Google Gemini clients, so existing Gemini integrations authenticate unchanged.

# Existing Gemini client, now routed through Bifrost
export GOOGLE_GEMINI_BASE_URL="<http://localhost:8080/genai>"
export GEMINI_API_KEY="sk-bf-your-virtual-key"

The credential in that second line is a virtual key, which is the unit Bifrost governs: it carries its own model and provider allowlist, budget, and rate limits, and it can be revoked without touching the underlying Google credential. Provider API keys stay in one place instead of being distributed to every service that needs them.

The performance question comes up immediately, and the answer is measurable: Bifrost adds 11 microseconds of overhead per request at 5,000 requests per second with a 100% success rate in sustained benchmarks. Consolidating traffic does not cost latency. The same consolidation is what makes every control in the rest of this post possible, and it is the step our cost optimization guide treats as the prerequisite for the others. Command-line agents follow the same pattern, covered in routing Gemini CLI and Codex through an AI gateway.

Model Routing: Send Each Request to the Cheapest Capable Model

Model routing directs each request to the least expensive model that can handle it, rather than sending all traffic to one default. Given the 8x output-price gap between Gemini 3.1 Flash-Lite and Gemini 3.1 Pro Preview, moving classification, extraction, and routine summarization off the Pro tier is usually the single largest reduction available.

Bifrost offers two routing methods, described in the provider routing docs:

  • Governance-based routing, where explicit rules are configured per virtual key through routing configuration, including weighted distribution and fallback chains.
  • Adaptive load balancing, an enterprise capability that routes on real-time provider health and performance metrics.

When both are configured, governance takes precedence, because an explicit cost or compliance rule should not be overridden by a performance heuristic. Routing also interacts with budgets: a provider that has exhausted its budget or rate limit is excluded from routing rather than returning an error, so traffic shifts to the next eligible provider automatically. That behavior pairs with automatic fallbacks and weighted key management to keep requests served during a provider incident without manual intervention.

Two companion pieces go deeper on the mechanics: model routing and token costs and cost-aware routing to the cheapest capable model.

Semantic Caching and Prompt Caching Are Not the Same Lever

Semantic caching and prompt caching both reduce spend on repeated content, but they operate at different layers and stack rather than compete. Semantic caching means the gateway replays a response it has already seen, so the provider is never called. Prompt caching means the provider reuses the prefix of a request, so the call still happens and is still billed, at a lower input rate.

Semantic caching Prompt caching
Who serves the response Bifrost The provider
Is the provider called No Yes
What is saved The entire call Input cost on the cached prefix
Gemini behavior Provider-independent Gemini caches implicitly via a server-side cachedContent resource
Where it is configured Gateway vector store Per-provider configuration

Semantic caching in Bifrost runs two lookup paths. Direct matching hashes a normalized request and replays an exact match with no embedding call. Semantic matching embeds the incoming request and serves a cached answer when similarity clears a configured threshold. Cost accounting reflects this honestly: a direct cache hit costs nothing, a semantic hit costs only the embedding call, and a miss costs the model call plus the embedding. Direct-only mode needs no embedding provider at all and is the safer default for workloads with high exact-repeat rates.

Auto prompt caching solves a different problem: agentic clients often send no cache breakpoint, so providers that require an explicit marker cache nothing and every turn pays full input price. Bifrost can inject the marker for clients that send none. One caveat matters for this topic: Gemini caches implicitly through its own server-side resource, so marker injection is a no-op there and Gemini teams should rely on Google's context caching and on gateway-level semantic caching instead. The gateway-side approach is examined further in reducing LLM costs with semantic caching.

Budgets and Rate Limits That Cap Gemini Spend

Budgets convert cost from something observed into something enforced. Bifrost applies budgets and rate limits across a four-level hierarchy, and every applicable budget must pass before a request proceeds:

  • Customer, for cost control across an entire downstream account
  • Team, for departmental allocation
  • Virtual key, for a single application or service
  • Provider config, for per-provider limits inside one virtual key

Budgets accept reset windows from one day through one year, including quarterly, and can be calendar-aligned so they reset at the start of each UTC period instead of rolling from creation time. A monthly budget aligned to the calendar resets on the first of the month, which is what makes gateway spend reconcilable against a finance cycle. Quarterly budgets can be moved to a fiscal calendar by setting the quarter start month.

Rate limits run in parallel at the virtual key and provider config levels, covering both request counts and token counts. Provider-level limits give per-provider throttling, so a Gemini limit and an OpenAI limit are independent and a violation on one does not affect the other. Teams operating under compliance requirements can extend this with the controls on the Bifrost Enterprise tier, including RBAC, audit logs, and in-VPC deployment. Our governance overview lays out how these pieces fit together.

What to Measure After Consolidating Providers

LLM observability at the gateway answers the questions provider consoles cannot: cost per feature, cost per customer, which model served which request, and how spend is trending inside the current billing period. Once traffic is consolidated, these become queries against one dataset rather than a reconciliation exercise.

The metrics worth tracking from the first week:

  • Cost per request, by model and by virtual key, which exposes the traffic still landing on expensive models.
  • Cache hit rate, split by direct and semantic, since a low semantic hit rate with a high embedding spend is a net loss.
  • Output-to-input token ratio, the most reliable early signal of thinking-token growth on Gemini.
  • Fallback and retry frequency, which surfaces provider instability that inflates cost through repeated attempts.
  • Budget burn rate against the reset window, so a limit is raised deliberately rather than discovered when requests start failing.

Bifrost exports this data through Prometheus and OpenTelemetry, so it lands in the monitoring stack a team already runs rather than a separate dashboard. Published benchmarks cover the throughput and overhead characteristics of the gateway under sustained load, and the LLM Gateway Buyer's Guide covers the evaluation criteria worth applying before committing to any gateway.

Frequently Asked Questions

Is the Gemini API free?

Yes, Google offers a free tier through Google AI Studio covering Flash and Flash-Lite models with no credit card required. The trade-off is documented: free-tier content is used to improve Google's products, while paid-tier content is not. Free-tier rate limits are lower and the Pro models are paid-only, so production workloads belong on a paid tier.

Which Gemini API model is free?

Flash and Flash-Lite models are available on the free tier, including Gemini 3.8 Flash, Gemini 3.7 Flash, Gemini 3.6 Flash, Gemini 3.5 Flash-Lite, and Gemini 3.1 Flash-Lite. Gemini 3.1 Pro Preview has no free tier for either standard or batch access. Google no longer publishes fixed free-tier request limits, so check the live quota shown for your project.

How much does Gemini cost?

Gemini API pricing on the standard paid tier ranges from $0.10 per million input tokens on Gemini 2.5 Flash-Lite to $4.00 on Gemini 3.1 Pro Preview above 200,000 tokens of context. Output runs from $0.40 to $18.00 per million tokens. The current Flash generation sits at $0.75 input and $3.75 output until January 1, 2027.

Is Gemini cheaper than ChatGPT?

At the frontier tier they are now matched: Gemini 3.1 Pro Preview and gpt-5.6-terra both list $2.00 input and $12.00 output per million tokens for short context. Gemini is cheaper in the mid tier, where Gemini 3.8 Flash runs $0.75 and $3.75. OpenAI is cheaper at the economy end, where gpt-5.6-luna lists $0.20 and $1.20.

How do you optimize LLM costs?

Four levers account for most of the reduction: route each request to the cheapest capable model, cache repeated work at both the gateway and provider layers, move asynchronous jobs onto discounted batch tiers, and enforce budgets so overruns are blocked rather than reported. Applying them from a single AI gateway means they cover every provider at once.

Which LLM is most cost-effective?

Cost-effectiveness depends on the request, which is the argument against picking one model for an entire application. Flash-Lite and nano-class models handle classification, extraction, and routing at a fraction of frontier pricing, while frontier models earn their rate on complex reasoning. Model routing resolves this per request instead of per application.

Start Cutting Gemini API Costs with Bifrost

Gemini API pricing will keep moving, with the current Flash rates doubling at the start of 2027 and new model generations arriving on a quarterly cadence. What stays constant is that the levers which reduce spend, model routing, caching, batch tiering, budgets, and per-request cost attribution, all live at the layer between your application and the providers. Putting that layer in place once means the next price change is a configuration decision rather than a migration.

Bifrost is open source and deploys in minutes through the gateway quickstart, with the full set of guides on the Bifrost resources hub. To see how a unified gateway would reduce LLM spend across your own provider mix, book a demo with the Bifrost team.