Skip to main content
AnyAIGC

Google · Nano Banana 2

Nano Banana 2 APIgemini-3.1-flash-image

Gemini 3.1 Flash Image, from $0.0164 per image.

Flash-class speed with most Pro-level capabilities: text rendering, multi-image compositing, Google Search grounding and 4K output.

Google recommends Nano Banana 2.1 for new projects (lower price, better quality). Nano Banana 2 has no announced shutdown date and keeps working.

  • From $0.0164 / image
  • vs Google 1K Save 76%
  • Ratios 14
  • Concurrency Unlimited
  • Enterprise Self-service invoices
Explainer graphic: Labeled isometric cutaway of the Earth's layers (generated with Nano Banana)
Motion moment: A spinning red embroidered dress with motion blur (generated with Nano Banana)
Cinematic scene: A vintage orange sedan in teal night fog (generated with Nano Banana)

Sample images are from Google DeepMind's Nano Banana model pages, generated with Nano Banana models. Images © Google. View source ↗

Imagine it, then make it.Photoreal, playful, precise or surreal: a single sentence is enough.

What is Nano Banana 2

Nano Banana 2 is the nickname for Google Gemini 3.1 Flash Image. The preview launched on February 26, 2026, and the GA release followed on May 28. It targets high-throughput development, delivering close to Pro-level quality, text rendering and editing at Flash-class speed and cost.

On AnyAIGC you can call both the GA gemini-3.1-flash-image and the preview gemini-3.1-flash-image-preview, billed per image from $0.0164; live 2K and 4K prices are in the model catalog.

Model ID
gemini-3.1-flash-image
Preview
gemini-3.1-flash-image-preview
Aspect ratios
14, including 1:4, 4:1, 1:8, 8:1
References
Up to 14 (10 object + 4 character)
Google Search
Web + image search
Endpoints
generateContent · chat/completions

What Nano Banana 2 can do

  • Explainer graphic: Labeled isometric cutaway of the Earth's layers (generated with Nano Banana)

    Grounded in search

    Google web and image search keep landmarks, niche objects and infographic facts accurate.

  • One-line edit: "Change to daytime" applied to a sunset scene (generated with Nano Banana)

    Conversational editing

    Upload an image and change it with one sentence, over as many turns as you need. Handy for iterating on posters and product shots.

  • Text rendering: A full tongue twister spelled out in wood (generated with Nano Banana)

    Legible text

    Headlines, labels and captions stay clear and readable, ready for posters, menus and social posts.

  • Motion moment: A spinning red embroidered dress with motion blur (generated with Nano Banana)

    Cinematic realism

    Control lighting, depth of field and motion blur from the prompt, with fast turnaround.

Nano Banana 2 API pricing

Billed per image from $0.0164. Live 2K and 4K prices are in the model catalog.

  • Per imageFlat price per image, not per token
  • 1 image per callA request usually returns 1 image
  • Unlimited concurrencyDefault for every account
  • Shared balanceOne balance covers 300+ models
Nano Banana per-image pricing (USD)
ModelModel IDAnyAIGC price (per image, from)Google list price (1K / 2K / 4K)
Nano Banana 2Save 76% vs Google 1Kgemini-3.1-flash-image
gemini-3.1-flash-image-preview
from $0.0164 / image$0.067 / $0.101 / $0.151

Prices are in USD and show the lowest price in the model catalog. 2K and 4K output can be priced differently; see the live rates in the model catalog. You are billed per successful request, and prompts and reference images are not charged separately. Google list prices are Standard-tier USD rates from the Gemini API pricing page, for reference only.

Cost examples

Calculated at the from price per image. Check 2K and 4K rates in the model catalog.

  • 1,000 product shots

    1,000 × $0.0164

    $16.40

    Everyday batch work

  • 500 social posts

    500 × $0.0164

    $8.20

    Square and vertical formats

  • 1,000 images on 2.1 instead

    1,000 × $0.0128

    $12.80

    Same API, lower from price

How many images the 5M free tokens cover

New accounts get 5M free tokens, worth about $0.5. At the prices above, that covers this many images (rounded down).

Nano Banana: Images you can generate with the free credit
Model1K2K4K
Nano Banana 2303016

