Google AI API Pricing (2026): How Gemini Costs Work
Unicorn API Team · · 11 min read
If you are budgeting a Gemini project, Google AI API pricing looks simple on the surface: a rate per million tokens in, a rate per million tokens out. The bill you actually receive depends on half a dozen other things, from hidden reasoning tokens to how long your prompts get. This guide explains how the billing works, where costs creep in, how to estimate a monthly bill from your own traffic, and how Google’s model compares with OpenAI, Claude, Moonshot and Kling.
One note before we start: Google reprices models often, and new Gemini versions arrive every few months, so this article explains the structure rather than reprinting a rate card that will be stale next quarter. Pull the current figures from Google’s official pricing page and plug them into the method below.
What is Google AI API pricing based on?
Google AI API pricing is usage-based. There is no monthly fee for the API itself; you pay for what each request consumes. The unit depends on what the model produces.
Text and multimodal models: tokens
A token is a chunk of text, roughly a short word or part of a longer one. Gemini text models charge one rate for input tokens (your prompt, system instructions, chat history and any files you attach) and a higher rate for output tokens (what the model writes back). Images, audio and video sent as input are converted into tokens too, so a long video in your prompt can cost more than pages of text.
Output is always the expensive side. That matters because the ratio of input to output in your workload decides which model is cheapest for you. A summariser reads a lot and writes a little; a code generator might do the opposite.
Media models: per output
Google’s image models (the Nano Banana family) and video models (Veo) are priced per generated output: per image for images, per second of footage for video. Resolution and quality settings move the price. Under the hood some of these are counted in tokens, but the practical way to think about them is cost per image or per second.
Tiers within a model
The higher-end Gemini Pro models use tiered pricing: prompts above a context-length threshold are billed at a higher per-token rate for both input and output. Flash and Flash-Lite models are the cheaper, faster tiers and are the usual starting point for high-volume work. The gemini ai api pricing page lists each model’s rates in separate rows for standard, long-context, cached and batch usage, which is why it looks more complicated than it is.
Free tier vs paid tier: what you actually get
The free tier is the part of Google AI API pricing people misread most often.
- Google AI Studio, the browser workspace for trying prompts, is free to use.
- The Gemini API free tier gives you an API key with no credit card, but each model is capped on requests per minute, tokens per minute and requests per day. The caps are low enough that they suit prototyping, not a live product.
- Data handling differs. On the free tier, Google may use your prompts and responses to improve its products. On the paid tier, it does not. If you handle customer data, that alone is a reason to enable billing.
- Not every model is free. The newest Pro models, some image and video models, and certain features are paid-only or have a much smaller free allowance.
Moving to the paid tier means linking a Google Cloud billing account to your project. Your rate limits rise in steps as your cumulative spend grows, so a brand-new paid project still has tighter limits than an established one.
Consumer plans are a separate product
Google AI Plus, Pro and Ultra are subscriptions for the Gemini app and Google Workspace features. They do not include API usage and do not raise API limits. Many searches for google ai api pricing are really asking whether a personal subscription covers developer use. It does not: the API is billed on its own.
Vertex AI: the enterprise route
The same Gemini models are also served through Vertex AI inside Google Cloud. Vertex adds identity and access controls, regional data residency, private networking and provisioned throughput (reserved capacity you pay for in advance). Per-token rates are broadly in line with the developer API, but the surrounding contract, quotas and support are different. Choose Vertex when procurement or compliance requires it, not for a lower rate.

