Gemini API Pricing
What does the Gemini API cost per million tokens?
Gemini API token costs depend on the model and the date you execute your calls: Gemini 4 Argon costs $2.00 per 1M input tokens and $10.00 per 1M output tokens through November 30, 2026, jumping to $4.00 input and $20.00 output starting December 1, 2026. The Free tier offers free input and output tokens for supported models, but your data is used to improve Google products, and advanced models like Argon aren't available there at all.
Moving to the Paid tier gives you context caching, a 50% discount via the Batch API, and ensures your prompts stay private. Every single token processed counts against your bill, including internal thinking tokens, system instructions, and tool declarations.
Free tier vs Paid tier: the core differences
The Gemini API Free tier gives you free access to select models directly through Google AI Studio. It works fine for quick prototypes, but Google logs your inputs and outputs to train its models. For commercial builds, that's usually an immediate blocker.
Upgrading to the Paid tier requires linking an active Google Cloud billing account and prepaying a minimum of $5 in credits. Once you upgrade, your content is not used to train Google products, your rate limits increase, and you unlock features like context caching and the Batch API. Prepay and Postpay plans took effect on March 23, 2026. If you recently opened a Google Cloud account, keep in mind that the standard $300 Google Cloud Free Trial credit cannot be used for Gemini API or AI Studio charges for accounts opened after March 2, 2026.
AI Studio Free Tier -> Limited models -> Content used for training
AI Studio Paid Tier -> Advanced models -> 50% Batch discount -> Private dataGoogle AI Studio itself remains free to use unless you link a paid API key from a paid project to access paid features. If at least one of your projects has billing enabled, your prompts in AI Studio fall under Paid Services data privacy terms.
Current per-model pricing and caching rates
Token rates on the Gemini API are split between input tokens, output tokens, and context caching. Gemini 4 Argon (gemini-4-argon) is Google's flagship model and carries a higher price tag that increases sharply after November 2026.
Here is how paid pricing breaks down across current and upcoming model transitions:
| Model | Input (per 1M tokens) | Output & Thinking (per 1M tokens) | Context Caching | Free Tier Available? |
|---|---|---|---|---|
| Gemini 4 Argon (through Nov 30, 2026) | $2.00 | $10.00 | $0.10 / 1M (implicit only) | No |
| Gemini 4 Argon (starting Dec 1, 2026) | $4.00 | $20.00 | $0.20 / 1M (implicit only) | No |
| Gemini 3.1 Pro Preview | Docs do not specify | Docs do not specify | $0.20 (200k) + $4.50/1M tokens/hr | Docs do not specify |
| Gemini 2.5 Pro (Deprecated) | Routes to Gemini 3.8 Flash | Routes to Gemini 3.8 Flash | Routes to Gemini 3.8 Flash | No (removed from AI Studio) |
| Gemini 2.5 Flash (Deprecated) | Routes to Gemini 3.5 Flash-Lite | Routes to Gemini 3.5 Flash-Lite | Routes to Gemini 3.5 Flash-Lite | No (removed from AI Studio) |
| gemini-omni-1.1-flash | Routes to 1.2-flash Dec 3, 2026 | Routes to 1.2-flash Dec 3, 2026 | Routes to 1.2-flash Dec 3, 2026 | Docs do not specify |
Gemini 4 Argon context caching supports implicit caching only; explicit caching is not supported.
Older models are going away fast. Both gemini-2.5-pro and gemini-2.5-flash are deprecated and no longer selectable in Google AI Studio. Starting December 1, 2026, existing API calls to gemini-2.5-pro route to Gemini 3.8 Flash and bill at Flash rates, while calls to gemini-2.5-flash route to Gemini 3.5 Flash-Lite. If you run gemini-omni-1.1-flash, requests automatically route to gemini-omni-1.2-flash starting December 3, 2026.
How thinking tokens and grounding are billed
Thinking models reason through steps before returning a final answer. That extra reasoning is not free. Across all Gemini models, thinking tokens are counted and billed at the model's standard output token price. If a Gemini 4 Argon call generates 400 tokens of final response and uses 2,000 thinking tokens to get there, you pay for 2,400 output tokens.
Every token processed by the model gets billed:
- System instructions and grounding declarations: Internal tool system instructions and function declarations are metered as input tokens.
- Search Grounding: On the Paid Tier, projects get 5,000 free Google Search requests per month shared across all Gemini 3 and newer models, then pay $14 per 1,000 requests (with a default cap of 1,500 requests per day per project). On Gemini 2.5 models, Flash and Flash-Lite share 1,500 free requests per day, after which grounded prompts cost $35 per 1,000 grounded prompts. The text or image context retrieved by Search Grounding is not charged as input tokens.
- Code Execution: Free on the Free tier. On the Paid tier, code execution does not have a session runtime fee, but generated code and results are billed as output tokens when created, and as input tokens when fed back into iterative reasoning.
- Document Modality: Uploaded PDFs and documents are billed at standard image token rates, appearing under
DOCUMENTinside thepromptTokensDetailspayload response.
You can inspect token counts before sending requests by calling the GenerativeModel.count_tokens method in the SDK. Calls to the GetTokens API are unbilled and do not consume inference quota. If an API request fails with a 400 or 500 status code, Google does not bill you for the tokens, but the attempt still counts against your rate limit quota.
Account spend caps and prepay traps
Google enforces account-level monthly spend caps based on verification tiers:
- Tier 1 ($250 cap): Requires linking an active billing account.
- Tier 2 ($2,000 cap): Requires paying at least $100 plus waiting 3 days after your first successful payment.
- Tier 3 ($20,000 to $100,000+ cap): Requires paying $1,000 plus waiting 30 days after your first payment.
When your cumulative monthly spend across all projects reaches your account tier limit, API service pauses for every linked project until the 1st of the next month. Project owners, editors, and admins can also set experimental project-level monthly spend caps in AI Studio on the Spend page under Monthly spend cap > Edit spend cap.
If you use Prepay billing, you buy credits in chunks between $5 and $5,000. These credits expire after 12 months and are non-refundable unless you convert to a Postpay account. When your balance reaches $0, all API keys in every project linked to that billing account fail simultaneously with an HTTP 402 Payment Required error.
Because Google has an approximate 10-minute billing pipeline latency, batch jobs and background agents can run past your balance before the system cuts them off, leaving you with an unexpected overage bill. If you are comparing model providers across your stack, check our breakdown of What does the OpenAI API cost per million tokens? alongside What does the Claude API cost per million tokens?.
Worked cost example: Gemini 4 Argon production run
To see how these rules add up, consider an extraction pipeline running 100,000 requests on Gemini 4 Argon before November 30, 2026.
Each request sends a document prompt averaging 1,500 input tokens. The model generates 300 visible output tokens and consumes 1,200 thinking tokens per run. 10,000 of the requests require Google Search grounding.
Here is the cost breakdown:
- Input tokens: 100,000 requests * 1,500 tokens = 150 million tokens. At $2.00 per 1M tokens, input costs $300.00.
- Output and thinking tokens: 100,000 requests * 1,500 total output tokens (300 visible + 1,200 thinking) = 150 million output tokens. At $10.00 per 1M tokens, output costs $1,500.00.
- Search grounding: 10,000 requests. The first 5,000 are free for the month. The remaining 5,000 requests cost $14 per 1,000, adding $70.00.
The total comes to $1,870.00. If you run this same batch using the Batch API, standard token pricing drops by 50%, bringing the token subtotal from $1,800.00 down to $900.00. Run that exact same pipeline after December 1, 2026 at standard rates, and the token bill doubles: inputs jump to $600.00 and outputs jump to $3,000.00.
Tracking API spend with Costbrake
Google Cloud exports billing records to BigQuery, but those export tables run several hours behind real usage. That delay makes it easy for an agent in an infinite loop to chew through hundreds of dollars before standard budget alerts fire.
Costbrake solves this by polling live Cloud Monitoring estimates for the Gemini API alongside BigQuery exports. Its live Gemini API estimates from Cloud Monitoring run hourly on the Free plan, every 5 minutes on Pro ($12/month), and every 2 minutes during an active spike, and it reads billed cost from your BigQuery export about once an hour. If an hour exceeds 3x your baseline and adds more than $5, you get an immediate alert via email, Slack, Discord, or webhooks.
When an alert triggers, Pro workspaces can flip an opt-in brake: a zero Google spend cap on the Gemini API in that project. Google pauses new usage once the cap is recognized. Costbrake uses read-only credentials to monitor your usage and a separate, dedicated permission if you choose to enable the spend cap brake. To configure tracking with your AI coding assistant, view the agent setup documentation, or check our guide on How do I limit what I spend on the Gemini API?. If you run multiple LLM providers, you can also see How do I monitor spend across OpenAI, Anthropic, Gemini and other AI APIs in one place?.
Questions and answers
Is the Gemini API free to use?
Yes, Google offers a Free tier in Google AI Studio with free input and output tokens on select models. However, your data is used to improve Google products, rate limits are low, and advanced models like Gemini 4 Argon are excluded.
Are thinking tokens billed on the Gemini API?
Yes. Every token processed by the model is counted and billed, and thinking tokens are billed at the model's output token price.
What happens when my Prepay credit balance runs out?
All API keys across every project linked to that billing account stop working immediately, returning HTTP 402 Payment Required errors. Because of a 10-minute billing pipeline delay, long-running batch jobs can still incur overages before requests halt.
Can I use the $300 Google Cloud Free Trial for the Gemini API?
No. Starting March 2026, Gemini API and AI Studio usage are excluded from the $300 Google Cloud Welcome credit for accounts opened after March 2, 2026.
Are failed requests billed on the Gemini API?
If your request fails with an HTTP 400 or 500 error, you are not charged for the tokens used. The failed request still counts against your rate limit quota.
Sources
Updated