Skip to Content
ModelsNano BananaOverview

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

Key pointNano Banana 2 is recommended for most cases; choose Pro for 4K output or complex compositions, and 2 Lite for generating small images in bulk.
Nano Banana 2.1Latest
  • Three tiers: 1K, 2K, 4K
  • Aspect ratios from 1:8 to 8:1; 2K and 4K measured at about 2 minutes
gemini-nano-banana-2.1
Nano Banana 2Everyday pick
  • Four resolutions from 512 to 4K
  • Widest choice of aspect ratios, including 1:8 and 8:1
gemini-3.1-flash-image
Nano Banana ProQuality first
  • Three tiers: 1K, 2K, 4K
  • Reasons before generating, so it takes longer
gemini-3-pro-image
Nano Banana 2 LiteSpeed first
  • 1K only
  • Measured at about 5 seconds per image; outputs JPEG
gemini-3.1-flash-lite-image
Nano BananaPrevious gen
  • Fixed at about 1K; resolution cannot be set
  • Fine for existing projects
gemini-2.5-flash-image
Model IDs (copy them exactly)
Nano Banana 2.1google/gemini-nano-banana-2.1Latest
Nano Banana 2google/gemini-3.1-flash-imageEveryday pick
Nano Banana Progoogle/gemini-3-pro-image4K, complex compositions
Nano Banana 2 Litegoogle/gemini-3.1-flash-lite-image1K only
Nano Bananagoogle/gemini-2.5-flash-imagePrevious gen

For live prices, see the model pages: Nano Banana 2 , Nano Banana Pro . The actual charge follows usageMetadata in the response.

Choosing an endpoint

Key pointUse the Gemini native API when you need to control aspect ratio and resolution.
Gemini native API (recommended)OpenAI-compatible API
EndpointPOST /gemini/v1beta/models/<model ID>:generateContentPOST /v1/images/generations, /v1/images/edits
Aspect ratioimageConfig.aspectRatioTop-level aspect_ratio
ResolutionimageConfig.imageSize: 512, 1K, 2K, 4KNot supported; sending image_size returns 400
size: "WIDTHxHEIGHT"Not applicableNot supported; set the ratio with aspect_ratio
n (multiple images)Not applicableNot supported; one image per request
EditingPut inlineData in partsUpload files to /v1/images/edits
Reference images input_imagesNot applicableNot supported; use /v1/images/edits for editing
Returned incandidates[0].content.parts[].inlineData.datadata[0].b64_json

Latency and timeouts

Key pointSet the client timeout to 300 seconds or more.

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

200 OK (native API, data truncated)
{ "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 parts item that contains inlineData, not necessarily the first item; text may come before it. Iterate over parts to find it.
  • The IMAGE entry in candidatesTokensDetails gives the number of output image tokens. We measured 1,120 at 1K and 2,000 for Pro at 4K.
  • thoughtsTokenCount appears 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.

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.

Last updated on