Docs / Google / Nano Banana 2
Raw Markdown (AI)

Google Nano Banana 2 Model Specification

Google Nano Banana 2 is a high-speed, versatile generative image synthesis model. It excels in photorealistic generation, complex multi-element compositions, rich typography, dynamic lighting, and reference image guidance across a comprehensive range of aspect ratios and resolutions.


1. Quick Overview

  • Model Slug: nano-banana-2
  • Endpoint: POST https://api.amandevelops.com/v1/nano-banana-2/
  • Category: Text-to-Image & Image-to-Image Diffusion
  • Output Formats: JPEG (jpg) or PNG (png)
  • Resolution Tiers: 1K ($0.0400), 2K ($0.0600), 4K ($0.0900)
  • Status Polling: Pure-database polling at GET /v1/tasks/{task_id}
  • Webhooks: Optional signed webhook callbacks upon job completion

2. API Request Specification

  • HTTP Method: POST
  • Path: /v1/nano-banana-2/
  • Headers:
http
  Authorization: Bearer <YOUR_API_KEY>
  Content-Type: application/json
  

Full JSON Request Schema

json
{
  "prompt": "Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons.",
  "aspect_ratio": "16:9",
  "resolution": "1K",
  "output_format": "jpg",
  "image_input": [],
  "webhook_url": "https://your-domain.com/api/webhooks/image-completed"
}

3. Parameter Reference

ParameterTypeRequired?DefaultDescription
promptstringRequired—Detailed text description of the image to generate (up to 20,000 characters).
aspect_ratiostringOptional"auto"Target canvas proportion. See table below for supported values.
resolutionstringOptional"1K"Output detail tier: "1K" ($0.0400), "2K" ($0.0600), or "4K" ($0.0900).
output_formatstringOptional"jpg"Target file format: "jpg" or "png".
image_inputarrayOptional[]Array of public HTTP/HTTPS image URLs to use as visual references or for image-to-image transformations (Max 14 URLs).
webhook_urlstringOptionalnullYour webhook URL to receive an automated HTTP POST notification when generation completes.

4. Supported Aspect Ratios

Nano Banana 2 provides native framing calibration across 15 aspect ratio configurations:

Aspect RatioOrientationIdeal Use Cases
autoAdaptiveDynamic automatic composition based on prompt semantics
1:1SquareInstagram posts, avatars, product thumbnails, icons
16:9Widescreen LandscapeYouTube thumbnails, desktop wallpapers, cinematic scenes
9:16Vertical / StoryTikTok, Instagram Stories, YouTube Shorts, mobile wallpapers
4:3Standard LandscapeEditorial photography, classic compositions
3:4Standard PortraitPortrait photography, posters, magazine layouts
3:2Classic 35mm PhotoProfessional DSLR photography format
2:3Classic 35mm PortraitFull-body fashion portraits, book covers
4:5Social PortraitStandard Instagram feed vertical photo
5:4Large Format LandscapeFine-art landscape photography
21:9Ultrawide CinematicAnamorphic cinematic panoramas, dual-monitor banners
1:4Ultra-tall VerticalSkyscraper banners, web page sidebars
4:1Ultra-wide BannerWebsite hero headers, panoramic landscape strips
1:8Extreme Tall BannerVertical timeline strips, architectural towers
8:1Extreme Wide BannerUltra-panoramic panoramic headers

5. Pricing & Wallet Economics

Requests to nano-banana-2 are billed dynamically in USD from your prepaid wallet balance based on the requested resolution:

Resolution TierPrice (USD)Description
1K$0.0400High-efficiency standard resolution ($0.04 per image)
2K$0.0600Enhanced resolution for professional print & presentation ($0.06 per image)
4K$0.0900Ultra-high definition with maximum fine texture detail ($0.09 per image)
TIP
Automated Failure Refund: If an upstream generation encounters an unforeseen failure, the reserved funds are automatically returned to your wallet balance immediately.

6. Asynchronous Request Lifecycle

Nano Banana 2 runs on an asynchronous non-blocking engine:

1. Ingress Response (HTTP 202 Accepted in < 20ms)

json
{
  "status": "success",
  "code": "TASK_QUEUED",
  "message": "Generation task accepted and queued for inference.",
  "task_id": "task_nb2_8f2a1b9c3e4d5678",
  "model": "nano-banana-2",
  "state": "queued",
  "cost_usd": 0.0400,
  "remaining_balance_usd": 14.9600,
  "poll_url": "https://api.amandevelops.com/v1/tasks/task_nb2_8f2a1b9c3e4d5678",
  "created_at": "2026-09-18 04:00:00"
}

2. Status Polling (GET /v1/tasks/{task_id})

Poll the task status from our high-speed database index:

http
GET /v1/tasks/task_nb2_8f2a1b9c3e4d5678
Authorization: Bearer <YOUR_API_KEY>

Completed Response:

json
{
  "status": "success",
  "state": "completed",
  "task_id": "task_nb2_8f2a1b9c3e4d5678",
  "model": "nano-banana-2",
  "result_url": "https://api.amandevelops.com/storage/nano-banana-2/img_nb2_7c8d9e0f1a2b.jpg",
  "is_expired": false,
  "expires_at": "2026-09-20T04:01:25Z",
  "webhook_status": "delivered",
  "created_at": "2026-09-18 04:00:00",
  "completed_at": "2026-09-18 04:00:18"
}

7. Runnable Code Examples

cURL

bash
curl -X POST "https://api.amandevelops.com/v1/nano-banana-2/" \
  -H "Authorization: Bearer ak_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Cyberpunk street market at dusk, neon signs reflecting in puddles, cinematic lighting, 8k",
    "aspect_ratio": "16:9",
    "resolution": "1K",
    "output_format": "jpg"
  }'

JavaScript (Fetch API)

javascript
const response = await fetch("https://api.amandevelops.com/v1/nano-banana-2/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer ak_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    prompt: "Futuristic solar-powered metropolis with hanging gardens, aerial view, volumetric sun rays",
    aspect_ratio: "16:9",
    resolution: "2K",
    output_format: "png"
  })
});

const data = await response.json();
console.log("Task ID:", data.task_id);
console.log("Cost USD:", data.cost_usd);
console.log("Poll URL:", data.poll_url);

Python (Requests)

python
import requests
import time

API_KEY = "ak_live_YOUR_API_KEY"
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# 1. Enqueue task
payload = {
    "prompt": "An astronaut riding a glowing translucent jellyfish in deep space, cosmic nebula, highly detailed",
    "aspect_ratio": "1:1",
    "resolution": "1K",
    "output_format": "jpg"
}

response = requests.post("https://api.amandevelops.com/v1/nano-banana-2/", json=payload, headers=HEADERS)
task_data = response.json()
task_id = task_data["task_id"]
print(f"Enqueued Task ID: {task_id}, Charged: ${task_data['cost_usd']:.4f}")

# 2. Poll for result
while True:
    status_res = requests.get(f"https://api.amandevelops.com/v1/tasks/{task_id}", headers=HEADERS).json()
    state = status_res.get("state")
    print(f"Current State: {state}")
    
    if state == "completed":
        print(f"Image ready: {status_res['result_url']}")
        break
    elif state == "failed":
        print(f"Task failed: {status_res.get('error')}")
        break
        
    time.sleep(2)

Send to AI Assistant (ChatGPT / Claude / Cursor)

Copy this prompt and paste it into your AI assistant or IDE agent to immediately integrate with this specification:

Copied to clipboard!