The 1K count uses the from price above. 2K and 4K counts are estimates based on AnyAIGC's price ratio between resolutions. Live prices are in the model catalog.

Nano Banana 2 vs the rest of the lineup

Nano Banana 2.1, Nano Banana 2 and Nano Banana Pro specs compared
Nano Banana 2.1Nano Banana 2Nano Banana Pro
AnyAIGC model IDgemini-nano-banana-2.1gemini-3.1-flash-image
gemini-3.1-flash-image-preview
gemini-3-pro-image
gemini-3-pro-image-preview
Google nameGemini Nano Banana 2.1Gemini 3.1 Flash ImageGemini 3 Pro Image
PositioningUpgrade to Nano Banana 2 with better image quality, text and multi-turn consistencyFlash-speed workhorse image modelReasoning-driven, pro-grade images for complex layouts and retouching
Output resolution1K / 2K / 4K1K / 2K / 4K (Google also offers 512px)1K / 2K / 4K
Aspect ratios14, including 1:4, 4:1, 1:8, 8:114, including 1:4, 4:1, 1:8, 8:110 (1:1 to 21:9)
Reference images (up to 14)10 object + 4 character10 object + 4 character6 object + 5 character + 3 style
Google Search groundingWeb + image searchWeb + image searchWeb search
ThinkingConfigurableConfigurableOn by default, cannot be turned off
AnyAIGC pricefrom $0.0128 / imagefrom $0.0164 / imagefrom $0.0328 / image
Google list price1K $0.0336 · 2K $0.0504 · 4K $0.1131K $0.067 · 2K $0.101 · 4K $0.1511K $0.134 · 2K $0.134 · 4K $0.24
ReleaseGA on 2026-10-06Preview 2026-02-26, GA 2026-05-28Preview 2025-11-20, GA 2026-05-28

Specs are from the Google Gemini API image generation docs and model list (read 2026-10-25). Request fields follow the AnyAIGC API docs.

Nano Banana 2 API use cases

  • E-commerce

    Product and lifestyle shots

    Upload a product photo and swap the background, scene or model while keeping the packaging and label text intact. Get every aspect ratio a SKU needs in one go.

  • Marketing

    Posters and localized copy

    Write headlines and selling points straight into the image, or translate the text on an existing poster into another language without touching the layout.

  • Social

    Assets for every platform

    Render one concept at 1:1, 4:5, 9:16 and 16:9 for Instagram, TikTok, YouTube thumbnails and web banners.

  • Education

    Infographics and diagrams

    Turn a concept, process or dataset into a labeled infographic, with Google Search grounding to keep the facts on screen accurate.

  • Characters

    Consistent characters

    Use a few character references to produce a series of scenes and poses, ideal for picture books, comic storyboards and brand mascots.

  • Design

    Sketch to render

    Add a one-line brief to a hand sketch, floor plan or product drawing and get a photoreal render, then keep refining it in conversation.

Get started with the Nano Banana 2 API

  1. Sign up: create an AnyAIGC account. New accounts get 5 million tokens of trial credit, and top-ups start at $1.
  2. Create an API key: generate a key in the console and store it in the ANYAIGC_API_KEY environment variable.
  3. Send a request: call POST https://anyaigc.ai/v1beta/models/gemini-3.1-flash-image:generateContent (native Gemini format). Projects already on the OpenAI SDK can use /v1/chat/completions with model set to gemini-3.1-flash-image.
Python · gemini-3.1-flash-image text to image
import base64
import os
import requests

API_KEY = os.environ["ANYAIGC_API_KEY"]
MODEL = "gemini-3.1-flash-image"

resp = requests.post(
    f"https://anyaigc.ai/v1beta/models/{MODEL}:generateContent",
    headers={"Authorization": "Bearer " + API_KEY},
    json={
        "contents": [{"role": "user", "parts": [{"text": "A plate of miniature banana dishes in a fine-dining restaurant, Gemini-themed decor, soft overhead light"}]}],
        "generationConfig": {
            "responseModalities": ["TEXT", "IMAGE"],
            # aspectRatio / imageSize must go inside imageConfig; imageSize uses an uppercase K
            "imageConfig": {"aspectRatio": "16:9", "imageSize": "2K"},
        },
    },
    timeout=300,
)
resp.raise_for_status()

