Gemini 3.1 Flash Image — fast image generation from 512px to 4K
Gemini 3.1 Flash Image is Google's general-purpose image model: 512px drafts to 4K finals, 14 aspect ratios, image, video and PDF references. Keep your generateContent body. From $0.03 per image.
- Text to image
- Image editing
- 512px to 4K
- 14 aspect ratios
- Up to 14 references
- Video and PDF input
Try Gemini 3.1 Flash Image before you write any code
Run Gemini 3.1 Flash Image with the exact JSON your code will send. Every generateContent field the endpoint takes is here.
gemini-3.1-flash-image-official$45.00 / 1M image output tokens
Describe an image, add references if you have them, and submit once. The result appears when the task completes.
What to create or change. Subject, setting, lighting and style.
Images, videos or PDFs the model should read. Files are uploaded and sent as URLs.
Up to 14, sent as fileData URLs.
Default matches your first reference, otherwise 1:1.
Output resolution. 1K is the default.
Image only, or image with a short text reply.
Standing rules for the model, such as a house style.
Blocking threshold for this category.
Greyed-out options relax content filtering. They are available through the API only, not in the playground.
Blocking threshold for this category.
Greyed-out options relax content filtering. They are available through the API only, not in the playground.
Blocking threshold for this category.
Greyed-out options relax content filtering. They are available through the API only, not in the playground.
Blocking threshold for this category.
Greyed-out options relax content filtering. They are available through the API only, not in the playground.
0–2. Leave empty for the model default.
0–1. Leave empty for the model default.
Whole number, 1 or more.
Whole number. Reuse it to reproduce a result more closely.
Caps text and thinking output.
One per line, up to 5.
Only 1: one request returns one image.
How many tokens each reference uses. Lower is cheaper.
Return the model's thought summary with the image.
IMAGE_JPEG is the one documented value.
Applies only when aspect ratio above is Default; when both are set, aspect ratio wins.
Applies only when image size above is Default; when both are set, image size wins.
Estimated at current rates from the image tokens of the selected size plus a measured sample of text and thinking tokens. Reference inputs add a little on Official.

Try one of these prompts



