Nano Banana 2 API gives you Google's Gemini 3.1 Flash Image on APIMart for text-to-image generation and image editing from 0.5K to 4K, with up to 14 reference images and optional Google Search grounding. Pay-as-you-go billing and membership discounts are available.

Image link valid for 72 hours
Transparent pricing with no hidden fees. Pay only for what you use.
| Variant | Tier | GoldCurrent price | Platinum | Diamond | Official | Your savings |
|---|---|---|---|---|---|---|
nano-banana-2Prices are estimates; actual cost is billed by token usage. | 0.5K | 0.536Credits(~$0.0536)/pic | 0.5092Credits(~$0.0509)/pic | 0.4824Credits(~$0.0482)/pic | 0.67Credits(~$0.067)/pic | 20% |
| 1K | 0.536Credits(~$0.0536)/pic | 0.5092Credits(~$0.0509)/pic | 0.4824Credits(~$0.0482)/pic | 0.67Credits(~$0.067)/pic | 20% | |
| 2K | 0.808Credits(~$0.0808)/pic | 0.7676Credits(~$0.0768)/pic | 0.7272Credits(~$0.0727)/pic | 1.01Credits(~$0.101)/pic | 20% | |
| 4K | 1.208Credits(~$0.1208)/pic | 1.1476Credits(~$0.1148)/pic | 1.0872Credits(~$0.1087)/pic | 1.51Credits(~$0.151)/pic | 20% |
* Actual costs are subject to final output.
Google built Nano Banana 2 to bring Pro-level image quality to Flash speed. Generate and edit images from 0.5K to 4K, use 14 aspect ratios including ultra-wide 8:1, ground prompts in Google Search, and blend up to 14 reference images. Affordable pay-as-you-go billing with up to 28% off for members.
50K+
Active Users
99.9%
Uptime
2x
Faster
70%
Cost Savings
Call Google Nano Banana 2 on APIMart with one POST request. Nano Banana 2 generation is asynchronous: submit a task, then poll the task endpoint to get the image URL.
Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.
POST /v1/images/generations with 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 status is completed, then read the image URL from data.result.images[0].url[0]. Image URLs expire at expires_at, so download the files if you need to keep them. A failed task returns the reason in error.message.
See the Nano Banana 2 API reference 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-3.1-flash-image-preview",
"prompt": "A clean infographic poster explaining how a coffee bean becomes espresso, four labeled steps, flat illustration style",
"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-3.1-flash-image-preview",
"prompt": "A clean infographic poster explaining how a coffee bean becomes espresso, four labeled steps, flat illustration style",
"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-3.1-flash-image-preview",
"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-3.1-flash-image-preview | gemini-3.1-flash-image-preview (Ext, alias nano-banana-2-ext) or gemini-3.1-flash-image-preview-official (official, alias nano-banana-2). |
prompt | string | Required | Default: — | Text description of the image or the edit. |
size | string | Optional | Default: — | auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 5:4, 4:5, 21:9, 1:4, 4:1, 1:8 or 8:1. For text to image, auto resolves to 1:1 or 16:9; for image editing it follows the upstream result. |
resolution | string | Optional | Default: 1K | Output resolution: 0.5K, 1K, 2K or 4K. 4K is billed higher than 1K. |
n | integer | Optional | Default: 1 | Number of images per request. Only 1 is supported; send it as a number, not a string. |
image_urls | array | Optional | Default: — | Up to 14 reference images (ideally up to 10 objects and 4 characters) as public http(s) URLs or full data URIs. JPEG, PNG or WebP, max 10 MB each. Adding them switches to image editing. |
nsfw_check | boolean | Optional | Default: false | Moderate the prompt and input images with omni-moderation-latest before submission. Adds cost and latency. |
official_fallback | boolean | Optional | Default: false | Use the official channel as a fallback. Cannot be set when model is the -official version. |
google_search | boolean | Optional | Default: false | Ground the prompt in Google Search text results. |
google_image_search | boolean | Optional | Default: false | Ground the image in Google Images results. Requires google_search set to true. |
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 APIThis page | 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 API | Gemini Nano Banana 2.1 | Latest version: text-to-image and reference-image editing in 14 aspect ratios | 1K / 2K / 4K |
Guides, comparisons and pricing analysis from the APIMart blog.
What Gemini 3.1 Flash Image can do through one APIMart endpoint
Real-world applications powered by APIMart
Follow these simple steps to set up your account, add funds, and start generating images
Create your free APIMart account to access Nano Banana 2. It works for individuals, teams and enterprise applications.
Top up your account balance to start generating images. Your balance works across every model on APIMart, including Nano Banana 2.
Create an API key in the dashboard to authenticate every Nano Banana 2 API request.
What industry professionals say about this fast AI model
“The speed of Nano Banana 2 is incredible! It processes our product images in seconds at full 4K resolution. The multi-step workflow eliminates all the failed generations we had with other models.”
Sarah Chen
Architecture Firm Director
“Lightning-fast processing with built-in quality control at an unbeatable price? Game changer! Nano Banana 2's automatic error correction saves hours of manual fixes.”
James Rodriguez
Creative Technology Lead
“The vibe-coding feature is revolutionary. We describe our app interfaces and Nano Banana 2 generates complete UIs instantly. This has transformed our entire development workflow.”
Alex Thompson
Mobile App Product Manager
“Nano Banana 2 delivers incredible value. The Flash architecture makes it blazing fast while maintaining professional quality. Perfect for high-volume image generation.”
Emily Watson
Luxury Brand Marketing Director
“Professional storyboarding at AI speed. Nano Banana 2's character consistency and 4K output make it perfect for pre-visualization. The affordable pricing makes it ideal for production workflows.”
David Kim
Film Production Creative Director
“Enhanced text rendering in 4K resolution is perfect for our brand guidelines. Nano Banana 2's error correction ensures every asset meets enterprise quality standards automatically.”
Lisa Martinez
Enterprise Brand Designer
Everything you need to know about this fast AI image model
Nano Banana 2 is Google's Gemini 3.1 Flash Image, an image generation and editing model that brings Pro-level quality to Flash speed. It supports 0.5K to 4K output, 14 aspect ratios, up to 14 reference images and Google Search grounding. It is also written Nano Banana2, NanoBanana 2 or NanoBanana2, and sometimes called Nano Banana 2 Flash. On APIMart you call it as the Nano Banana 2 API with one API key and pay-as-you-go billing.
Google launched Nano Banana 2 (Gemini 3.1 Flash Image) in preview on February 26, 2026 and made it generally available on May 28, 2026. Its update, Gemini Nano Banana 2.1, followed on October 6, 2026 and is also available on APIMart.
Requests need model and prompt. Optional parameters are size (auto or 14 aspect ratios), resolution (0.5K, 1K, 2K or 4K; default 1K), n (1 image per request), image_urls (up to 14 reference images), nsfw_check, official_fallback, google_search and google_image_search. The parameter table on this page lists types and defaults.
Nano Banana 2 outputs 0.5K, 1K, 2K or 4K images. Supported sizes are auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 5:4, 4:5, 21:9 and the ultra-tall and ultra-wide 1:4, 4:1, 1:8 and 8:1. For text to image, auto resolves to 1:1 or 16:9.
Yes. Add image_urls to the same POST /v1/images/generations request and describe the edit in the prompt. You can send up to 14 images, ideally up to 10 object references and 4 character references, as public URLs or base64 data URIs in JPEG, PNG or WebP up to 10 MB each.
Set google_search to true and Nano Banana 2 uses real-time web information to render specific or current subjects more accurately. Add google_image_search as well, together with google_search, to ground the image in visual references from Google Images. Both are off by default.
Nano Banana 2 runs on Gemini 3.1 Flash Image and is built for speed and high-volume work, with the 0.5K tier, extreme aspect ratios (1:4, 4:1, 1:8, 8:1) and Google Search grounding. Nano Banana Pro runs on Gemini 3 Pro Image for final assets where maximum fidelity matters most. Compare both in the model family table and pricing on this page.
Both run Gemini 3.1 Flash Image with the same parameters. The Ext channel is gemini-3.1-flash-image-preview (alias nano-banana-2-ext) and the official channel is gemini-3.1-flash-image-preview-official (alias nano-banana-2). On Ext you can set official_fallback to use the official channel as a fallback; it cannot be set on the official model. The two are priced separately in the table above. The official route is billed by actual input and output token usage; Ext is billed per successfully generated image.
The Nano Banana 2 price depends on the route: the official route is settled on actual input and output token usage, while Ext is billed per successfully generated image at the rate for the selected specification. An estimated price per image for the official route is not a fixed final charge. Check this page's live pricing table for current rates and the completed task's cost for the final amount. Gold members save 20%; Platinum and Diamond members save up to 28%.
No. The Nano Banana 2 API has no free quota on APIMart. It is pay-as-you-go, with billing determined by the selected route, and you only pay for successful requests. Gold members save 20%; Platinum and Diamond members save up to 28%.
Sign up for APIMart, open the API Keys page in your dashboard and create a key. The same key calls the Google Nano Banana 2 API and every other model on the platform, with pay-as-you-go billing and no subscription.
Send POST https://api.apimart.ai/v1/images/generations with your API key, model gemini-3.1-flash-image-preview and your prompt. The response returns a task_id: poll GET /v1/tasks/{task_id} until status is completed, then read the image URL from the result. Copy-ready cURL and Python examples are on this page, and the full reference is in the APIMart docs (docs.apimart.ai).
Nano Banana 2 Lite is the lighter model in the nanobanana 2 API family, called with model nano-banana-2-lite. It outputs 1K images only, one image per request, and accepts up to 14 reference images. Choose the standard Nano Banana 2 model (nano-banana-2) when you need higher resolutions such as native 4K. Both use the same API key and asynchronous task flow. For Lite models and their prices, visit the separate Nano Banana 2 Lite page.
Yes. Nano Banana 2 images can be used commercially for e-commerce, advertising, social media, infographics and brand assets, which suits agencies, businesses and content teams.
Explore more models in the same category.

Seedream 5.0 Lite
Seedream 5.0 Lite delivers cutting-edge text-to-image generation. Create 4K resolution images with precise text rendering, multi-reference style fusion, and unified editing capabilities.

Flux Kontext Max
Flux Kontext delivers state-of-the-art AI image generation. Generate high-quality images from text prompts with the Flux Kontext Pro and Max models.

Seedream 4.5
Seedream 4.5 API delivers cutting-edge text-to-image generation. Create 4K resolution images with precise text rendering, multi-reference style fusion, and unified editing capabilities.

Seedream 4.0
Seedream 4.0 API is text-to-image and image editing model. Generate 4K images with industry-leading text rendering, batch processing, and multi-reference support.