Google's Gemini Nano Banana 2.1 supports text-to-image generation and reference-image editing. APIMart provides official and Ext routes with the same output resolutions, but different billing and limits.

Generated image links expire 72 hours after completion. Download your images promptly.
Transparent pricing with no hidden fees. Pay only for what you use.
* Actual costs are subject to final output.
* gemini-nano-banana-2.1: Image-output estimate only. Input and reasoning are billed separately; the final charge is based on actual usage.
* If Ext is unavailable, allow fallback to the official model. A fallback task uses official token-based billing, so the final charge may differ from the Ext estimate.
Gemini Nano Banana 2.1 is Google's update to Nano Banana 2, with better visual quality, prompt adherence, character consistency and text rendering. Turn prompts and reference images into 1K, 2K or 4K images in 14 aspect ratios, and use the official or Ext route for your workflow.
Supported Nano Banana 2.1 inputs, output settings and task workflow
Practical Nano Banana 2.1 ideas for creative, commerce and content teams
Call Google Nano Banana 2.1 on APIMart with one POST request. Nano Banana 2.1 generation is asynchronous: submit a task, then poll the task endpoint to get the image URLs.
Save your APIMart API key in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.
POST /v1/images/generations with the Nano Banana 2.1 model, your prompt, size and resolution. Add image_urls to edit images. The response returns a task_id.
Send GET /v1/tasks/{task_id} until the task is completed, then read the image URLs from the data.result.images[0].url array (with n set to 4, it contains all 4 links). Save the files before the links expire at expires_at. A failed task is fully refunded and returns the reason in error.message.
See the Nano Banana 2.1 API documentation for every parameter and response field.
curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-nano-banana-2.1",
"prompt": "A panoramic website banner of a mountain lake at sunrise with the headline Explore More in clean white type",
"n": 1,
"size": "16:9",
"resolution": "2K"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "gemini-nano-banana-2.1",
"prompt": "A panoramic website banner of a mountain lake at sunrise with the headline Explore More in clean white type",
"n": 1,
"size": "16:9",
"resolution": "2K"
}
resp = requests.post(f"{API_BASE}/v1/images/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["images"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(3)
else:
raise TimeoutError(f"task {task_id} did not finish in time")curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-nano-banana-2.1",
"prompt": "Place the product from this photo on a marble kitchen counter in soft morning light and keep the label unchanged",
"n": 1,
"size": "1:1",
"resolution": "2K",
"image_urls": [
"https://example.com/product.jpg"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | Default: gemini-nano-banana-2.1 | gemini-nano-banana-2.1 (official, 1–4 images, token billing) or gemini-nano-banana-2.1-ext (Ext, 1 image, per-image billing). |
prompt | string | Required | Default: — | Description of the image to generate or the edit to make. |
size | string | Optional | Default: auto | auto or 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1. Both routes support every ratio. |
resolution | string | Optional | Default: 1K | 1K, 2K or 4K; affects billing. 0.5K is not supported. |
n | integer | Optional | Default: 1 | Official route: 1 to 4. Ext route: 1 only. |
image_urls | array | Optional | Default: — | Reference images as public HTTP(S) URLs or base64 data URLs. PNG, JPEG or WEBP recommended. Leave empty for text to image. |
official_fallback | boolean | Optional | Default: false | Ext only. If the Ext route fails and the task completes on the official route, official token billing applies. |
webhook | string | Optional | Default: — | Callback URL called when the task finishes. |
Compare every Nano Banana model on APIMart. One API key calls all of them, billed per image.
| Model | Base model | Best for | Resolution |
|---|---|---|---|
| Nano Banana API | Gemini 2.5 Flash Image | Character consistency, multi-image blending and prompt-based edits | 1K |
| Nano Banana Pro API | Gemini 3 Pro Image | Professional 4K images, legible multilingual text and consistency for up to 5 people | 1K / 2K / 4K |
| Nano Banana 2 API | Gemini 3.1 Flash Image | Fast, cost-efficient generation from 0.5K to 4K | 0.5K – 4K |
| Nano Banana 2 Lite API | Gemini 3.1 Flash Lite Image | Fast 1K images and editing, one image per request with up to 14 reference images | 1K |
| Gemini Nano Banana 2.1 APIThis page | Gemini Nano Banana 2.1 | Latest version: text-to-image and reference-image editing in 14 aspect ratios | 1K / 2K / 4K |
Nano Banana 2.1 routes, parameters, billing and result handling
Gemini Nano Banana 2.1 is Google's latest high-efficiency image generation and editing model and an update to Nano Banana 2 (Gemini 3.1 Flash Image). It keeps Flash-level speed and cost efficiency while improving visual quality, prompt adherence, multi-turn character consistency and text rendering. On APIMart you call it as the Nano Banana 2.1 API, model gemini-nano-banana-2.1.
Google made Gemini Nano Banana 2.1 generally available on October 6, 2026. It replaces gemini-3.1-flash-image, which Google has deprecated and recommends migrating to Nano Banana 2.1.
Google describes Nano Banana 2.1 as an update to Nano Banana 2 with significant improvements in visual quality, prompt adherence, multi-turn character consistency, text rendering and wide and panoramic ratios (1:4, 4:1, 1:8, 8:1) across 1K, 2K and 4K. Nano Banana 2.1 does not support the 0.5K tier.
gemini-nano-banana-2.1 uses the Google official route, while gemini-nano-banana-2.1-ext uses the Ext route. Both run the same Nano Banana 2.1 model and support the same resolutions and aspect ratios; billing, image count and reference-size limits differ.
The official route supports n from 1 to 4. Ext currently supports only n=1. Use separate Ext tasks or the official route when you need several images.
image_urls accepts publicly accessible HTTP(S) URLs or base64 data images. PNG, JPEG and WEBP are recommended. Official limits each reference to 20 MB; Ext allows 30 MB each and 50 MB combined. Upstream limits still apply even though the platform sets no reference-count cap.
Choose 1K, 2K or 4K and auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8 or 8:1. Both the official route and Ext support all these ratios at every resolution, including 1:4, 4:1, 1:8 and 8:1 at 2K and 4K. Defaults are 1K and auto. This model does not support 0.5K.
Official billing includes actual input tokens and output tokens, including image output and thinking. An image-output estimate is not the full task price. Ext is priced per image by resolution, so the Nano Banana 2.1 price depends on the route and resolution you choose. Check the platform price list; the completed task's cost is the final charge.
This optional Ext setting is off by default. If the third-party route fails and the task completes through the official route, official token-based billing applies instead of Ext per-image pricing.
POST /v1/images/generations returns a task_id. Query GET /v1/tasks/{task_id} until the task completes or fails. Completed image links are in the data.result.images[0].url array; when n is 4, this array contains all 4 links.
Image links expire 72 hours after completion; use expires_at and save the files promptly. A task marked failed is fully refunded and reports cost=0. A network error while checking status does not by itself mean the task failed.
Sign up for APIMart, open the API Keys page in your dashboard and create a Nano Banana 2.1 API key. The same key calls the Google Nano Banana 2.1 API and every other model on the platform, with pay-as-you-go billing and no subscription.
Explore more models in the same category.

Seedream 5.0 Flash
Seedream 5.0 Flash is ByteDance's fast, lower-cost text-to-image model. It supports single-image and multi-reference editing with up to 10 references and generates 1K, 1.5K or 2K images, or exact pixel sizes, with strong text rendering.

GPT Image 2.5 Sunburst
GPT Image 2.5 Sunburst is an OpenAI image model for generation and editing, focused on precise edits for detail-sensitive creative work. Supports up to 16 reference images and PNG, JPEG or WebP output.

GPT Image 2.5 Flare
GPT Image 2.5 Flare is OpenAI's speed-focused GPT Image 2.5 model for image generation and editing. It supports up to 16 reference images, inpainting with transparent PNG masks and 15 aspect ratios.

Grok Imagine Image Quality
Grok Imagine Image Quality is the quality-focused version of xAI's Grok image model for photorealistic text-to-image and image editing, with up to three reference images.