Generate imagesLarge Language ModelsVisual Effects
Gemini Image API Pricing: Rate Limits, Resolution and Python
A working breakdown of what the Gemini image API costs in practice: per-image prices at 1K, 2K and 4K, batch discounts, rate limits by usage tier, and Python code for generation, retries and cost tracking, with monthly bills worked out for small and large volumes.
A single Gemini image costs anywhere from about three cents to twenty-four cents, and the gap between those two numbers is where most budgets go sideways. Pick the wrong model, ask for 4K when 1K would do, or skip batch mode on a nightly job, and the same 10,000 images can cost you $336 or $2,400. This article takes the real numbers from Google's pricing and rate limit pages, turns them into monthly bills, and ends with Python you can paste into a script today.
💡 Source and date: every price below was read from Google's published Gemini API pricing page in October 2026. Google adjusts these rates, so check the live page before you lock in a budget.
Four Models, Four Price Points
Google sells its native image generation under the Nano Banana name, and the API exposes four models. Three are current and one is legacy. None of the current models has a free tier, so the very first test call is billed. Every output also carries a SynthID watermark.
Nano Banana 2 Lite is the volume play. Thumbnails, product variations and draft passes at roughly 3.4 cents each, with one catch: it outputs 1K only.
Nano Banana 2 is the default for production work. It spans 0.5K to 4K, supports Google Search grounding (including image search grounding on this model), and costs 6.7 cents for a 1K image.
Nano Banana Pro is the premium option, which Google positions for complex visual tasks. It runs 13.4 cents at 1K or 2K, so use it where one reroll on a cheaper model would cost you more in time than the price gap costs in cash.
All of them accept reference images, up to 14 depending on the model, so you can pass a product shot or a style sample alongside the prompt.
Moving Off the Legacy Model
Google's docs call gemini-2.5-flash-image the legacy pioneer of the series and recommend switching to Nano Banana 2 Lite for better quality, faster generation and lower API pricing. If you still call it in production, start by swapping the model ID and re-checking a handful of your own prompts. You can also compare outputs side by side on PicassoIA, where Gemini 2.5 Flash Image is still listed, before you change a single line of code.
Per-Image Pricing by Resolution
Google bills image output in tokens, but it also publishes a flat per-image price for each resolution, and that is the number you actually budget with.
Two patterns stand out. Nano Banana 2 charges 1.5 times more at 2K and 2.25 times more at 4K than at 1K. Nano Banana Pro keeps 1K and 2K at the same price, which makes 2K the sensible default there, then jumps about 79 percent at 4K.
Input is billed too: $0.50 per million tokens on Nano Banana 2, $0.25 on Lite and $2.00 on Pro. A prompt of a few hundred tokens adds a fraction of a cent, so image output dominates the bill unless you attach many reference images.
Batch Mode Halves the Bill
Batch pricing is half of standard on every model. Nano Banana 2 drops to $0.034 at 1K, $0.050 at 2K and $0.076 at 4K. Nano Banana Pro gets the same 50 percent reduction. The output rate on Nano Banana 2 Lite falls from $30 to $15 per million tokens, which is about 1.7 cents per image.
Batch jobs are asynchronous, so they suit nightly catalog renders, bulk thumbnail refreshes and anything where nobody is waiting. They do not suit a button a user just clicked.
Token Math Behind the Price
Divide each per-image price by the output rate and you get the token count per image. Nano Banana 2 at $0.067 and $60 per million works out to about 1,120 tokens for a 1K image, about 1,680 at 2K and about 2,520 at 4K. These counts are derived from Google's price table, not quoted from it, but they explain the shape of the pricing.
Nano Banana Pro at $0.134 and $120 per million also lands near 1,120 tokens at 1K, while its 4K price of $0.24 implies about 2,000 tokens. That makes the premium shrink at 4K: $0.24 against $0.151 is 1.6 times, versus exactly 2 times at 1K.
One practical rule falls out of this. Rerolls are real spend, and a prompt that needs three tries costs three images.
Rate Limits Without the Guesswork
Rate limits decide whether your pipeline runs smoothly or stalls at 2 a.m. behind a wall of errors. The Gemini API enforces them per project, and a few details are easy to miss.
RPM, IPM and RPD Explained
Google evaluates usage on three axes: requests per minute (RPM), tokens per minute (TPM) and requests per day (RPD). For image models the docs replace TPM with images per minute (IPM). Exceed any single line and the request fails, even if the other two sit far below their ceiling.
Three details trip people up:
Limits are per project, not per credential. A second access token inside the same project gives you no extra room.
The daily counter resets at midnight Pacific time. Not UTC, and not your local midnight.
Exact numbers are per model. Google does not print them in the docs table. They live on your own AI Studio rate limit page (aistudio.google.com/rate-limit) and change with your tier, so this article quotes no figures that would go stale.
Usage Tiers and Spend Caps
Your tier follows how much you have spent:
Tier
How you qualify
Spend limit
Cap per 10 minutes
Free
Active project or free trial
n/a
Not listed
Tier 1
Active billing account
$250
$10
Tier 2
$100+ spent and 3 days elapsed
$2,000
$50
Tier 3
$1,000+ spent and 30 days elapsed
$20,000 to $100,000+
$200
Beyond RPM and IPM, Google applies spending caps over a rolling 10-minute window. Break one and you get a 429 RESOURCE_EXHAUSTED error. For image work this cap often bites before RPM does, because every call is expensive. Applied to image prices, it works out roughly like this:
Nano Banana 2 at 1K ($0.067): about 149 images per window on Tier 1, 746 on Tier 2 and 2,985 on Tier 3.
Nano Banana Pro at 4K ($0.24): only about 41 images per window on Tier 1.
That is my arithmetic from the published caps, so treat it as a planning estimate and confirm your real limits in AI Studio.
Handling 429 Errors
Treat a 429 as a normal event, not an exception. Three habits keep a pipeline healthy:
Retry with exponential backoff and jitter, starting near one second and doubling up to a ceiling.
Throttle on your side. Size a token bucket below your tier's ten-minute spend cap so you never trigger it.
Move non-urgent work to batch mode, which halves the price and keeps long jobs out of the interactive path.
The helper in the Python section below implements the first habit.
Resolution and Aspect Ratio Choices
Gemini 3 image models generate at 1K by default. Supported sizes are 512px (0.5K), 1K, 2K and 4K, and Nano Banana 2 Lite stops at 1K. The Google table I read showed no price for the 0.5K tier on Nano Banana 2, and third-party trackers quote about $0.045, so confirm that one on the live page before you rely on it.
Match the size to the destination:
Blog thumbnails, social posts, product listings: 1K.
Hero banners and high-density displays: 2K.
Print and large crops: 4K, and only for final selects.
A cheaper route to large files is to generate at 1K and run the winner through a super-resolution model. On PicassoIA, Real ESRGAN and Google's Upscaler both enlarge photos 4x, and Clarity Pro Upscaler targets photorealistic results. Upscalers add sharpness rather than new content, so test one against a native 4K render of your own images before you commit.
Aspect ratio deserves the same care. Ten are available: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9 and 21:9. Choose before you generate. A 16:9 render cropped into a 4:5 feed post throws away more than half the frame, and every reroll is another billed image.
Python Code That Works
Install the SDK with pip install google-genai and set your Gemini credential as an environment variable. The client reads it automatically, so no secrets appear in your source.
The Basic Interactions Call
Google's current docs generate images through the Interactions API. This is the minimal version, adapted from their sample:
import base64
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.1-flash-image",
input="A ceramic mug of black coffee on an oak desk, morning window light, 35mm photo",
)
with open("generated_image.png", "wb") as f:
f.write(base64.b64decode(interaction.output_image.data))
The image comes back as base64 in interaction.output_image.data, which is why it is decoded before writing. You get a 1K image by default, and the thinking level defaults to minimal.
Set Size and Aspect Ratio
The response_format argument controls output type, ratio and size:
interaction = client.interactions.create(
model="gemini-3.1-flash-image",
input="Overhead photo of a croissant on a linen placemat, soft window light",
response_format={
"type": "image",
"mime_type": "image/jpeg",
"aspect_ratio": "16:9",
"image_size": "2K",
},
)
For follow-up edits, pass previous_interaction_id=interaction.id with a new input and the model edits the previous result. On a hard prompt you can raise reasoning with generation_config={"thinking_level": "high"}. Check your billing dashboard after a small test run before enabling it everywhere.
Retries and Cost Logging
Production code needs two things the sample lacks: backoff on 429 and a running cost counter.
import base64
import random
import time
from google import genai
client = genai.Client()
PRICE = {
("gemini-3.1-flash-lite-image", "1K"): 0.0336,
("gemini-3.1-flash-image", "1K"): 0.067,
("gemini-3.1-flash-image", "2K"): 0.101,
("gemini-3.1-flash-image", "4K"): 0.151,
("gemini-3-pro-image", "1K"): 0.134,
("gemini-3-pro-image", "2K"): 0.134,
("gemini-3-pro-image", "4K"): 0.24,
}
total = 0.0
def generate(prompt, model="gemini-3.1-flash-image", size="1K", ratio="16:9", retries=5):
global total
for attempt in range(retries):
try:
interaction = client.interactions.create(
model=model,
input=prompt,
response_format={
"type": "image",
"mime_type": "image/jpeg",
"aspect_ratio": ratio,
"image_size": size,
},
)
total += PRICE[(model, size)]
return base64.b64decode(interaction.output_image.data)
except Exception as err:
if getattr(err, "code", None) != 429 or attempt == retries - 1:
raise
time.sleep(2 ** attempt + random.random())
image = generate("Overhead photo of a croissant on a linen placemat, soft window light")
with open("croissant.jpg", "wb") as f:
f.write(image)
print(f"Spent so far: ${total:.3f}")
The prices in the dictionary come straight from the tables above, so update them whenever Google changes its rates. Log total after each run and you will see the bill before the invoice does.
Real Monthly Cost Examples
Numbers beat adjectives, so here are monthly bills at two volumes. Every figure is image count times the published per-image price, with no input-token or reference-image extras.
A small catalog or a busy blog lives here. Even the most expensive row stays at $240, so at this volume the model choice is about quality, not cost. A month of Nano Banana 2 at 2K reaches $101, just past the $100 line for Tier 2.
At this scale the choices compound. The spread between Lite in batch ($840) and Pro at standard rates ($6,700) is $5,860 a month, nearly eight times. Spending $3,350 a month crosses the $1,000 Tier 3 line in about nine days, but the 30-day wait still applies, so plan your first month around Tier 2 limits. A steady load of about 1,700 images a day sits nowhere near the $50 ten-minute cap. Bursts are what trigger it.
Use Nano Banana 2 Lite on PicassoIA
Before you spend API money on prompt experiments, test them where iterations are cheap. Nano Banana 2 Lite is available on PicassoIA as a fast, low-cost text-to-image model with image editing built in.
Write the prompt. Name the subject, the light direction, the lens and the surface textures.
Add reference images if you need them. The image input accepts up to 14 images to blend or restyle.
Choose an aspect ratio. The default is match_input_image. Presets run from 1:1 to 21:9, plus tall and wide extremes such as 1:4, 4:1, 1:8 and 8:1.
Pick jpg or png as the output format.
Generate, compare, and keep the wording of the winning prompt for your Python script.
💡 Tip: prompts that work well on the hosted model should carry over closely to the API, though results are never identical across platforms. Run a few side-by-side checks before you scale up.
If you draft prompts in bulk, Gemini 3.5 Flash on PicassoIA is a fast text model for writing prompt variations. Testing there does not touch your Gemini quota or your Google bill.
Try Your Own Prompts on Picasso IA
Pricing tables only go so far. The fastest way to find out which model, size and ratio suit your project is to generate a few images and look at them. Open Picasso IA, try Nano Banana 2 Lite with a prompt from your own catalog, then compare the result against Nano Banana 2 and Nano Banana Pro. Browse the full model list at picassoia.com/en/all-models, pick the output you like, and carry that choice into your API budget with real numbers behind it.