Nano Banana
Google · 3 models · Text, Image → Text, Image
https://onerouter.com/v1/images/generationsHow 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.
google/gemini-3.1-flash-image-preview| Provider | |
| Context window | 131.1K |
| Input | Text, Image |
| Output | Text, Image |
| Summary | Nano 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. |
| Strengths | Strong 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string · required | required | Bearer token, formatted as `Bearer YOUR_API_KEY`. |
| Content-Type | string · required | required | Use `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.
| Parameter | Type | Required | Description | Values |
|---|---|---|---|---|
| model | string | required | Image model ID from this series (see the tabs above). | |
| prompt | string | required | Text description of the image to generate. | |
| n | integer | optional | Number of images to generate. | |
| size | string | optional | Output dimensions or aspect ratio, e.g. `1024x1024` or `16:9`. | |
| quality | string | optional | Quality tier (model-dependent), e.g. `standard` or `hd`. | |
| response_format | string | optional | How images are returned: `url` or `b64_json`. | urlb64_json |
| seed | integer | optional | Best-effort deterministic generation for reproducibility. |
Response fields
A successful image request returns a data array (see the panel on the right).
| Parameter | Type | Required | Description |
|---|---|---|---|
| created | integer | optional | Unix timestamp of the generation. |
| data | array | optional | Generated images. Each item has `url` or `b64_json`. |
| data[].revised_prompt | string | optional | The 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.