Nano Banana family
Google’s Gemini image models, five in total. We recommend calling them through the Gemini native API, which gives precise control over aspect ratio and resolution; the OpenAI-compatible API also works, but supports only some parameters.
Common tasks
Choosing a model
- Three tiers: 1K, 2K, 4K
- Aspect ratios from 1:8 to 8:1; 2K and 4K measured at about 2 minutes
- Four resolutions from 512 to 4K
- Widest choice of aspect ratios, including 1:8 and 8:1
- Three tiers: 1K, 2K, 4K
- Reasons before generating, so it takes longer
- 1K only
- Measured at about 5 seconds per image; outputs JPEG
- Fixed at about 1K; resolution cannot be set
- Fine for existing projects
google/gemini-nano-banana-2.1Latestgoogle/gemini-3.1-flash-imageEveryday pickgoogle/gemini-3-pro-image4K, complex compositionsgoogle/gemini-3.1-flash-lite-image1K onlygoogle/gemini-2.5-flash-imagePrevious genFor live prices, see the model pages: Nano Banana 2 , Nano Banana Pro . The actual charge follows usageMetadata in the response.
Choosing an endpoint
Latency and timeouts
The API is synchronous. We measured about 5 to 20 seconds at 1K and about 30 seconds at 4K; Nano Banana 2.1 at 2K and 4K takes about 2 minutes. It takes longer at peak times. Pro reasons before generating the image (the response includes thoughtsTokenCount), so it is slower than Nano Banana 2 at the same resolution. The common 60-second default timeout does not cover 4K or peak-time requests; if the client disconnects, the request is still billed.
Response structure
{
"candidates": [{
"content": {
"parts": [{ "inlineData": { "mimeType": "image/png", "data": "iVBORw0KGgo…" } }],
"role": "model"
},
"finishReason": "STOP"
}],
"modelVersion": "google/gemini-3-pro-image",
"usageMetadata": {
"promptTokenCount": 7,
"candidatesTokenCount": 2000,
"candidatesTokensDetails": [{ "modality": "IMAGE", "tokenCount": 2000 }],
"thoughtsTokenCount": 211,
"totalTokenCount": 2218
}
}- The image is in the
partsitem that containsinlineData, not necessarily the first item; text may come before it. Iterate overpartsto find it. - The
IMAGEentry incandidatesTokensDetailsgives the number of output image tokens. We measured 1,120 at 1K and 2,000 for Pro at 4K. thoughtsTokenCountappears only in Pro responses and counts the reasoning tokens used before generating the image.
Official docs
The official docs describe behavior when calling Google directly; when calling through OfoxAI, the measured results on this page take precedence.
- Gemini API · Image generation
- Gemini API · Aspect ratios and image size
- OfoxAI · Gemini native protocol generateContent
FAQ
How do I generate a 4K image with Nano Banana Pro?
Use the Gemini native API and pass imageSize: "4K" in generationConfig.imageConfig, with aspectRatio to set the ratio. In our tests a 16:9 4K output was 5504x3072, about 16 MB, and took about 33 seconds. The OpenAI-compatible API does not support imageSize; sending image_size returns 400.
Which aspect ratios does Nano Banana 2 support?
Ten common ones: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9 and 21:9; plus four extra-wide or extra-tall ratios: 1:4, 4:1, 1:8 and 8:1. Any ratio not on the list returns 400 Request contains an invalid argument.
Does Nano Banana Pro support 1:8 or 4:1?
No. The four ratios 1:4, 4:1, 1:8 and 8:1 are supported only by Nano Banana 2.1, Nano Banana 2 and Nano Banana 2 Lite; use one of these three for extra-tall or extra-wide images.
Should imageSize be 4K or 4k?
We recommend uppercase 1K, 2K and 4K, matching Google. In our tests OfoxAI also accepts lowercase. The 512 tier has no K and is supported only by Nano Banana 2.
How do I set the Nano Banana aspect ratio on the OpenAI-compatible API?
Use the top-level aspect_ratio, e.g. "16:9". That API has no resolution parameter; for 2K or 4K use imageConfig.imageSize on the Gemini native API.
Can Nano Banana generate several images at once?
No, each request generates one image. For more, send several requests concurrently, keeping the rate limit in mind.
What timeout should I set for Nano Banana?
We recommend 300 seconds or more. We measured about 5 to 20 seconds at 1K, about 30 seconds at 4K, and about 2 minutes for Nano Banana 2.1 at 2K and 4K, longer at peak times. Pro reasons before generating, so it is slower than Nano Banana 2.