Seedance 2.5 from ByteDance is officially available on Apiframe.

Nano Banana API Guide: Documentation, Pricing & Code (2026)

How to call Nano Banana, Nano Banana 2, and Nano Banana Pro from code: setup, real pricing, and a working example for 2026.

Janice Published August 12, 2026 August 12, 2026 · 8 min read Beginner
Nano Banana API Guide: Documentation, Pricing & Code (2026)

If you've searched for "Nano Banana API" hoping to land on an official docs page, you've probably noticed there isn't one, at least not under that name. Nano Banana is Google's nickname for its Gemini image generation models, and it stuck so well that Google leaned into it. There's no separate product called "the Nano Banana API." What you're actually calling is the Gemini API, or a platform that wraps it for you.

This guide covers what the Nano Banana family actually is, what you get access to as a developer, real pricing across the different tiers, and a working code example you can run today.

What Is the Nano Banana API

Nano Banana originally referred to Gemini 2.5 Flash Image, Google's image generation model released in 2025. The name now covers four image models: Nano Banana, Nano Banana 2, Nano Banana 2 Lite, and Nano Banana Pro. Each name corresponds to a specific Gemini image model.

There are two real ways to call these models from code. The first is going straight to Google, through the Gemini API in AI Studio or Vertex AI, using your own Google Cloud billing. The second is going through an aggregator like Apiframe, which puts Nano Banana behind the same key and endpoint as dozens of other image and video models, so you're not managing a separate integration just for this one family.

Both routes call the same underlying models. The difference is in setup time, billing, and whether you want one vendor relationship or several.

Nano Banana vs Nano Banana 2 vs Nano Banana Pro: Which API to Call

Before writing any code, it helps to know which model you actually want. Here's how the three main tiers stack up.

ModelUnderlying Gemini modelMax resolutionBest forRelative price
Nano BananaGemini 2.5 Flash Image1KFast iteration, simple edits, legacy projects$
Nano Banana 2Gemini 3.1 Flash Image4KEveryday generation, better text rendering, Google Search grounding$$
Nano Banana ProGemini 3 Pro Image4KPrint-ready work, complex layouts, multilingual text, brand assets$$$

There's also Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image), a newer, cheaper option built for high-volume pipelines where you're generating a lot of images and don't need Pro-level polish on each one.

If you want a deeper breakdown of what changed between versions and when to use each one, Apiframe's Nano Banana Explained guide walks through the version history in more detail than we'll get into here. The rest of this article is focused on the part that guide skips: how to actually call the API.

Core Features Available Through the API

Whichever route you take to access it, the API surface for Nano Banana models looks broadly similar. Here's what you're actually working with as a developer.

Text-to-image and image editing

All Nano Banana models accept a text prompt and return one or more generated images. The base Nano Banana and later versions also support image-to-image, where you pass in a reference photo and a prompt describing how to change it (style transfer, object swaps, background changes, that kind of thing).

Multi-image consistency and reference input

This is one of the more useful features for production work. Nano Banana Pro and Nano Banana 2 can take up to 14 reference images in a single request and blend them together, which is handy for product photography (drop a product shot into a new scene) or keeping a character consistent across a series of images. Learn how to implement this in our Character Consistency Guide.

Resolution and output formats

Depending on the model, you can request output at 512px, 1K, 2K, or 4K, and choose between JPG, PNG, or WebP. Nano Banana Pro and Nano Banana 2 both go up to 4K; the original Nano Banana tops out around 1K and doesn't expose a resolution parameter at all.

Nano Banana API Pricing in 2026

Pricing depends heavily on which route you take and which model you're calling.

Calling Google directly, image output is billed per token rather than per image, but Google publishes the practical cost per generation. Nano Banana Pro runs about $0.134 per image at 1K or 2K resolution and $0.24 at 4K on standard processing. If your workload can tolerate delayed batch processing, that drops to roughly $0.067 and $0.12. The original Nano Banana (Gemini 2.5 Flash Image) is much cheaper per image, in the range of a few cents at 1024x1024, since it's an older, smaller model.

Calling through Apiframe, pricing is credit-based, and one credit is worth about a cent on the pay-as-you-go rate ($0.01/credit). As of this writing:

ModelResolutionCreditsApprox. cost
Nano Bananaany6~$0.06
Nano Banana 21K10~$0.10
Nano Banana 22K15~$0.15
Nano Banana 24K22~$0.22
Nano Banana 2 Liteany5~$0.05
Nano Banana Pro1K/2K22~$0.22
Nano Banana Pro4K44~$0.44