# The image comes back as inlineData in parts (base64, no data: prefix); any caption is in text
for part in resp.json()["candidates"][0]["content"]["parts"]:
    if "inlineData" in part:
        ext = part["inlineData"]["mimeType"].split("/")[-1]
        with open("output." + ext, "wb") as f:
            f.write(base64.b64decode(part["inlineData"]["data"]))
        print("Saved output." + ext)
    elif "text" in part:
        print(part["text"])
cURL · gemini-3.1-flash-image text to image
curl "https://anyaigc.ai/v1beta/models/gemini-3.1-flash-image:generateContent" \
  -H "Authorization: Bearer $ANYAIGC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role": "user", "parts": [{"text": "A plate of miniature banana dishes in a fine-dining restaurant, Gemini-themed decor, soft overhead light"}]}],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"],
      "imageConfig": {"aspectRatio": "16:9", "imageSize": "2K"}
    },
    "response_format": "url"
  }'
Python · gemini-3.1-flash-image reference image editing
import base64
import os
import requests

API_KEY = os.environ["ANYAIGC_API_KEY"]
MODEL = "gemini-3.1-flash-image"


def image_part(path, mime="image/jpeg"):
    with open(path, "rb") as f:
        return {"inlineData": {"mimeType": mime, "data": base64.b64encode(f.read()).decode()}}


# Put the instruction and all reference images in the same parts list, labeling each image in text
parts = [
    {"text": "Place the product from image 1 into the scene from image 2. Keep the product and its label text unchanged."},
    {"text": "Image 1:"},
    image_part("product.jpg"),
    {"text": "Image 2:"},
    image_part("scene.jpg"),
]

resp = requests.post(
    f"https://anyaigc.ai/v1beta/models/{MODEL}:generateContent",
    headers={"Authorization": "Bearer " + API_KEY},
    json={
        "contents": [{"role": "user", "parts": parts}],
        "generationConfig": {
            "responseModalities": ["TEXT", "IMAGE"],
            "imageConfig": {"aspectRatio": "1:1", "imageSize": "2K"},
        },
        "response_format": "url",  # return a temporary download link (non-streaming only); default is base64
    },
    timeout=300,
)
resp.raise_for_status()
for part in resp.json()["candidates"][0]["content"]["parts"]:
    if "fileData" in part:
        print(part["fileData"]["fileUri"])
cURL · /v1/chat/completions
curl https://anyaigc.ai/v1/chat/completions \
  -H "Authorization: Bearer $ANYAIGC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-flash-image",
    "messages": [
      {"role": "user", "content": "A minimalist product shot of a perfume bottle on white marble, side lighting"}
    ]
  }'

To move to Nano Banana 2.1, change MODEL to gemini-nano-banana-2.1. Requests and responses stay the same.

Authenticate with Authorization: Bearer <API Key>. imageConfig.imageSize accepts 1K, 2K or 4K and defaults to 1K. response_format is a platform extension: set it to url to get a temporary fileData.fileUri link (non-streaming only); leave it out to get base64. When a request is blocked by safety filters, finishReason is SAFETY or PROHIBITED_CONTENT and no image is returned.

Nano Banana 2 API for teams and enterprises

E-commerce companies, design teams and content platforms can buy through a standard business process, with support for finance, legal and engineering.

  • Invoices

    Issue them yourself

    Issue an invoice in the console for the amount you actually topped up, whenever you need one.

  • Dedicated support

    Account and technical contacts

    Work with a dedicated support contact and technical engineer for onboarding, migration and troubleshooting.

Payment methods
  • WeChat Pay
  • Alipay
  • USDT
  • Credit card

Why teams trust AnyAIGC

Trial credit, top-ups, refunds, data handling and billing, spelled out up front.

  • 5M free tokens to start

    New accounts get trial credit, so you can test before you top up.

  • Top up from $1, refundable

    Top up from $1. Unused balance can be refunded with no fee.

  • Official channels, real models

    Requests go to official model channels, never cheaper or reverse-engineered substitutes.

  • No retention, no training

    Unless the law requires it, your prompts and outputs are not persistently stored or used for training. See the privacy policy.

  • Transparent billing, spend caps

    See tokens and cost for every request in the console, and set a quota on each API key.

  • 24/7 support

    Contact support any time about integration, billing or incidents.