The hidden costs in Google AI API pricing
The headline rates are only part of the bill. These are the line items that surprise people.
Thinking tokens
Gemini’s reasoning models “think” before answering: they generate internal reasoning text you never see. Those thinking tokens are billed as output. On a hard question the reasoning can be longer than the answer itself, so a request that returns two sentences may be charged for far more. Most Gemini models let you set a thinking budget or level; lowering it on simple tasks is one of the easiest savings available.
Long context
Gemini accepts very long prompts, which is useful and easy to overuse. On Pro models, crossing the long-context threshold moves the entire request to the higher rate. A chatbot that resends its full history every turn will drift across that line in long conversations without anyone noticing.
Context caching
If many requests share the same large prefix (a long system prompt, a manual, a codebase), caching lets you pay a reduced rate for those repeated input tokens. Explicit caches also carry a storage charge per hour, so caching only saves money when the cache is actually reused often enough to cover storage.
Batch mode
Work that does not need an instant answer (classifying a backlog, generating product descriptions overnight) can run through the Batch API at a discounted rate in exchange for slower turnaround. If a job can wait hours, it should almost always go through batch.
Grounding and tools
Grounding with Google Search, which lets the model look things up and cite results, is billed per request beyond a free daily allowance, on top of tokens. Search results returned to the model also add input tokens. Other built-in tools, such as code execution, add tokens for their inputs and outputs.
Retries and failed requests
Timeouts and client-side retries can double-bill the same work if your code resends a request that actually completed. Log request IDs and token usage so you can see when this happens.
How to estimate your Gemini API bill (worked example)
A pricing calculator is only as good as the numbers you put in. The reliable way to estimate is from your own traffic.
- Run a realistic sample. Send 50 to 100 real requests from your app, not toy prompts.
- Log usage per request. Every Gemini response includes usage metadata: prompt tokens, output tokens, thinking tokens and cached tokens. Record all four.
- Average them. Note the median and the 90th percentile, because a few long conversations can dominate cost.
- Multiply by volume. Requests per month times average tokens gives monthly token totals for each category.
- Apply current rates. Multiply each total by its per-million rate, then add per-request extras like grounding.
- Add a margin. Allow for retries, growth and prompt changes. Usage rarely goes down after launch.
Worked example: a support assistant
Suppose a support assistant handles 10,000 conversations a month. Your logs show each conversation averages 2,000 input tokens (system prompt, help-centre excerpts and history) and 400 output tokens. That is:
- Input: 10,000 × 2,000 = 20 million tokens
- Output: 10,000 × 400 = 4 million tokens
Your Gemini cost is then 20 × the input rate per million, plus 4 × the output rate per million. If you use a reasoning model, add the logged thinking tokens to the output figure before multiplying. If the system prompt and help-centre excerpts are the same across conversations, caching can cut the cost of most of those 20 million input tokens.
For comparison, here is the same workload on a model with fixed, published credit rates. Kimi K3.1 Pro on Unicorn API costs 160 credits per million input tokens and 800 credits per million output tokens (16 credits per million cached input tokens):
- Input: 20 × 160 = 3,200 credits
- Output: 4 × 800 = 3,200 credits
- Total: 6,400 credits, which is $64 at the $0.01 plan credit rate
Notice that output is only a sixth of the tokens but half the cost. That pattern holds for most text models, Gemini included, and it is why trimming verbose answers often saves more than trimming prompts.

