Nano Banana 2 icon
Image by Google

Nano Banana 2 API

Generate and edit images with Google's Nano Banana 2 through one unified API. A single REST endpoint, async jobs, and webhooks, with no Google Cloud setup to manage.

Integrate Nano Banana 2 with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "nano-banana-2"
Nano Banana 2 scene of five named characters together at a dinner table, each keeping a consistent look

What's special about Nano Banana 2

Pro quality at Flash speed

Built on Gemini 3.1 Flash, it brings Nano Banana Pro's reasoning, world knowledge, and visual fidelity into a faster, cheaper package, and it replaced the original Nano Banana.

Faster and cheaper than Pro

It generates in roughly 4 to 6 seconds at about half the per-image cost of Nano Banana Pro, which suits high-volume and iterative work.

Up to 4K output

It supports resolutions from 512px up to 4096px across 14 aspect ratios, covering everything from social posts to print.

Search grounding and world knowledge

It pulls from Gemini's knowledge base and real-time web search to render specific subjects accurately, and it excels at infographics, notes-to-diagrams, and data visualizations.

Strong multi-subject consistency

It keeps multiple characters and objects consistent across a series of images, alongside accurate multilingual text rendering and translation.

Flexible reasoning and provenance

It offers minimal or high reasoning levels, and every output carries an invisible SynthID watermark plus C2PA Content Credentials.

Made with Nano Banana 2

A few outputs generated through the Nano Banana 2 API on Apiframe.

Nano Banana 2 data visualization of global coffee consumption by country with clean labels and a legend

A data visualization of global coffee consumption by country, clean labels and legend.

Nano Banana 2 4K product photo of a sneaker on concrete in soft daylight with sharp detail

A 4K product photo of a sneaker on concrete, soft daylight, sharp detail.

Nano Banana 2 converting handwritten meeting notes into a clean flowchart diagram

Turn these handwritten meeting notes into a clean flowchart diagram.

Nano Banana 2 greeting card reading 'Congratulations' in elegant script with a watercolor floral border

A greeting card reading 'Congratulations' in elegant script with a watercolor floral border.

Nano Banana 2 scene of five characters together at a dinner table, each keeping their consistent look

Show these five characters together at a dinner table, each keeping their consistent look.

Nano Banana 2 bilingual menu board with dishes in English and Spanish, legible prices, and a modern layout

A bilingual menu board with dishes in English and Spanish, legible prices, modern layout.

Overview

Endpoint
POST /v2/images/generate
Model ID
nano-banana-2
Params key
nanoBananaParams
Modality
Image
Provider
Google
Avg. completion
~12s

Capabilities

Aspect ratios1:1, 3:4, 4:3, 9:16, 16:9
Resolutions1K, 2K, 4K
Image inputSupported
Avg. time~12s

Quick start

Send a single POST /v2/images/generate request with your API key to generate with Nano Banana 2. The call returns a jobId you can poll or receive via webhook.

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "nano-banana-2",
        "nanoBananaParams": {
            "resolution": "1K",
            "image_input": "https://example.com/input.jpg",
            "output_format": "jpg",
            "google_search": false
        }
    }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "nano-banana-2",
        "nanoBananaParams": {
            "resolution": "1K",
            "image_input": "https://example.com/input.jpg",
            "output_format": "jpg",
            "google_search": False
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
    "model": "nano-banana-2",
    "nanoBananaParams": {
      "resolution": "1K",
      "image_input": "https://example.com/input.jpg",
      "output_format": "jpg",
      "google_search": false
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the Nano Banana 2 endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "nano-banana-2" "nano-banana-2" The model identifier for this endpoint.
nanoBananaParams.resolution string optional "1K" "512px", "1K", "2K", "4K" Resolution
nanoBananaParams.image_input string (URL) optional Compose with or edit a reference image.
nanoBananaParams.output_format string optional "jpg" "jpg", "png", "webp" Output format
nanoBananaParams.google_search boolean optional false Google search grounding
nanoBananaParams.image_search boolean optional false Image search grounding

Frequently Asked Questions

Common questions about the Nano Banana 2 API.

What is Nano Banana 2?

Google's Gemini 3.1 Flash Image, released in February 2026 to deliver Pro-level quality at Flash speed, replacing the original Nano Banana.

How is it different from Nano Banana Pro?

It is around four times faster and roughly half the cost with comparable quality, while Pro remains the pick for the most demanding text and branding work.

What resolution does it produce?

Up to 4K, with options from 512px to 4096px and 14 aspect ratios.

How fast and how affordable is it?

Around 4 to 6 seconds per image, and on Apiframe from 12 credits ($0.12) at 1K to 26 credits ($0.26) at 4K, about half the price of Pro.

How many subjects can it keep consistent?

Multiple characters and objects across images, supporting consistency for several characters and many objects at once.

Where can you access it?

Through Apiframe, as well as the Gemini app, Google AI Studio, the Gemini API, and Vertex AI.

Still have questions?

Start building with the Nano Banana 2 API

Get your API key and integrate Nano Banana 2 in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.