Nano Banana 2 is the community name for Google's Gemini 3.1 Flash Image model. On Router One it is listed as gemini-3.1-flash-image-preview, sits in the image category of the catalog next to its sibling Nano Banana Pro (gemini-3-pro-image-preview), and is called through the same OpenAI-compatible Images API as every other image model on the gateway — one key, one wallet, a cost trace per request.
This guide is the hands-on part: the exact request for text-to-image, the exact request for editing with a reference image, what the model does and does not accept, how it is billed, and how to decide between Nano Banana 2 and Nano Banana Pro without guessing.
Names, IDs, and Prices
This guide covers two of the Google image models in the catalog, and the nicknames are easy to mix up (Nano Banana 2.1, listed as of the 2026-10-09 catalog, has its own section below):
| Community name | Model ID on Router One | Unit price (Aug 2026) |
|---|---|---|
| Nano Banana 2 | gemini-3.1-flash-image-preview | $0.50 per image |
| Nano Banana Pro | gemini-3-pro-image-preview | $0.50 per image |
Both are unit-priced: one flat USD amount per generated image, no token math on the output. Both are the same price on Router One at the time of writing — the live number is always on the Gemini 3.1 Flash Image Preview model page — so the choice between them is about output, not budget. More on that below.
Nano Banana 2.1
Google released Gemini Nano Banana 2.1 on October 6, 2026 as an update to Nano Banana 2, per the Gemini API release notes (checked 2026-10-09). Router One lists it as gemini-nano-banana-2.1 as of the 2026-10-09 catalog: text and image input, image output, billed per generated image — its live unit price is on the Gemini Nano Banana 2.1 model page. It takes the same two calls as Nano Banana 2: put gemini-nano-banana-2.1 in model on POST /v1/images/generations, or send a reference image to POST /v1/images/edits. The size and quality notes below were written for Nano Banana 2; Google's model page (checked 2026-10-09) lists 1K, 2K and 4K output for 2.1 and its release notes describe improved wide and panoramic aspect-ratio generation, so describe the framing you want in the prompt and check the result.
Setup
Create an API key in the Router One dashboard and top up the wallet. From Mainland China the endpoint is reachable without a VPN, and Alipay works on the hosted checkout — see Alipay top-ups. Then point your client at the gateway:
export ROUTER_ONE_KEY=sk-your-router-one-key
export OPENAI_BASE_URL=https://api.router.one/v1
If you already use the key for chat models, nothing changes — the image endpoints are on the same key.
Text-to-Image: POST /v1/images/generations
The request is the OpenAI Images API shape: a JSON body with model and prompt. Add n to get several candidates from one call.
curl -X POST https://api.router.one/v1/images/generations \
-H "Authorization: Bearer $ROUTER_ONE_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-3.1-flash-image-preview",
"prompt": "Isometric illustration of a night market, warm lantern light, no text",
"n": 2}'
Two things about this model specifically:
size,quality, andresponse_formatdo not apply. Send them and they are ignored; the prompt is what steers the output. Put composition and framing instructions in the prompt text.- The response can carry either
data[].b64_jsonordata[].url. Most images come back inline as base64, but a URL is possible. Handle both branches and save the file promptly rather than assuming one shape.
With the official OpenAI Python SDK:
import base64, httpx
from openai import OpenAI
client = OpenAI(base_url="https://api.router.one/v1", api_key="sk-your-router-one-key")
result = client.images.generate(
model="gemini-3.1-flash-image-preview",
prompt="Isometric illustration of a night market, warm lantern light, no text",
n=2,
)
for i, item in enumerate(result.data):
png = base64.b64decode(item.b64_json) if item.b64_json else httpx.get(item.url).content
with open(f"night-market-{i}.png", "wb") as f:
f.write(png)
Every image the call returns is billed at the unit price — n: 2 is two images and two units. The full field reference is in the Images API docs.
Editing With a Reference Image: POST /v1/images/edits
Nano Banana 2 lists image input in the catalog, so you can hand it a picture and describe the change. That goes to the edits endpoint, which is multipart/form-data rather than JSON: the reference goes in the image field, the instruction in prompt.
curl -X POST https://api.router.one/v1/images/edits \
-H "Authorization: Bearer $ROUTER_ONE_KEY" \
-F model=gemini-3.1-flash-image-preview \
-F image=@teapot.png \
-F prompt="Place this teapot on a marble counter in soft morning light, keep the label readable"
Repeat -F image=@... to pass more than one reference — a product shot plus a style board, for example. The SDK call is client.images.edit(model=..., image=open("teapot.png", "rb"), prompt=...), and the response has the same data[] shape as generations, so the same save-both-branches code works. Reference files are capped at 25 MB each.
Typical uses: restyling product photos, swapping backgrounds, turning a sketch into a rendered scene, or producing a consistent series from one hero image.
Nano Banana 2 or Nano Banana Pro?
Because both models cost the same per image on Router One and take the same request, the honest answer is: run your own prompts through both. The gateway makes that a one-line change — same key, same endpoint, swap the model string — and every image request the gateway sends to a model lands in Dashboard → Logs (per-request trace) with model, cost, latency, and status, so the comparison is a filter, not a spreadsheet.
Practical guidance from that kind of A/B:
- Start with Nano Banana 2 for volume work — thumbnails, variations, iterating on a prompt until the composition is right.
- Send the shortlisted prompts to Nano Banana Pro and keep whichever output your reviewers prefer. If the Pro output is not visibly better for your use case, there is no cost reason to use it.
- Keep the same reference-image workflow for both; both accept edits.
Keeping the Bill Predictable
Image pipelines are where usage surprises happen, and n multiplies quietly. The gateway's standard controls apply:
- Per-key budgets. Give the image pipeline its own key with a spend cap so a runaway batch stops at the cap instead of draining the wallet (per-key cost tracking).
- Per-request traces. The cost of each generation, in the same log as your chat traffic — finance sees what a campaign's assets actually cost.
- Flat unit pricing. Cost forecasting is images × unit price. No token estimation.
FAQ
Is Nano Banana 2 the same thing as gemini-3.1-flash-image-preview?
Yes. Nano Banana 2 is the community name; gemini-3.1-flash-image-preview is the model ID you put in the request. Nano Banana Pro is the Pro tier of the same line, gemini-3-pro-image-preview.
Is Nano Banana 2 cheaper than Nano Banana Pro on Router One? No. As of August 2026 both are $0.50 per image on Router One. Check the catalog for the live figure, and choose by output quality on your prompts rather than by price.
Can I set the image size or quality?
Not for this model. size, quality, and response_format are accepted but ignored on Nano Banana 2 — describe the framing you want in the prompt instead.
How do I use my own image as the starting point?
Use POST /v1/images/edits with multipart/form-data: the reference in the image field, the instruction in prompt. Generations is JSON and takes text only.
Does the response contain a URL or base64?
Either. Handle data[].b64_json and data[].url in the same loop and save the bytes as soon as you have them.
Which should I use: Nano Banana 2 or Nano Banana 2.1?
Both are in the catalog as of 2026-10-09 and take the same request. Google describes 2.1 as an update to Nano Banana 2 with better visual quality, text rendering and multi-turn character consistency (per the Gemini API release notes, checked 2026-10-09); run your own prompts through both — swap the model string, compare the images each returns, and compare each request's cost in Dashboard → Logs.
Does it work from Mainland China? Yes. The endpoint is reachable without a VPN, and the wallet can be topped up with Alipay, WeChat Pay or a card on hosted checkout, or with USDT/USDC on six chains.
Conclusion
Nano Banana 2 is a one-line change for anyone already on the gateway: put gemini-3.1-flash-image-preview in model, send a prompt, save whichever of b64_json or url comes back. Edits with a reference image are one multipart call away, billing is per image, and the same key that runs your chat models runs this.
Start on the image generation API page for the endpoint surface, check the Gemini 3.1 Flash Image Preview model page for the live price, and create a key at router.one to make the first call.