Pricing Table
Gemini model price table used to calculate the cost of generations, with values in dollars per million tokens and per image.
On this page
Source: src/image_generation/cost_calculator/pricing_table.py. This page's original notebook was empty; the content was written from the code.
#Overview
The file defines the ModelPricing dataclass, the PricingTable class and the BEST_TO_WORST_MODELS list. The prices follow the Gemini API pricing page, cited in a comment in the code. The table version is in PricingTable.VERSION (2026-02-11).
#ModelPricing
| Field | Type | Description |
|---|---|---|
input_per_million_tokens | float | Price per million input tokens. |
output_per_million_tokens | float | Price per million output tokens. |
image_price_per_unit | float or None | Price per generated image. |
cache_input_per_million_tokens | float or None | Price per million input tokens read from the cache. |
cache_storage_per_million_tokens_per_hour | float or None | Cache storage price, per million tokens per hour. |
The dataclass is frozen: the values do not change after creation.
#Registered prices
| Model | Input | Output | Per image | Cache (input) | Cache (storage/hour) |
|---|---|---|---|---|---|
gemini-3-flash-preview | 0.50 | 3.00 | - | 0.05 | 1.00 |
gemini-3-pro-image-preview | 2.00 | 12.00 | 0.134 | - | - |
gemini-2.5-flash | 0.30 | 2.50 | - | 0.03 | 1.00 |
gemini-2.5-flash-preview-09-2025 | 0.30 | 2.50 | - | 0.03 | 1.00 |
gemini-2.5-flash-lite | 0.10 | 0.40 | - | 0.01 | 1.00 |
gemini-2.5-flash-lite-preview-09-2025 | 0.10 | 0.40 | - | 0.01 | 1.00 |
gemini-2.5-flash-image | 0.30 | 0.0 | 0.039 | - | - |
gemini-2.0-flash | 0.10 | 0.40 | 0.039 | 0.025 | 1.00 |
Values in dollars: input, output and cache per million tokens; image per unit. A dash means None.
In gemini-2.5-flash-image, the output is an image; that is why the per-token output price is 0.0 and the cost comes from the per-image price.
Single resolution. The price of gemini-3-pro-image-preview (0.134) applies to 1K and 2K. The comment in the code records that 4K costs 0.24 and that the table does not yet distinguish the resolution.
#get
PricingTable.get(model) is a classmethod that returns the model's ModelPricing. If the model is not registered, it raises ValueError ("Modelo sem precificação cadastrada").
from src.image_generation.cost_calculator.pricing_table import PricingTable
# Look up the price of a model
pricing = PricingTable.get("gemini-2.5-flash-image")
print(pricing.image_price_per_unit)
# Price table version
print(PricingTable.VERSION)#BEST_TO_WORST_MODELS
List of the models, from best to worst, in the order defined in the code:
gemini-3-pro-image-previewgemini-3-flash-previewgemini-2.5-flashgemini-2.5-flash-preview-09-2025gemini-2.5-flash-imagegemini-2.0-flashgemini-2.5-flash-lite-preview-09-2025gemini-2.5-flash-lite
The use of this table is in Cost Calculator.
Source: src/image_generation/cost_calculator/pricing_table.py