Nano Banana API · Ace Data Cloud

Nano Banana API:
Generate AI Images

Use the same REST API to generate or edit images with the Nano Banana family of models, with support for multiple reference images, optional aspect ratios, and output up to 4K.

🖼️ 2 Operation Modes 🤖 5 Base Models 📐 7 Aspect Ratios 🔑 Bearer Token Authentication
🖼️
2
Operation Modes
🤖
5
Base Models
📡
2
API Endpoints
📐
7
Aspect Ratio Options

What is Nano Banana?

Nano Banana is a family of Google Gemini image generation models. Choose Nano Banana, 2 Lite, 2, 2.1, or Pro for your use case, and use the same interface for text-to-image generation and reference image editing.

Request 1–4 images at a time, with billing based on the number of images successfully returned. Receive results via callback or query by task ID.

Core Capabilities of the Nano Banana API

Text-to-image generation and multi-image editing for the complete image creation workflow

✨

High-Quality Text-to-Image Generation

Enter a detailed text description (subject, atmosphere, lighting, camera angle) to generate professional-quality images. Ideal for brand visuals, product posters, cover images, and more.

🔀

Multi-Image Editing

Upload multiple images (such as a portrait + clothing), and AI will intelligently blend them. Supports advanced editing operations such as virtual try-on, product placement, and scene compositing.

👗

Virtual Outfit Changes

Provide a portrait photo and a clothing PNG to automatically create a styled look. Ideal for e-commerce clothing displays and quickly expanding livestream image libraries.

🏠

Product Scene Changes

Place product images with white backgrounds into realistic settings (wooden tables, grass, bathrooms, desks) to make product detail pages richer and more lifelike.

🎨

Attribute Replacement

Change materials, colors, and styles. Swap the leather on a bag, change a drink's flavor, or alter a shoe's color scheme—making visual SKU experimentation easier.

⚡

Asynchronous Webhook

Set callback_url to automatically receive results when a task is complete. No polling required; ideal for batch production.

AI-Generated Image Gallery

The images below were generated using the Nano Banana API—what you see is what you get

cURL
curl -X POST https://api.acedata.cloud/nano-banana/images \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "generate",
    "prompt": "白瓷咖啡杯,晨光窗台,85mm镜头,浅景深,柔和高光,治愈干净",
    "model": "nano-banana",
    "aspect_ratio": "3:2"
  }'
Response
{
  "success": true,
  "task_id": "c1075552-a527-4a70-8d98-ef783f4087c1",
  "trace_id": "3352b744-d17e-4d01-b1ef-a8c8e2ca3d2e",
  "data": [{
    "image_url": "https://cdn.acedata.cloud/d635720766.png"
  }]
}

Quick Start—Get Started in 3 Minutes

A simple REST API using Bearer Token authentication. Generate your first AI image with a single request.

1

Get an API Key

Go to the application list, open General Application, and click the copy button to the right of API KEY. Keep the key on your server and use it to replace YOUR_API_KEY in the example.

Get an Ace Data Cloud API Key
2

Send a POST Request

Send a request to /nano-banana/images with a prompt and parameters

3

Get the Image URL

Get a permanently accessible image URL—ready for immediate use in production

Use Cases

From e-commerce content to brand creativity—Nano Banana covers these use cases

👗

E-commerce Fashion

Have an influencer pose for one styled photo, then use different clothing PNGs to generate "outfit images" in bulk and quickly expand your store's assets

📦

Product Detail Pages

Turn one product image on a white background into scenes featuring wooden tables, lawns, bathrooms, and more, making detail pages richer and more compelling

🎨

Brand Visuals

Quickly generate brand key visuals, campaign posters, and cover images. Switch the same main visual between styles and holiday themes with one click

🤖

AI Agent Integration

Integrate with MCP-compatible AI assistants through MCP Server to generate images using natural language

Advanced Features

Nano Banana goes beyond simple text-to-image generation to handle these advanced tasks

🎭

2D to 3D Figurines

Turn anime characters or portraits into collectible figurine models, displayed with packaging

🔧

Exploded Product Views

Showcase internal product structures with metal parts and electronic components suspended in an exploded view for a technical aesthetic

📷

Old Photo Restoration

Repair scratches and damage in old black-and-white photos, improve clarity, and add natural color

🚗

Multi-Element Composites

Seamlessly combine models, products, backgrounds, and other elements into a single high-quality image

+ Multiple Camera Angles + Meme Generation + Sketch to Image + Map to Realistic Scene

Get Started in 3 Steps

Go from registration to your first AI image in less than 3 minutes

01

Register and Get an API Key

Follow the illustration above to copy the API Key for the general-purpose application.

02

Make Your First API Call

Send a POST request with a text prompt to /nano-banana/images. Use an SDK, cURL, or any HTTP client.

03

Integrate and Scale

Integrate the API into your application. Use Webhook for asynchronous processing and scale confidently to production.

Nano Banana Integration Methods

Purpose Endpoint Request Details
Image Generation POST /nano-banana/images Set action: generate and a prompt
Reference Image Editing POST /nano-banana/images Set action: edit and provide image_urls
Query Tasks POST /nano-banana/tasks Query asynchronous tasks for free

Which model is right for you?