Specs and how to choose it

Nano Banana 2 is Gemini 3.1 Flash Image, released by Google on Feb 26, 2026, positioned as bringing Nano Banana Pro's world knowledge, quality and reasoning at Flash speed.

It supports a range of aspect ratios and resolutions from 512px to 4K.

It keeps the resemblance of up to five characters and the fidelity of up to 14 objects in a single workflow.

It uses real-time information and images from web search (image-search grounding), renders legible text and can translate or localize text inside an image; at launch it was in preview in the Gemini API and AI Studio.

Per Google's docs the model code is gemini-3.1-flash-image; it takes text, image, video and PDF input, returns image and text, and has a 131,072-token input limit and a 32,768-token output limit.

This page lists Nano Banana 2 at $0.067, matching the pricing table above.

Compared with nano-banana-2.1: Google says 2.1 improves visual quality, prompt adherence, multi-turn character consistency and text rendering while keeping Flash-level speed and cost.

Specs come from the vendor's official documentation (blog.google). The table on this page is the price, and the model catalog is authoritative for live rates.

Nano Banana 2 API FAQ

How much does the Nano Banana 2 API cost?

On AnyAIGC, Nano Banana 2 is billed per image, from $0.0164 per image (the lowest price in the model catalog; live 2K and 4K prices are shown in the model catalog). Both gemini-3.1-flash-image and gemini-3.1-flash-image-preview are available. Google lists it at $0.067 / $0.101 / $0.151 per image for 1K / 2K / 4K.

Is Nano Banana 2 being shut down? Should I move to 2.1?

Google lists Nano Banana 2.1 as the recommended replacement for gemini-3.1-flash-image but has not announced a shutdown date, so you can keep calling it on AnyAIGC. For new projects, use Nano Banana 2.1. Migrating only means changing the model name; the request format stays the same.

Which model is Nano Banana 2?

Nano Banana 2 is the nickname for Google Gemini 3.1 Flash Image. The preview launched on February 26, 2026, and the GA model gemini-3.1-flash-image followed on May 28. It brings most Pro-level capabilities to Flash-class speed and pricing.

Is Nano Banana 2 better than Nano Banana Pro?

The "2" does not mean it is a newer generation than Pro. Nano Banana 2 is a Flash-class model: faster and cheaper, good for batch work. Pro is built on Gemini 3 Pro, with stronger reasoning that keeps complex layouts and fine detail more reliable.

Which resolutions and aspect ratios are supported?

imageConfig.imageSize accepts 1K, 2K or 4K; the from price is in the table above and live 2K and 4K prices are in the model catalog. imageConfig.aspectRatio supports 14 ratios: 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. Each request takes up to 14 reference images (10 object + 4 character).

Are there concurrency limits?

AnyAIGC sets no concurrency limit on Nano Banana 2, and every account gets this by default. The base URL is https://anyaigc.ai, and you do not need a Google account. The same key works for 300+ other models.

Can I get an invoice from AnyAIGC?

Yes. You can issue invoices yourself in the console, for the amount you actually topped up.

Which payment methods are supported?

You can top up with WeChat Pay, Alipay, USDT or a credit card. Your balance is in USD and works across every model on the platform. Invoices can be issued in the console for the amount you topped up.

Is there free trial credit for new users?

Yes. New accounts get 5 million tokens of trial credit, so you can test before deciding to top up. Top-ups start at $1.

Can I get a refund on my balance?

Yes. Unused balance can be refunded with no fee. Contact support to start a refund.

Are these the real models? Is my data safe?

Requests go to official model channels, never cheaper or reverse-engineered substitutes. Unless the law requires it, we do not persistently store your prompts or outputs or use them for training, and the console shows tokens and cost for every request.

Can I use the images commercially? Are they watermarked?

Usage rights and content policies follow Google's official terms. Google embeds an invisible SynthID digital watermark in every image Nano Banana generates; it is not visible in the picture. AnyAIGC only provides API access and adds no extra restrictions on how you use the output. If an image involves real people's likenesses or third-party trademarks, make sure you have the rights you need.

Start building with Nano Banana 2

Sign up for 5 million free tokens. From $0.0164 per image with unlimited concurrency.