AI API pricing comparison: Google vs OpenAI, Claude, Moonshot and Kling
Google AI API pricing uses the same basic shape as the rest of the market, so the useful comparison is about structure: what is billed, and what tends to surprise you.
| Provider | Billing unit | Main cost drivers | Things to watch |
|---|---|---|---|
| Google (Gemini) | Per 1M tokens; per image or second for media | Output tokens, thinking tokens, long-context tier on Pro | Free-tier data use, grounding fees, cache storage |
| OpenAI | Per 1M tokens; per image for image models | Output and reasoning tokens | Image quality setting changes price sharply |
| Anthropic (Claude) | Per 1M tokens | Output tokens, extended thinking | Cache writes and cache reads priced differently |
| Moonshot (Kimi) | Per 1M tokens | Output tokens | Cached input much cheaper than fresh input |
| Kling | Per second of video | Clip length and resolution | Long clips add up quickly |
| Unicorn API | Credits ($0.01 each on plans) | Per-model credit rates, same units as above | Exact price available before you run a request |
Open AI API pricing
OpenAI bills chat models per million tokens with separate input, cached input and output rates, and counts reasoning tokens as output, much like Gemini’s thinking tokens. For images, quality is the big lever. On Unicorn API, GPT Image 1.5 costs 3 credits at low quality, 4 at medium and 22 at high, so the jump to high quality is more than 5x. The newer GPT Image 2.6 (Economy) Text to Image is a flat 5 credits per image, as is its image-to-image counterpart.
Claude AI API pricing
Anthropic follows the same per-token model with its own cache pricing: writing to the cache costs more than a normal input token, reading from it costs much less. Extended thinking is billed as output. Workloads with a large, stable system prompt benefit most from caching on any of these providers.
Moonshot AI API pricing
Moonshot’s Kimi models are a common lower-cost alternative for long-context chat and agent work. On Unicorn API, Kimi K3.1 Pro is priced at 160 credits per million input tokens and 800 per million output, with cached input at 16 credits, a tenth of the fresh input rate.
Kling AI API pricing
Video is billed per second, so duration is the main control. Kling 4.0 Flash Keyframe To Video costs 17 credits per second at 720p, so a 5-second clip is 85 credits. For cheap motion tests, Grok Imagine Video 1.5 animates a start image from 2.4 credits for one second at 480p; a 5-second 720p clip is 22.5 credits, rounded up to 23. For longer text-to-video clips up to 30 seconds, Grok Imagine Video 1.0 uses the same per-second rate. For more token-level detail across chat models, see our LLM API pricing comparison.
Paying for Google models through Unicorn API
If your app uses Gemini for text but other providers for images or video, you end up with several accounts, several billing pages and several sets of rate limits. Unicorn API puts image, video, audio and chat models behind one key and one balance, priced in credits.
Google’s cheapest image model is available directly: Nano Banana 2 Lite costs 4 credits per image (multiplied by n if you ask for several), supports aspect ratios from 21:9 to 9:16, and accepts up to 10 reference images for edits. At the plan rate that is $0.04 per image. If you are wondering whether you can get it for free, our post on Nano Banana 2 free limits covers what the free routes actually allow.
How credits work
- Monthly plans: Starter $25, Creator $50, Studio $100, Pro $200, with credits at $0.01 each.
- Top-ups: $0.015 per credit, and they never expire.
- Price checks:
POST /v1/models/pricereturns the exact cost of a request before you run it. See the API documentation for the request body.
Full plan details are on the pricing page.
Code example: an image job and a chat call with cost tracking
This Python script generates a Nano Banana 2 Lite image, polls until the job finishes, then makes a chat call to Kimi K3.1 Pro and works out its cost in credits from the reported usage. Create a key at /keys and export it as UNICORN_API_KEY.
import os
import time
import requests
BASE = "https://api.unicornapi.net"
HEADERS = {
"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
"Content-Type": "application/json",
}
# 1. Image: Google Nano Banana 2 Lite (4 credits per image)
job = requests.post(
f"{BASE}/v1/jobs",
headers=HEADERS,
json={
"model": "nano-banana-2-lite",
"input": {
"prompt": "A red fox resting in a snowy forest at dawn, soft light, highly detailed",
"aspect_ratio": "16:9",
},
},
timeout=30,
).json()
job_id = job["id"]
deadline = time.time() + 300
while time.time() < deadline:
job = requests.get(f"{BASE}/v1/jobs/{job_id}", headers=HEADERS, timeout=30).json()
if job["status"] == "succeeded":
print("Image URL:", job["outputs"][0]["url"])
break
if job["status"] == "failed":
raise RuntimeError(f"Job failed: {job}")
time.sleep(3)
else:
raise TimeoutError("Image job did not finish in time")
# 2. Chat: Kimi K3.1 Pro (OpenAI-compatible endpoint)
resp = requests.post(
f"{BASE}/v1/chat/completions",
headers=HEADERS,
json={
"model": "kimi-k3-1-pro",
"messages": [
{"role": "user", "content": "Write a two-sentence product caption for a fox print."}
],
"max_tokens": 200,
},
timeout=60,
).json()
print(resp["choices"][0]["message"]["content"])
usage = resp["usage"]
credits = (
usage["prompt_tokens"] * 160 / 1_000_000
+ usage["completion_tokens"] * 800 / 1_000_000
)
print(f"Chat cost: about {credits:.4f} credits")
The same cost-per-request logging is what you need to estimate Google AI API pricing for your own workload: record usage on every call and the monthly maths becomes trivial. You can also try the image models in the browser at the image studio before writing any code, or call them from coding agents through MCP.
Mistakes that inflate AI API bills
Most overspending comes from a short list of habits.
- Using a Pro model for everything. Route simple tasks (classification, extraction, short replies) to Flash or Flash-Lite and reserve Pro for the hard ones. A two-tier router often cuts cost more than any other change.
- Leaving thinking at the default. Reasoning on a simple lookup burns output tokens for no quality gain. Set a low thinking budget for routine requests.
- Resending full history. Summarise or trim old turns. Long histories raise input cost and can push Pro requests into the long-context tier.
- No
max_tokenslimit. Without a cap, a rambling answer costs whatever it costs. Set a sensible ceiling for each endpoint. - Prototyping on the free tier with real customer data. Free-tier prompts may be used to improve Google’s products. Enable billing before real data goes in.
- Comparing headline input rates. Output and thinking tokens usually dominate. Compare providers on your actual token mix, not the cheapest number on the page.
- Ignoring media settings. For images and video, quality, resolution and duration drive cost far more than prompt length. Generate drafts at low settings and only render finals at high quality.
- Trusting an old price table. Google AI API pricing changes with each model generation, and older models are sometimes repriced. Recheck rates whenever you switch versions.
The short version: Google AI API pricing rewards teams that measure. Log token usage from day one, pick the smallest model that does the job, cap output, cache what repeats and batch what can wait. Whether you call Gemini directly or run Google’s image models alongside OpenAI, Moonshot and Kling through one Unicorn API key, the method is the same: know your token mix, then do the multiplication. Browse the full model catalog to compare credit rates side by side.
Frequently asked questions
Is the Google AI API free to use?
Partly. Google AI Studio offers a free tier for most Gemini models without a credit card, but it is capped by requests per minute, tokens per minute and requests per day, and prompts on the free tier may be used to improve Google's products. For production traffic, higher limits or data protection, you switch the project to the paid tier through Cloud billing and pay per token.
Does a Google AI Pro or Ultra subscription include Gemini API access?
No. The consumer plans give you the Gemini app, extra storage and premium features inside Google products. API usage is billed separately on a Google Cloud billing account, per token or per output. Paying for a personal Gemini plan does not raise your API rate limits or cover API calls, so budget for the two separately if you need both.
What is the difference between AI Studio and Vertex AI pricing?
Both serve Gemini models, but they target different buyers. The Gemini Developer API, managed from AI Studio, is the quick route: an API key, a free tier and simple paid billing. Vertex AI sits inside Google Cloud with enterprise controls such as IAM, regional data residency, private networking and provisioned throughput. Per-token rates are broadly similar for the same model, but the surrounding costs and contracts differ.
Is there a Google AI API pricing calculator?
Google Cloud has a general pricing calculator, but the most reliable estimate comes from your own traffic. Log the input and output token counts from a sample of real requests, multiply each by the current per-million rate for your model, and add thinking tokens, grounding requests and caching storage. Multiply by monthly request volume and keep a margin for retries and longer conversations.
Why is my Gemini bill higher than my token estimate?
The usual causes are thinking tokens, which reasoning models bill as output even though you never see them; prompts that cross the long-context threshold on Pro models and get billed at a higher rate; conversation history resent on every turn; grounding with Google Search charged per request beyond the free allowance; and retries after timeouts. Check the usage metadata on each response to find which one applies.
How does Google AI API pricing compare with OpenAI and Claude?
All three bill text models per million input and output tokens, with output priced higher than input and discounts for cached prompts and batch jobs. The differences are in the details: long-context surcharges, how reasoning tokens are counted, free tiers and which add-ons cost extra. Compare them on your own token mix rather than on headline rates, because output-heavy workloads change the ranking.