Sample images generated with Gemini 3.1 Flash Image through this API
Gemini 3.1 Flash Image pricing
Two ways to pay for Gemini 3.1 Flash Image. Standard is one flat price per image at any size. Official bills the tokens each render reports, so small images cost less and 4K costs more.
- Official
- $0.05132/image
- Standard
- $0.03/image
- Official
- 389images
- Standard
- 666images
Both prices come from the rates that bill your account. Failed requests are not charged.
Official estimates use the image tokens Google publishes for each size, plus a measured sample of 405 text and thinking tokens and 27 prompt tokens.
Gemini 3.1 Flash Image cost by image size
Google publishes the image tokens for each Gemini 3.1 Flash Image size, from 747 at 512px to 2,520 at 4K. Official prices below add a measured text and thinking sample.
| Image size | Image tokens | Price · Official | Price · Standard |
|---|---|---|---|
| 512 | 747 | $0.03454 | $0.03 |
| 1K | 1,120 | $0.05132 | $0.03 |
| 2K | 1,680 | $0.07652 | $0.03 |
| 4K | 2,520 | $0.11432 | $0.03 |
Standard is one flat price per image at every size. Official follows the image tokens, so larger sizes cost more.
Price your own Gemini 3.1 Flash Image request
Pick a size and watch the figure. It is computed from the live rate and the image tokens Google publishes for each size, so it moves when the price does.
A pre-submit estimate. Standard bills each delivered image; Official bills image output, text and thinking output, and input at their own rates.
| Item | How it is measured | Rate | Billing |
|---|---|---|---|
| Official · Image output | Image tokens reported for the render | $45.00 / 1M$60.00 / 1M | Charged from real usage |
| Official · Text and thinking output | Text and thinking tokens reported for the render | $2.25 / 1M$3.00 / 1M | Charged from real usage |
| Official · Input | Prompt and reference tokens | $0.375 / 1M$0.50 / 1M | Charged from real usage |
| Standard · Per image | Each delivered image, any size | $0.03 /image$0.04 /image | Charged when the image is delivered |
| Failed requests | Any task that ends failed | Free | Nothing is charged |
What is Gemini 3.1 Flash Image?
Gemini 3.1 Flash Image is Google's image generation and editing model, sold under the name Nano Banana 2. Google describes it as its most versatile image model, balancing speed with 4K output, world knowledge and reliable text rendering.
On SeedRouter you call Gemini 3.1 Flash Image with Google's own generateContent request body plus a model field. Submit once, keep the task ID, and read a hosted image URL when the task completes.
Model ID: gemini-3.1-flash-image · Token billing ID: gemini-3.1-flash-image-official · Input limit: 131,072 tokens.
Two ways to use Gemini 3.1 Flash Image
Call the API from your backend, or hand the job to a coding agent.
Call the API
Send the Gemini 3.1 Flash Image request from your server, keep the task ID, and read the finished image from the task.
- 1Create an API key
- 2POST the request body
- 3Poll the task until it completes
Let an agent do it
Copy a ready prompt into Claude Code, Codex or Cursor. It asks before spending and downloads the result.
- 1Copy the prompt
- 2Fill in what you want
- 3Approve the request
Why developers pick Gemini 3.1 Flash Image
The default Gemini image model: quick, flexible and cheap to draft with.
Google's request body
Gemini 3.1 Flash Image takes the same contents and generationConfig you would send to Google. Add a model field and you are done.
Four output sizes
Draft at 512px and finish at 4K with the same Gemini 3.1 Flash Image request.
Extreme ratios
Gemini 3.1 Flash Image adds 1:4, 4:1, 1:8 and 8:1 for banners and tall formats.
Video and PDF references
Point Gemini 3.1 Flash Image at a clip or a product sheet, not just photos.
14 references
Combine up to 14 references in one Gemini 3.1 Flash Image request, passed as fileData URLs.
Task-based
Gemini 3.1 Flash Image renders never hold your connection open. You poll a task and get a URL.
What teams build with Gemini 3.1 Flash Image
Catalogue images
Gemini 3.1 Flash Image cleans up product photos at volume.
Social formats
Square, vertical and wide Gemini 3.1 Flash Image versions from one prompt.
Banners
Gemini 3.1 Flash Image fills 8:1 and 1:8 layouts without cropping.
Cheap drafts
Iterate with Gemini 3.1 Flash Image at 512px, then render the keeper at 4K.
From documents
Turn a PDF brief into a visual with Gemini 3.1 Flash Image.
Edits
Change a background, a color or an object with Gemini 3.1 Flash Image and keep the rest.
Start with Gemini 3.1 Flash Image in four steps
- 01
Create a key
Sign in, top up any amount, and create an API key. Credits never expire.
- 02
Send one request
POST the Gemini 3.1 Flash Image body to /v1/images/generations with your prompt and any reference URLs.
- 03
Poll the task
Keep the task ID and check it every few seconds until the status is completed.
- 04
Download the image
Save the hosted image URL from the task output to your own storage.
Gemini 3.1 Flash Image at a glance
The facts that decide whether Gemini 3.1 Flash Image fits the job.
| Feature | Gemini 3.1 Flash Image |
|---|---|
| Model ID | gemini-3.1-flash-image |
| Output sizes | 512, 1K, 2K, 4K |
| Aspect ratios | 14 (1:8 to 8:1) |
| References | Up to 14 |
| Reference types | Image, video, PDF |
| Billing | Per image (Standard) or per token (Official) |
For the most complex visual tasks, see Gemini 3 Pro Image. For the lowest cost at 1K, see Gemini 3.1 Flash Lite Image.
Before you move Gemini 3.1 Flash Image code over
The preview ID still works
Google retired gemini-3.1-flash-image-preview on June 25, 2026. Here it still runs, served by gemini-3.1-flash-image.
URLs, not inlineData
Send Gemini 3.1 Flash Image references as fileData URLs. Base64 inlineData is refused before anything is charged.
No Search grounding yet
Gemini 3.1 Flash Image requests with tools are refused for now.
One image per request
candidateCount is 1. Send several Gemini 3.1 Flash Image requests for a batch.
Why run Gemini 3.1 Flash Image on SeedRouter
Two ways to pay
Pick Standard for one flat price per Gemini 3.1 Flash Image image, or Official to pay for the tokens each render reports. Same key, same request body.
Failed requests are free
If a task ends failed, nothing is charged. You only pay for images that are delivered.
Credits never expire
Top up once and use the balance whenever you need it. No subscription.
Hosted results
Finished images come back as URLs on our CDN. Keep a copy of anything you need long term.
One key for every model
The same key and balance work for the other image models in the catalogue.
Other image models on SeedRouter
Same key, same balance, same task API.
Create and edit images with GPT Image 2 on SeedRouter. Use text prompts, reference images and transparent backgrounds, with a live playground and usage-based pricing.
View pricingGenerate and edit images with GPT Image 2.5 Flare or Sunburst on SeedRouter. Six quality steps up to max, transparent backgrounds, a live playground and pay-as-you-go pricing.
View pricingUse Gemini 3 Pro Image (gemini-3-pro-image) with Google's generateContent body: 1K to 4K, built-in thinking, 14 references. Pay per image or per token.
View pricingUse Gemini 3.1 Flash Lite Image (gemini-3.1-flash-lite-image), Google's fastest and cheapest image model, with its generateContent body. 1K output.
View pricingGemini 3.1 Flash Image guides
Practical guides to choosing, pricing and integrating the model.
Is Nano Banana free? What the Gemini app and the Gemini API include for Nano Banana 2 and Nano Banana Pro without paying, and when you start paying.
Use the Nano Banana 2 API step by step: create a key, send a generateContent request, poll the task, add reference images, and let a coding agent run it.
Compare Nano Banana 2, Nano Banana Pro and Nano Banana 2 Lite on image size, aspect ratios, references, thinking and billing, and pick one per job.
Current Nano Banana API pricing for Nano Banana 2, Pro and 2 Lite: flat per-image and token billing, cost by resolution, and when each billing fits.
Gemini 3.1 Flash Image FAQ
Is Gemini 3.1 Flash Image the same as Nano Banana 2?+
Yes. Nano Banana 2 is Google's product name for Gemini 3.1 Flash Image, and the model ID is gemini-3.1-flash-image. The Nano Banana 2 page covers the same model from a product angle.
Is there a Gemini 3 Flash Image?+
No. The Flash image model in the Gemini 3 family is Gemini 3.1 Flash Image, model ID gemini-3.1-flash-image. Searches for Gemini 3 Flash Image usually mean this model.
Is gemini-3.1-flash-image-preview still available?+
Google shut the preview ID down on June 25, 2026. On SeedRouter gemini-3.1-flash-image-preview is still accepted and runs on gemini-3.1-flash-image, so old code keeps working while you switch the ID.
How much does Gemini 3.1 Flash Image cost?+
A 1K image costs $0.03 on Standard, whatever the prompt. On Official you pay for the tokens each render reports; a typical 1K render comes to about $0.05132. The pricing section shows every size at the live rate.
Is Gemini 3.1 Flash Image free?+
Google's pricing page lists no free tier for Gemini 3.1 Flash Image on the Gemini API. On SeedRouter you top up once, credits never expire, and failed requests are not charged.
Do I need to change my Gemini request?+
Keep contents, systemInstruction, safetySettings and generationConfig as they are. Add a model field, send it to /v1/images/generations, and read the Gemini 3.1 Flash Image result from the task.
How do I get an API key for Gemini 3.1 Flash Image?+
Sign in, top up any amount and create a key on the API keys page. The same key works for Gemini 3.1 Flash Image and every other model here.
Gemini 3.1 Flash Image or Gemini 3 Pro Image?+
Start with Gemini 3.1 Flash Image for speed, 512px drafts, extreme ratios and video or PDF references. Move to Gemini 3 Pro Image for complex instructions and professional assets.
Send your first Gemini 3.1 Flash Image request
Try Gemini 3.1 Flash Image in the Playground, then paste the same JSON into your code.
