Skip to main content

Nano Banana 2.1

Nano Banana 2.1 is Google's newest image model (gemini-nano-banana-2.1), the next step after Nano Banana 2. It makes an image from a prompt, or edits and combines your pictures: products, faces, places or a style you pass as references. Text in the image comes out readable, and a character keeps its look across a series.

Endpoint idModel page
flymyai/nano-banana-2_1https://app.flymy.ai/models/flymyai/nano-banana-2_1

Make an image​

An image takes 10 to 25 seconds. Inputs are form fields; prompt is the only required one.

curl -X POST https://api.flymy.ai/api/v1/flymyai/nano-banana-2_1/predict \
-H "X-API-KEY: fly-***" \
-F 'prompt=A poster for a jazz night in Lisbon, the title "Noite de Jazz" in bold letters' \
-F 'aspect_ratio=3:4' -F 'resolution=2K'

The answer comes as server-sent events; the last data: line holds the result: the images as links valid for 24 hours, the model's own short note, and the token counts behind the price:

{
"output_data": {
"images": ["https://storage.googleapis.com/..."],
"description": "",
"token_usage": "{\"total_input_tokens\": 26, \"text_output_tokens\": 812, \"image_output_tokens\": 1680, ...}",
"calculated_price": "0.056529000000"
},
"status": 200
}

calculated_price is what the run cost. For several images or 4K, use the async route (/predict/async/, then /predict/async/result/?request_id=...), which answers 425 until the images are ready.

Edit or combine images​

Pass up to 14 reference images in image_urls, one URL or a JSON array of URLs (JPEG, PNG, WebP or HEIF, up to 10 MB each), or upload files in the same field, and say in the prompt what to do with them:

curl -X POST https://api.flymy.ai/api/v1/flymyai/nano-banana-2_1/predict \
-H "X-API-KEY: fly-***" \
-F 'prompt=Put this sneaker on a wet street at night, neon reflections, keep the logo' \
-F 'image_urls=["https://example.com/sneaker.jpg"]'

With aspect_ratio=auto (the default) the image keeps the shape of the first reference; without references it is square.

Parameters​

ParameterValues
promptWhat to make, or what to change in the references
image_urlsUp to 14 reference images
aspect_ratioauto (default), 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
resolution1K (default), 2K or 4K
num_images1 (default) to 10; each image is a separate generation
thinking_levelminimal, medium (default) or high: how hard the model plans the image
enable_web_searchfalse (default) or true: the model may search the web for facts to draw
safety_tolerance1 (blocks the most) to 6 (the least); 4 by default

Invalid values are refused before the image is started, so they cost nothing.

From an AI assistant​

An assistant connected to FlyMy.AI finds the model with recommend_model, quotes it with get_pricing and makes the image with run_model (the same input as the REST fields). The result is a link to each image.

Pricing​

You pay what Google bills for the run, from the tokens it reports:

PartPrice
Image, 1K$0.0336
Image, 2K$0.0504
Image, 4K$0.1134
Text and thinking tokens$7.50 per 1M
Input tokens (prompt, references)$1.50 per 1M; a reference image is about 1,120 tokens
Web search$0.014 per search query

A 1K image with the defaults costs about $0.04 (most of it the image, the rest thinking); thinking_level=minimal brings it close to $0.034. A run that fails costs nothing. Before a run starts, a request whose image tokens cost more than your balance is refused with 403 Insufficient funds. Every charge is in your usage.