Nano Banana
Nano Banana (Gemini Image) is Google's family of multimodal image generation and editing models. In addition to text-to-image generation, every model supports conversational (multi-turn) image editing by passing one or more reference images alongside the prompt, interleaved image-and-text output, and Content Credentials (C2PA). All generated images carry a SynthID watermark.
https://llm.siraya.ai/v1/images/generations
Supported Models
| Model ID | Description |
|---|---|
gemini-2.5-flash-image |
a.k.a. Nano Banana. Fast generation and editing. Up to 3 input images per prompt. |
gemini-3-pro-image |
a.k.a. Nano Banana Pro. Highest-quality generation and editing, with thinking and Google Search grounding. Up to 14 input images and resolutions up to 4K. |
gemini-3.1-flash-image |
a.k.a. Nano Banana 2. Fast generation and editing, with thinking and Google Search grounding. Up to 14 input images and resolutions from 512 up to 4K. |
gemini-3.1-flash-lite-image |
a.k.a. Nano Banana 2 Lite. Fastest, most cost-efficient generation and editing (~4s latency), with thinking. Up to 14 input images per prompt; 1K resolution only. |
Generate Images
Generate an image from a text prompt, or edit/combine existing images by adding image to the same call.
Header
Body
gemini-2.5-flash-image, gemini-3-pro-image, gemini-3.1-flash-image, gemini-3.1-flash-lite-image).
image.
false, the request waits for generation to finish and returns the completed image. When true, it returns immediately with an image id while generation runs in the background. There is no status/poll endpoint for images — pass callbackUrl to receive the result. See Asynchronous generation.
async is true. A URL the router will POST to once generation completes (or fails). This is the only way to retrieve the result of an async image job.
extra_body is optional over plain HTTP. See extra_body below.
import requests
url = "https://llm.siraya.ai/v1/images/generations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
}
data = {
"model": "gemini-3-pro-image",
"prompt": "A serene Japanese garden with a red maple tree beside a koi pond, soft morning light",
"size": "1024x1536"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Example Response
Gemini Image always returns exactly one base64-encoded image per request — there is no n parameter and no url response format.
image
Pass one or more reference images to edit or combine, instead of generating from text alone. The value can be a single URL/base64 data URL, or an array of them.
{
"model": "gemini-3-pro-image",
"prompt": "Replace the background with a sunset beach and keep the subject unchanged",
"image": [
"https://resources.siraya.ai/image/example1.png"
]
}
gemini-2.5-flash-image accepts up to 3 images per prompt; gemini-3-pro-image, gemini-3.1-flash-image, and gemini-3.1-flash-lite-image accept up to 14, following Google's guidance for mixing reference images — allocated per category: gemini-3-pro-image up to 6 objects / 5 characters / 3 style references, gemini-3.1-flash-image up to 10 objects / 4 characters, gemini-3.1-flash-lite-image up to 5 characters.
extra_body
Nested parameters specific to Gemini Image. Pass them as a JSON object under extra_body, or — since unknown top-level fields are captured automatically — as flat keys directly in the request body.
| Key | Type | Notes |
|---|---|---|
aspect_ratio |
string | Overrides the ratio derived from size. See Aspect Ratios & Resolutions for supported values per model. |
image_size |
string | 1K, 2K, or 4K; gemini-3.1-flash-image also supports 512. gemini-3.1-flash-lite-image only supports 1K. Must be uppercase K. Default: 1K. |
thinking |
object | Structured form — {"type": "disabled"} to turn off, or {"type": "enabled", "thinking_level": "high"} to set a tier explicitly. See thinking_level support below for exactly which values each model accepts. |
seed |
integer | Random seed for reproducibility. Even when set, determinism isn't guaranteed — identical requests with the same seed can still return different images. |
{
"model": "gemini-3.1-flash-image",
"prompt": "A serene Japanese garden with a red maple tree beside a koi pond",
"size": "1024x1536",
"extra_body": {
"aspect_ratio": "9:16",
"thinking": {
"type": "enabled",
"thinking_level": "high"
}
}
}
thinking_level support
Gemini image models take a thinking_level tier (via thinking) instead of a token budget. Only two tiers exist here — minimal/high — narrower than the four tiers (minimal/low/medium/high) available on Gemini 3.x text models; sending low/medium to an image model always returns 400.
| Model | Supported thinking_level values |
Default | Notes |
|---|---|---|---|
gemini-2.5-flash-image |
Not supported | — | Any explicit thinking config returns 400. |
gemini-3-pro-image |
high only |
high |
Always reasons internally; an explicit value of any kind returns 400 — omit the field entirely. |
gemini-3.1-flash-image |
minimal, high |
minimal |
Omitting the field is byte-identical to sending minimal explicitly. |
gemini-3.1-flash-lite-image |
minimal, high |
minimal |
Same two tiers as gemini-3.1-flash-image. |
We always set includeThoughts=true on Gemini's native thinkingConfig regardless of which tier is sent. For the equivalent breakdown across Gemini's text models, see Per-Model Details → Gemini.
Aspect Ratios & Resolutions
Gemini Image maps requested dimensions to a supported aspect ratio. Set the size parameter, extra_body.aspect_ratio, or describe the ratio you want in the prompt.
| Model | Supported aspect ratios | Supported resolutions |
|---|---|---|
gemini-2.5-flash-image |
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | — |
gemini-3-pro-image |
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K, 2K, 4K (4K in Preview) |
gemini-3.1-flash-image |
1:1, 3:2, 2:3, 3:4, 1:4, 4:1, 4:3, 4:5, 5:4, 1:8, 8:1, 9:16, 16:9, 21:9, 9:21 | 512, 1K, 2K, 4K (4K in Preview) |
gemini-3.1-flash-lite-image |
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K only |
Model Specifications
gemini-2.5-flash-image |
gemini-3-pro-image |
gemini-3.1-flash-image |
gemini-3.1-flash-lite-image |
|
|---|---|---|---|---|
| Context window | 32,768 | 65,536 | 131,072 | 65,536 |
| Max output tokens | 32,768 | 32,768 | 32,768 | 4,096 |
| Max input images per prompt | 3 | 14 | 14 | 14 |
| Max output images per prompt | 1 (no n parameter) |
1 (no n parameter) |
1 (no n parameter) |
1 (no n parameter) |
| Max resolution | ~1 MP | 4K (~16 MP, Preview) | 4K (~16 MP, Preview) | 1K (~1 MP) only |
| Thinking | Not supported | Supported | Supported | Supported |
| Google Search grounding | Not supported | Supported | Supported | Not supported |
| Image generation from video | Not supported | Not supported | Not supported | Not supported |
| Interleaved image + text | Supported | Supported | Supported | Supported |
| Content Credentials (C2PA) | Supported | Supported | Supported | Supported |
| Knowledge cutoff | June 2024 | January 2025 | January 2025 | January 2025 |
Supported input MIME types: image/png, image/jpeg, image/webp, image/heic, image/heif. Inline / direct-upload images are limited to 7 MB per file (30 MB when referenced from cloud storage), with a 500 MB total request input limit.
For a list of all available image models, visit the Models Directory.