Nano Banana 2 API for Developers

Nano Banana 2 API

Generate and edit production-ready images with Nano Banana 2 via API. Stronger instruction following, subject consistency, and detail precision — no GPU setup required.

Free to start
No watermarks on paid plans
Subscription or usage-based
Auto-scaling
Nano Banana 2 example: composite with real subject, cartoon twin, and floating music UI
Hybrid generation
Nano Banana 2 example: night city view through glass with glowing spiderweb over skyscrapers
Surreal cityscape
Nano Banana 2 example: close-up portrait with pearlescent skin and soft, neutral expression
Ethereal portrait
Nano Banana 2 example: sharp subject in a subway station with blurred commuters and train
Cinematic subway
Nano Banana 2 example: cartoon and real person side by side in matching outfits on a sidewalk
Style fusion
Nano Banana 2 example: aerial view of hillside resort with pool and coastline below
Tropical resort
Nano Banana 2 example: woman in red next to a Formula 1 car in an indoor garage setting
F1 showroom
Nano Banana 2 example: symmetrical upward view through Eiffel Tower ironwork to the sky
Eiffel symmetry

Trusted by teams at

meta
nba
loreal
puma
cisco
deel
shopify
decathlon
dallas-mavericks
pittsburgh-pirates
tala
dyson
dazn
wsc-sports

Everything You Need to Ship Nano Banana 2

Production-ready image generation with stronger instruction following.

Instruction Following
Stronger prompt adherence than Nano Banana — more precise control over output details.
Subject Consistency
Better consistency across multiple generations for campaigns and batch workflows.
Production-Ready Output
Higher fidelity results suitable for client delivery and commercial production.
Native Editing
Edit existing images with prompt-based modifications built into the model.
Auto-Scaling Infrastructure
Scales compute to match demand automatically. No GPU provisioning or cold starts.
Commercial-Ready
Paid plans support non-watermarked outputs for commercial delivery.

Integrate in 3 Steps

Add production-grade AI image generation to your app in minutes.

1
Get Your API Key
Sign up free and generate an API key from the Developer dashboard. You get free credits to start.
2
Send Your Request
Pass a detailed text prompt to the AI image generator endpoint and select the nano-banana-2 model. For editing, include a source image.
3
Get Results & Scale
Receive generated or edited images via response. Deploy to production — infrastructure scales automatically.
Get Started Free

Code Examples

Nano Banana 2 in a few lines of code. Install an SDK or use the REST API directly.

from magic_hour import Client
from os import getenv

client = Client(token=getenv("API_TOKEN"))
res = client.v1.ai_image_generator.generate(
    image_count=1,
    style={
        "prompt": "A surreal landscape at golden hour with layered clouds",
        "tool": "general",
    },
    aspect_ratio="1:1",
    model="nano-banana-2",
    name="Nano Banana 2",
    resolution="1k",
)
API Docs

Nano Banana 2 API Pricing

Subscription plans for standard usage.

Prefer usage-based pricing?

Email us or message us in Intercom and we will set up your usage-based pricing.

API Calculator
Use our calculator to estimate your API costs.
Tier
Estimated monthly cost

$1.73

Based on 24 FPS

Built for Builders

See how developers use the Nano Banana 2 API to power real products.

Client-Ready Creative
Generate production-quality images for client delivery and commercial campaigns.
Product Photography
Create precise product images with strong instruction following for e-commerce.
Brand Consistency
Generate brand-consistent visual assets with repeatable quality across campaigns.
Marketing Production
Create polished marketing visuals with detail control for A/B testing and personalization.
Design Systems
Generate consistent UI and design assets with reliable instruction following.
Professional Portraits
Create detailed, consistent portrait images for professional use cases.
Try before integrating

Try Nano Banana 2 Free — No Code Required

Test quality first with the free tool, then plug the same output quality into your app with the API when you are ready.

Nano Banana 2 API — Frequently Asked Questions

Magic Hour's Nano Banana 2 API lets developers generate and edit images via REST API with SDKs for Python, Node.js, Go, and Rust.

Nano Banana 2 offers stronger instruction following, better subject consistency, and higher detail precision. It costs more but produces more production-ready output.

50/75/100 credits per image at 1K/2K/4K resolution.

Yes. Free users can generate at 1K resolution.

1K, 2K, and 4K for both generation and editing.

Yes. Nano Banana 2 supports text-to-image generation and native image editing through the same API.

Use Nano Banana 2 for most production workflows. Use Nano Banana Pro for the highest-quality output with maximum creative control.

Official SDKs for Python, Node.js, Go, and Rust.

Start Building with the Magic Hour Nano Banana 2 API

Free credits on signup. SDKs for Python, Node.js, Go, and Rust. Production-ready in minutes.