Choose the right model based on your quality and speed needs

Recommended

nano-banana

Fast

Based on Gemini 2.5 Flash Image. Faster generation at a lower cost, ideal for bulk content production and prototyping.

  • ✓ Faster response times
  • ✓ From 0.14 Credits / image
  • ✓ 7 aspect ratios
  • ✓ Ideal for high-volume use

nano-banana-2-lite

Lightweight

Based on Gemini 3.1 Flash Lite Image. Supports 1K resolution only, ideal for quick prototyping.

  • ✓ Gemini 3.1 lightweight model
  • ✓ From 0.14 Credits / image
  • ✓ Supports 1K resolution only
  • ✓ Ideal for quick prototyping

nano-banana-2

Balanced

Based on Gemini 3.1 Flash Image. Pro-level quality + Flash speed, offering great value.

  • ✓ Pro-level image quality
  • ✓ Flash-level response speed
  • ✓ From 0.28 Credits / image
  • ✓ Ideal for most use cases
New

nano-banana-2.1

Efficient

A new generation of efficient image models, supporting 1K, 2K, and 4K text-to-image generation and image editing.

  • ✓ Supports 1K/2K/4K resolutions
  • ✓ Text-to-image generation and reference image editing
  • ✓ From 0.20 Credits / image
  • ✓ Ideal for visual creation from draft to final image

nano-banana-pro

High quality

Based on Gemini 3 Pro Image, supporting 1K, 2K, and 4K output, ideal for brand visuals and high-precision images.

  • ✓ Highest image quality
  • ✓ From 0.35 Credits / image
  • ✓ Supports 1K/2K/4K resolutions
  • ✓ Ideal for brand visuals

Nano Banana API Pricing

Transparent pay-as-you-go pricing. No subscription fees. No hidden fees. Pay only for what you use.

Pay as you go
Standard
0.14 Credits / image and up

Each model is billed by the number of images successfully returned. USD prices depend on the purchased package.

  • ✓ Text-to-image (Generate)
  • ✓ Multi-image editing (Edit)
  • ✓ 7 aspect ratios
  • ✓ Webhook callbacks
  • ✓ Task polling—free
  • ✓ nano-banana-2-lite: 0.14 Credits / image and up
  • ✓ nano-banana-2: 1K / 2K at 0.28 Credits / image, 4K at 0.33 Credits / image
  • ✓ nano-banana-2.1: 0.20 Credits / image and up
  • ✓ nano-banana-pro: 0.35 Credits / image and up
View pricing details View API documentation
Enterprise
Custom

Volume discounts for high-usage teams

  • ✓ Usage-based discounts
  • ✓ Priority support
  • ✓ Dedicated account manager
  • ✓ Custom rate limits
  • ✓ SLA coverage
Contact sales

Frequently Asked Questions

Everything you need to know about using the Nano Banana API

What model is Nano Banana? ▾

Nano Banana is an alias-based wrapper for Google Gemini image generation models. nano-banana corresponds to Gemini 2.5 Flash Image, nano-banana-2-lite corresponds to Gemini 3.1 Flash Lite Image (1K only, fast image generation), nano-banana-2 corresponds to Gemini 3.1 Flash Image, nano-banana-2.1 supports generation and editing at 1K, 2K, and 4K, and nano-banana-pro corresponds to Gemini 3 Pro Image. Nano Banana, 2 Lite, 2, and Pro also offer :official public models. See the API documentation and pricing page for specifications and pricing.

How does pricing work? ▾

Charges are based on the number of successfully generated images. count can request 1–4 images; if some fail, you are charged only for images successfully returned. :official models are priced separately; see the live pricing page for details. Task queries are free.

What image operations are supported? ▾

Generate creates images from prompts, while Edit can use up to 10 reference images. The aspect ratio can be selected automatically or specified as 1:1, 3:2, 2:3, 16:9, 9:16, 4:3, or 3:4. Nano Banana 2, 2.1, and Pro support 1K / 2K / 4K, while Nano Banana and 2 Lite support 1K.

How do I handle longer generation times? ▾

There are two ways: (1) Use callback_url—set a Webhook URL, and we will POST the result when it is complete. (2) Poll /nano-banana/tasks—this endpoint is free and lets you check the status at any time.

Are image URLs valid permanently? ▾

Yes. The returned image_url is stored on our CDN, remains accessible permanently, and can be used directly in production.

Can it be used with Claude or ChatGPT? ▾

Yes! We provide an MCP Server (mcp-nano-banana) that integrates with AI assistants that support MCP. Your AI Agent can generate and edit images using natural language.

How do I write a good Prompt? ▾

Recommended structure: subject + mood + lighting + lens + texture keywords. For example: "white porcelain coffee cup, windowsill in morning light, 85mm portrait lens, shallow depth of field, soft highlights, soothing, clean, relaxed". The more specific the description, the better the generated result.

What should I keep in mind when using Edit mode? ▾

Edit mode requires 1-10 images to be passed through the image_urls parameter (HTTP/HTTPS URL or Base64). Each image can be up to 10MB. The Prompt should describe how to process these images, for example "put this T-shirt on this person".

Start Generating AI Images Now

Access text-to-image generation, reference image editing, asynchronous task queries, and completion callbacks with a single API.