Skip to main content
POST
Nano Banana Official
This page covers the three official API routes of Nano Banana: a flagship, a fast and a lightest tier. They share one set of request parameters and one billing model (billed from actual token usage) and differ only in aspect ratios, resolutions and line-specific parameters — switching tiers means changing model and nothing else. When the price of an image has to be known before submission, use Nano Banana Economy.
The official and economy lines never switch automatically: the model ID selects the line.

Quick start

A successful submission returns a task_id. Retrieve the result with GET /v1/tasks/{task_id}, wait inline with Prefer: wait, or configure a webhook.

Request parameters

string
required
One of gemini-3-pro-image, gemini-3.1-flash-image or gemini-3.1-flash-lite-image.
string
default:"generate"
  • generate — generate from text
  • edit — rewrite from reference images; image_urls is required
Image-to-image and multi-reference blending both use edit; the only difference is how many entries image_urls carries.
string
required
Image description or editing instruction, in English or Chinese.
string[]
Reference image URLs. Required for edit, up to 14. Reference images are billed as image input — see “Pricing”.
string
default:"1:1"
Frame ratio. Eleven are shared by all three tiers: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.gemini-3.1-flash-image additionally supports 1:4, 4:1, 1:8 and 8:1.auto lets the model decide: it picks from the prompt for text-to-image, and follows the input image for edits.
string
default:"1k"
Output resolution. The tiers each model offers are listed under “Available models”: gemini-3-pro-image takes 1k, 2k and 4k; gemini-3.1-flash-image takes 0.5k, 1k, 2k and 4k.gemini-3.1-flash-lite-image does not support this parameter and always outputs 1K; sending it returns 400.
integer
default:"1"
Number of images to generate. Value: 1. Each request returns one image.
Search the web for text context before generating. Only gemini-3.1-flash-image accepts this parameter.
Search the web for reference images; requires google_search: true. Only gemini-3.1-flash-image accepts this parameter.
See Submit a task for callback_url, callback_events, Prefer: wait, Idempotency-Key and the maximum-cost header.
The official line does not support mask_url, quality or seed. google_search and google_image_search are accepted only by gemini-3.1-flash-image; the other two tiers return 400 for them. Any other parameter returns 400 and is not billed. For masked inpainting use gpt-image-2.

Limits

Pricing

The official line is billed from actual token usage across four dimensions: text input, image input, text output and image output. Reference images count as image input, so more references and higher resolutions cost more. Rates are in price_config on GET /v1/models and in the console’s Model Market. What a single call actually cost is the cost field on the task response — an integer quota at 500,000 quota = 1 USD, not dollars.

Holds and settlement

Submitting a task places a hold for the estimated usage; the task then settles from actual usage and the difference is released. The estimate is built from:
  • Image output — expected output tokens, looked up by resolution; higher resolutions reserve more
  • Text output — reserved at the model’s maximum output tokens
  • Text input — a floor of 64 tokens
  • Reference images — 560 tokens each on gemini-3-pro-image; the other two tiers use 768px tiles at 258 tokens per tile
Because text output is reserved at the model’s ceiling, the hold is usually well above the final settled amount, and the difference is released when the task finishes. The estimated output tokens per resolution are in price_config.image_usage_reservation on GET /v1/models. You are only billed for a successfully generated image. Failed and cancelled tasks, and tasks that return no usable image, are refunded in full.

Response

Completed task
Generated images come back in result.images, where url is an array and expires_at is when the link stops working. See Query Task Status for the full field list.

Available models

All three do text-to-image and editing with up to 14 reference images, one image per request.
  • The 11 shared aspect ratios: auto 1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9
  • The fast tier adds four extreme ratios: 1:4 4:1 1:8 8:1, for long horizontal and vertical banners
  • The lightest tier does not accept resolution and always outputs 1K