Nano Banana

Google · 3 models · Text, Image → Text, Image

POSThttps://onerouter.com/v1/images/generations

How to call

Pass any model ID from this series in the model field, e.g. google/gemini-3.1-flash-image-preview. The example on the right uses Nano Banana 2.

Overview

Nano Banana is Google's family of fast, high-quality image models (Gemini Flash Image). They support text-to-image, image-to-image, and mask-free editing.


This series includes 3 models: google/gemini-3.1-flash-image-preview, google/gemini-3-pro-image-preview, google/gemini-2.5-flash-image. They share the same request shape — switching between them is a one-line change to the model field of the Image Generation API.

Models in this series

Switch tabs to compare each model's ID, context window, inputs, outputs, and capabilities. Check the Models page for current availability and pricing before use.

IDgoogle/gemini-3.1-flash-image-preview
ProviderGoogle
Context window131.1K
InputText, Image
OutputText, Image
SummaryNano Banana 2 (Gemini 3.1 Flash Image Preview) is Google's fast, high-quality image model. It supports text-to-image, image-to-image, and mask-free editing, and accepts reference images for multi-image workflows.
StrengthsStrong prompt adherence, fast generation, and high-fidelity edits. A practical option for general image generation.
Supported parameters`max_tokens`, `reasoning`, `response_format`, `seed`, `structured_outputs`, `temperature`, `top_p`

Request headers

ParameterTypeRequiredDescription
Authorizationstring · requiredrequiredBearer token, formatted as `Bearer YOUR_API_KEY`.
Content-Typestring · requiredrequiredUse `application/json` for URL/base64 inputs; `multipart/form-data` when uploading files.

Request body

Parameters for OpenAI-style image generation. Exact sizes and quality tiers depend on the model — see the per-model tabs above.

ParameterTypeRequiredDescriptionValues
modelstringrequiredImage model ID from this series (see the tabs above).
promptstringrequiredText description of the image to generate.
nintegeroptionalNumber of images to generate.
sizestringoptionalOutput dimensions or aspect ratio, e.g. `1024x1024` or `16:9`.
qualitystringoptionalQuality tier (model-dependent), e.g. `standard` or `hd`.
response_formatstringoptionalHow images are returned: `url` or `b64_json`.
urlb64_json
seedintegeroptionalBest-effort deterministic generation for reproducibility.

Response fields

A successful image request returns a data array (see the panel on the right).

ParameterTypeRequiredDescription
createdintegeroptionalUnix timestamp of the generation.
dataarrayoptionalGenerated images. Each item has `url` or `b64_json`.
data[].revised_promptstringoptionalThe prompt as the model interpreted it, when provided.

Model-dependent features

OneRouter keeps protocol compatibility and forwards model-specific parameters where supported. Features such as tool calling, structured output, reasoning, prompt caching, web search, image input, audio input, video generation, and provider-specific options depend on the selected model and upstream provider. Check the model detail page before relying on a feature in production.