image_generate.gemini_3_1_flash_image_t2i
google/nano-banana-2/text-to-image

The Nano Banana 2 API generates images (Gemini 3.1 Flash Image) from natural-language prompts. Up to 4K output, four resolution tiers, 14 aspect ratios, PNG or JPEG — all through one REST endpoint, priced 5% below Google's published rate.

Input
The text prompt sent to the model
Output
Sample edited image — run the model to replace this previewSampleRun the model to replace this preview

Nano Banana 2 API: Text to Image

Use the Nano Banana 2 API to generate images from natural-language prompts.

Nano Banana 2 API generates images (Gemini 3.1 Flash Image) from natural-language prompts. Four resolution tiers (0.5K–4K), 14 aspect ratios, PNG or JPEG output — all through one REST endpoint.

Pricing on the Nano Banana 2 API is 5% below Google's published rate, held flat across tiers. Optional grounding (web/image search) costs $0.014 per request. The Nano Banana 2 API uses one RouterBase key — no provider-specific SDKs.

Why this model

Six reasons teams ship on the Nano Banana 2 API

From production-grade text-to-image to 5% off official pricing — what the Nano Banana 2 API gets right.

Natural-language generation

Describe the image; the Nano Banana 2 API renders it. No prompt-engineering tricks required.

0.5K to 4K output

Sample at 0.5K, finalise at 4K — switch resolution per call, no code changes.

14 aspect ratios

From 1:1 squares to 21:9 cinematic banners, set per-call as one string parameter.

5% off official

Pay 5% less than Google's published rate; the Nano Banana 2 API discount is flat across tiers.

REST + JSON

One endpoint, one key, no SDK lock-in. Plain JSON in, signed URL out.

Optional grounding

Plug Google web/image search into the Nano Banana 2 API for $0.014 per request.

RouterBase dashboard preview
Quickstart

Get started with the Nano Banana 2 API in 3 steps

From sign-up to your first Nano Banana 2 API call in under 5 minutes.

  1. Create a RouterBase API key

    Sign up and generate sk-rb-… — one key works for the Nano Banana 2 API and 200+ other models.

  2. POST to the Nano Banana 2 API endpoint

    Send a prompt in JSON. The Nano Banana 2 API returns a signed URL within seconds.

  3. Inspect the result

    Each Nano Banana 2 API response includes generation metadata for auditing and a render URL ready to embed.

Pricing

Pay only for what you use

RouterBase passes through partner-tier pricing. Compared against the model's official published API rate.

ResolutionRouterBaseOfficialSave
0.5K $0.038$0.045−15%
1K $0.057$0.067−15%
2K $0.086$0.101−15%
4K $0.128$0.151−15%
web_search=true +$0.013+$0.015−15%
image_search=true +$0.013+$0.015−15%

Your request will cost $0.057 per run (1K).With $1 you can run this model approximately 17 times.

Customer stories

What teams build with this image-generation model

Real production loads running on the Nano Banana 2 API and the RouterBase model catalog.

Marcus Reyes
Marcus ReyesCTO, Paradigm AI

We rendered 200 marketing creatives a day through this model. Our weekly cycle dropped to overnight.

Priya Lakshmi
Priya LakshmiFounder, Quillo

We swapped three providers through RouterBase in one line of code when OpenAI had its outage. Our users never noticed.

Thomas Beck
Thomas BeckStaff Engineer, Northbeam

Generating product hero shots from a single prompt with the Nano Banana 2 API saves us a photoshoot per quarter.

Aoi Tanaka
Aoi TanakaML Lead, Daybreak Robotics

The Nano Banana 2 API became our default for synthetic data thumbnails. Pipeline went from days to hours.

Jonas Keller
Jonas KellerIndie Developer

Plugged the Nano Banana 2 API into my existing OpenAI SDK with one base URL swap — less work than writing this testimonial.

Ethan Nguyen
Ethan NguyenHead of Engineering, Compound Studio

RouterBase puts 200+ models behind one key. Our research team stopped asking for new provider accounts.

Sophia Martín
Sophia MartínCTO, Relay

Generated 4K hero banners through the Nano Banana 2 API at one-fifth our previous cost.

Lucas Fernandes
Lucas FernandesEngineering Manager, Light

We migrated 42 services to RouterBase over a weekend. The only PR comment we got was 'wait, that's all?'.

David Okonkwo
David OkonkwoCo-founder, Figment

Pricing on the Nano Banana 2 API is 5% below Google's published rate — at our scale that's six figures saved per quarter.

Frequently Asked Questions

Common questions about the Nano Banana 2 API.

The Nano Banana 2 API is RouterBase's pass-through to Google Nano Banana 2 (Gemini 3.1 Flash Image). It generates images from natural-language prompts with 0.5K to 4K resolution, 14 aspect ratios, and PNG/JPEG output.