Credit costs and current rates are always worth double-checking against Apiframe's live pricing page before you build cost estimates into your product, since providers do adjust pricing over time.

The billing simplicity is the real difference here, not necessarily the per-image cost. Going direct to Google means managing Google Cloud billing, quotas, and a separate API key just for image generation. Going through Apiframe means one key and one invoice cover Nano Banana alongside Flux, Seedream, Ideogram, and everything else you might also be using.

How to Get API Access

Direct access via Google Gemini API

To call Nano Banana models directly, you'll need a Google AI Studio or Google Cloud account, a Gemini API key, and billing enabled once you're past the free testing tier (Google's free tier in AI Studio exists for experimentation, but it comes with tight rate limits and isn't meant for production traffic). From there you call the generateContent endpoint with an image-capable Gemini model and handle the response format Google returns.

Access via Apiframe (single key, unified billing)

Sign up at apiframe.ai, grab an API key from the dashboard (it'll start with afk_), and you're ready to call any model on the platform, including the full Nano Banana lineup, with the same request shape. The free plan includes 100 credits to start, enough to test a handful of generations before you need to add a payment method.

Working Code Example

Here's a minimal example that submits a Nano Banana Pro generation request through Apiframe and polls for the result. Generation is asynchronous: you submit a job, get a job ID back immediately, and then check on it until it's done.

python
import requests
import time

API_KEY = "afk_your_api_key_here"
BASE_URL = "https://api.apiframe.ai/v2"
headers = {"X-API-Key": API_KEY, "Content-Type": "application/json"}

# 1. Submit the generation request
response = requests.post(
    f"{BASE_URL}/images/generate",
    headers=headers,
    json={
        "prompt": "A vintage travel poster for Tokyo with elegant Japanese typography",
        "model": "nano-banana-pro",
        "nanoBananaParams": {
            "resolution": "2K",
            "output_format": "png"
        }
    }
)
job = response.json()
job_id = job["jobId"]
print(f"Job submitted: {job_id}, status: {job['status']}")

# 2. Poll until the job finishes
while True:
    status = requests.get(f"{BASE_URL}/jobs/{job_id}", headers=headers).json()
    if status["status"] == "COMPLETED":
        print("Image ready:", status["result"]["images"][0])
        break
    if status["status"] == "FAILED":
        raise RuntimeError(f"Generation failed: {status}")
    time.sleep(2)

Swap "model": "nano-banana-pro" for "nano-banana", "nano-banana-2", or "nano-banana-2-lite" to call a different tier, and adjust resolution accordingly (the base Nano Banana model doesn't accept a resolution parameter and generates at roughly 1K by default). Generated images are hosted on Apiframe's CDN for 90 days, so download anything you want to keep long term.

Common Use Cases

Product mockups. Blend a product photo with a new background or setting using the multi-image reference input, useful for e-commerce listings and marketing pages without a photo shoot.

Marketing creative. Nano Banana models can generate images containing text, making them useful for posters, advertisements, social media graphics, and other marketing content. Nano Banana 2 and Nano Banana Pro are especially useful when accurate text and detailed layouts are important.

Character-consistent illustration series. Provide reference images of a character and use them when creating new scenes. This can help maintain the character's appearance across multiple images.

Iterative image editing. Because the base model and Nano Banana 2 both support image-to-image, you can run a generated image back through the API with a follow-up prompt to refine it, rather than starting from scratch each time.

FAQ

Does Nano Banana have an official standalone API?

No. There's no product called "the Nano Banana API." You call it through Google's Gemini API (as a Gemini image model) or through a third-party platform like Apiframe that wraps the Gemini API for you.

Is there a free tier?

Google's Gemini API has a free tier in AI Studio for testing, but it's rate-limited and not intended for production use. Apiframe's free plan includes 100 credits to start, which covers a handful of test generations across any model on the platform.

What are the rate limits?

This varies by provider and account tier. Apiframe's authenticated API is limited to 500 requests per minute per API key. There are also separate limits on how many generations can run at the same time, based on your plan.

Can you use Nano Banana Pro and base Nano Banana through the same key?

Yes, if you're going through Apiframe. One API key covers the entire Nano Banana lineup (base, 2, 2 Lite, and Pro) plus every other model on the platform, since they all share the same POST /v2/images/generate endpoint and just take a different model value.

Power your next AI product with Apiframe.

Instant access to 70+ media models through a single API. Start free and scale when you're ready.