Blog

Nano Banana API: Models, Pricing and Code (2026)

Unicorn API Team · · 11 min read

Nano Banana API request in a code editor next to the generated fox image it produced

The nano banana api lets your code call Google’s Gemini image models. You send a text prompt, optionally with a few reference images, and get back a generated or edited image. “Nano Banana” started as an internal codename and stuck. It now covers a small family of models with different speeds, resolutions and prices. Below you’ll find which model to pick, what each image costs, how to get access, and code you can run in a few minutes.

What is the Nano Banana API?

Nano Banana is the public nickname for Gemini’s native image generation. “Native” means the images come from the same multimodal model family that reads text and images. There is no separate image tool attached to a chatbot. In practice this makes the models good at conversational edits like “make the sky warmer”, “replace the mug with a glass” or “keep the person, change the background”, where the model has to understand what is already in the picture.

You will run into three names:

  • Nano Banana: officially Gemini 2.5 Flash Image, released on 26 August 2025. It makes quick, natural-looking images and edits with up to 3 reference images.
  • Nano Banana Pro: officially Gemini 3 Pro Image, released on 20 November 2025. It produces high-fidelity images with accurate text rendering at 1K, 2K or 4K, and takes up to 8 reference images.
  • Nano Banana 2 Lite: released on 1 July 2026, it is the cheapest model in the family. It makes fast 1K images and edits with up to 10 reference images. It belongs to the Nano Banana 2 generation, which Google opened to developers through its Gemini API in early 2026.

Two terms come up constantly. A reference image is an input picture the model should use: a product to place in a scene, a face to keep consistent, or a style to copy. 1K, 2K and 4K describe the output size, roughly the number of pixels along the long edge (about 1,000, 2,000 or 4,000).

A search for “nano banana api” usually means one of two routes. The first is Google’s own Gemini API, which you reach through Google AI Studio with a Google billing account. The second is a gateway that serves the same models behind a simpler request and its own billing. Both work. They differ in how you pay, what the request looks like, and how many other models you can reach with the same key.

Which Nano Banana model should you use?

All three models take a plain-language prompt and handle both generation and editing. They differ in output quality, maximum resolution, how many references they accept and price. These are the specs on Unicorn API:

ModelModel IDMax reference imagesResolutionAspect ratiosCredits per image
Nano Banananano-banana3Set via image_size16:9, 1:1, 9:16, 21:9, 4:34
Nano Banana 2 Litenano-banana-2-lite101K16:9, 1:1, 9:16, 21:9, 4:3, 3:2, 2:34
Nano Banana Pronano-banana-pro81K, 2K, 4K16:9, 1:1, 9:16, 21:9, 4:318 (1K, 2K), 24 (4K)

Nano Banana 2 Lite for volume and drafts

Nano Banana 2 Lite costs the same 4 credits as the original but is newer. It accepts up to 10 reference images and adds the 3:2 and 2:3 aspect ratios, which suit photo prints and portrait product shots. It is the right default for drafts, thumbnails, social posts and any pipeline that generates many images where 1K is enough.

Nano Banana for natural-looking edits

The original model is still a good choice if you have prompts already tuned for it. It is also the one to use if you need the image_size and output_format controls it exposes. Many people describe its results as natural rather than glossy, which helps with lifestyle shots and realistic edits.

Nano Banana Pro for text, detail and large output

Choose Nano Banana Pro when the image contains words that must be spelled correctly (posters, packaging, infographics, UI mockups), when you need 2K or 4K output, or when the prompt combines several products or characters. At 2K it costs the same as 1K, so if you are paying for Pro anyway, ask for 2K by default.

Comparison of the three Nano Banana models from fastest to highest quality
The three Nano Banana models trade speed and price against fidelity.

Nano Banana API pricing in credits

Unicorn API bills in credits. On a monthly plan each credit costs $0.01: Starter is $25, Creator $50, Studio $100 and Pro $200 per month. Top-up credits cost $0.015 each and never expire, which suits occasional use. In dollars, Nano Banana API pricing works out like this:

Model and settingCredits per imageOn a monthly planWith top-up credits
Nano Banana4$0.04$0.06
Nano Banana 2 Lite4$0.04$0.06
Nano Banana Pro, 1K or 2K18$0.18$0.27
Nano Banana Pro, 4K24$0.24$0.36

Three details matter when you budget:

  • Price is per output. If you set "n": 4 to get four variations, you pay four times the per-image price.
  • Reference images do not change the price. On these models the price depends on resolution (Pro) and image count, not on how many inputs you attach.
  • You can check before you spend. POST /v1/models/price returns the exact cost of a request before you run it, which is useful in apps where users choose settings.

As a rough guide, the 2,500 credits in the Starter plan cover 625 Nano Banana or Nano Banana 2 Lite images, or 138 Nano Banana Pro images at 2K.

How it compares with other image models on the same key

One key gives you more than the Nano Banana family, so you can match the model to the job:

  • GPT Image 1.5 from OpenAI costs 3 credits at low quality, 4 at medium and 22 at high. It follows prompts reliably, renders legible text, and can output a transparent background, which Nano Banana does not list.
  • Flux 3 Klein Text to Image and Flux 3 Klein Edit Image from Black Forest Labs cost 1.6 credits at 1K, 2.5 at 2K and 6.5 at 4K. The total is rounded up to whole credits, so a single 1K image costs 2 credits. They also take a seed for repeatable results.

The full list is in the model catalog. For photorealism specifically, see our guide to the realistic AI image generator options.

How to get a Nano Banana API key

Route 1: Google’s Gemini API

Google serves Nano Banana through the Gemini API. You sign in to Google AI Studio, create an API key, attach billing for paid use, and call the models through Google’s SDK or REST endpoints. This is the right route if you are already on Google Cloud or want Google-specific features as soon as they ship. Google’s own pricing and rate limits apply. Check them on Google’s pricing page before you build, because they change.

Route 2: Unicorn API

If you also want other image, video, audio or chat models without managing a separate account and bill for each provider, the setup is shorter:

  1. Create a key on the API keys page.
  2. Add credits through a monthly plan or a top-up on the pricing page.
  3. Export the key as an environment variable: export UNICORN_API_KEY=...
  4. Optionally, try prompts in the image playground before writing code.

What about “free Nano Banana API key” projects?

Searches for a free nano banana api key lead to GitHub repos and sites that promise unlimited free generation. Treat them with caution. A free endpoint either runs on someone else’s key, which can be revoked at any moment, or pays for itself some other way, such as logging your prompts and uploaded images. For a prototype, a small top-up costs a few dollars, never expires and keeps your data off unknown servers.

Diagram of the job flow from API key to finished image URL
Every request follows the same flow: create a job, poll it, download the result.

Calling the Nano Banana API from Python and curl

Image generation takes seconds, not milliseconds, so requests are asynchronous. You create a job, the server returns its id, and you poll until the job’s status is succeeded. The finished image URL is then in outputs[0].url. The request is the same for all three Nano Banana models apart from the model field and a few optional inputs.

A reusable Python helper

import os
import time
import requests

API = "https://api.unicornapi.net"
HEADERS = {"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}"}


def run_image_job(model, input_fields, timeout=300):
    """Create a job, poll until it finishes, return the first image URL."""
    r = requests.post(
        f"{API}/v1/jobs",
        headers=HEADERS,
        json={"model": model, "input": input_fields},
    )
    r.raise_for_status()
    job = r.json()

    deadline = time.time() + timeout
    while job["status"] != "succeeded":
        if job["status"] == "failed":
            raise RuntimeError(f"Job {job['id']} failed: {job}")
        if time.time() > deadline:
            raise TimeoutError(f"Job {job['id']} still {job['status']}")
        time.sleep(2)
        r = requests.get(f"{API}/v1/jobs/{job['id']}", headers=HEADERS)
        r.raise_for_status()
        job = r.json()

    return job["outputs"][0]["url"]


if __name__ == "__main__":
    # Fast, cheap draft: 4 credits
    draft = run_image_job("nano-banana-2-lite", {
        "prompt": "A red fox resting in a snowy forest at dawn, soft light, highly detailed",
        "aspect_ratio": "3:2",
    })
    print("Draft:", draft)

    # Final with readable text at 2K: 18 credits
    final = run_image_job("nano-banana-pro", {
        "prompt": "A winter travel poster of a red fox in a snowy forest at dawn, "
                  "with the headline 'NORTHERN TRAILS' in bold white letters at the top",
        "resolution": "2K",
        "aspect_ratio": "4:3",
    })
    print("Final:", final)

Download the URL promptly and store the file in your own bucket or CDN. Don’t treat the output link as permanent hosting.

The same request with curl

# 1. Create the job
curl -s https://api.unicornapi.net/v1/jobs \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana","input":{"prompt":"A red fox resting in a snowy forest at dawn, soft light, highly detailed","aspect_ratio":"16:9"}}'

# 2. Poll with the id from the response until "status" is "succeeded"
curl -s https://api.unicornapi.net/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $UNICORN_API_KEY"

# 3. Check the cost of a request before running it
curl -s https://api.unicornapi.net/v1/models/price \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-pro","input":{"prompt":"A red fox in snow","resolution":"4K","n":2}}'

The last request should come back as 48 credits: 24 credits for a 4K Pro image, times two outputs. For the full response schema, error codes and every input field, see the API documentation.

Editing images with the Nano Banana API: a worked example

Generation gets the attention, but most production use of the Nano Banana API is editing. You pass existing pictures in ref_images and describe the change. Here is a realistic case: a small shop needs lifestyle photos of a ceramic mug from one plain studio shot.

Step 1: Draft scenes cheaply

Use Nano Banana 2 Lite to explore. Send the studio shot as a reference and try several scenes:

scenes = [
    "on a wooden cafe table next to a croissant, morning window light",
    "held in two hands over a wool blanket, cosy evening lamp light",
    "on a marble kitchen counter beside a French press, bright daylight",
]

for scene in scenes:
    url = run_image_job("nano-banana-2-lite", {
        "prompt": f"Place this exact mug {scene}. Keep the mug's shape, "
                  "glaze colour and logo unchanged.",
        "ref_images": ["https://your-cdn.example/mug-studio.jpg"],
        "aspect_ratio": "2:3",
        "n": 4,
    })
    print(scene, url)

Each call with "n": 4 returns four variations for 16 credits. The helper above returns only the first URL, so loop over job["outputs"] if you want all four. Our real AI image generator comparison has more on getting photographic results.

Step 2: Render the finals with Pro

Once you have chosen scenes, re-run the best prompts on Nano Banana Pro at 2K. If the mug has printed text or a detailed logo, Pro is far more likely to reproduce it correctly. You can also add a second reference, such as a close-up of the logo, because Pro accepts up to 8.

What the job cost

  • Drafts: 5 Lite calls with n: 4 = 20 images × 4 credits = 80 credits
  • Finals: 3 Pro images at 2K × 18 credits = 54 credits
  • Total: 134 credits, which is $1.34 on a monthly plan or $2.01 with top-up credits

This draft-then-finalise pattern is the most useful habit with Gemini image models. You explore on the 4-credit tier and only pay the Pro price for images you will actually publish.

Prompt tips for edits

  • Say what must not change. “Keep the face, hairstyle and jacket identical” works better than hoping the model infers it.
  • Describe the edit, not the whole image. “Replace the grey sky with a warm sunset glow” is clearer than rewriting the full scene.
  • Name each reference’s role when you pass several: “the first image is the product, the second is the background style”.
  • Put exact text in quotes for Pro: the label reads 'OAT & HONEY'.

Common mistakes and trade-offs

Mistakes that waste credits or time

  • Using Pro for everything. At 18 credits against 4, a Pro-only workflow costs 4.5 times as much. Most exploration does not need it.
  • Asking Pro for 1K. 1K and 2K cost the same 18 credits, so 1K only makes sense when you specifically want a smaller file.
  • Forgetting that n multiplies the price. A loop with "n": 4 on Pro at 4K costs 96 credits per call. Check large batches with /v1/models/price first.
  • Exceeding the reference limit. Nano Banana takes up to 3 reference images, Pro up to 8 and 2 Lite up to 10. If you need more, merge references into a contact sheet or switch models.
  • Requesting an unsupported aspect ratio. 3:2 and 2:3 are available on Nano Banana 2 Lite but not on Nano Banana or Pro.
  • Polling too fast or never timing out. Poll every couple of seconds and set a deadline so a stuck job doesn’t hang your worker.
  • Hot-linking output URLs. Copy finished images into your own storage.
  • Hard-coding the API key. Keep it in an environment variable or secret manager, and never ship it in front-end JavaScript. Call the API from your server instead.

Trade-offs worth knowing

If you needGood choiceWhy
Lots of cheap 1K imagesNano Banana 2 Lite4 credits, up to 10 references, extra aspect ratios
Correct text and 4K outputNano Banana ProAccurate text rendering, 1K to 4K
Transparent backgroundGPT Image 1.5Optional transparent background
Lowest cost per image and repeatable seedsFlux 3 KleinFrom 1.6 credits, seed input

Direct access through Google gets you new Gemini features first and keeps everything inside Google Cloud. A multi-model key gets you one bill and lets you switch between Nano Banana, GPT Image, Flux and video or audio models by changing a single model string. Many teams use the gateway for most work and go direct only where they need a Google-specific feature.

If you work in an AI coding agent, you can also call the Nano Banana API from Cursor, Claude Code and other MCP-capable tools. Our agents setup page shows how. That lets an agent generate placeholder art or product mockups while it builds the page that uses them. Otherwise, the quickest way to judge the three models is to run the same prompt through each in the playground and compare the results and the credit cost side by side.

Frequently asked questions

Is there a free Nano Banana API key?

Google sometimes offers limited free access to Gemini models in AI Studio, but its announcements describe production Nano Banana use with a paid API key. Be careful with GitHub projects that offer an unlimited free Nano Banana API key. They often proxy someone else's key, log your prompts or disappear without warning. A cheap, predictable option is a small credit top-up, since Nano Banana images cost 4 credits each.

What is the difference between Nano Banana and Nano Banana Pro?

Nano Banana (Gemini 2.5 Flash Image) is quick and cheap at 4 credits per image, with up to 3 reference images. Nano Banana Pro (Gemini 3 Pro Image) is built for fidelity. It renders text inside images accurately, outputs at 1K, 2K or 4K, and accepts up to 8 reference images. It costs 18 credits per image at 1K or 2K and 24 credits at 4K.

How much does the Nano Banana API cost per image?

On Unicorn API, Nano Banana and Nano Banana 2 Lite cost 4 credits per image. Nano Banana Pro costs 18 credits at 1K or 2K and 24 credits at 4K. Monthly plans price credits at $0.01, so a Nano Banana image costs $0.04. Top-up credits cost $0.015 each and never expire. Setting n multiplies the price by the number of images.

Can I use the Nano Banana API with Python?

Yes. All you need is an HTTP library such as requests. POST a JSON body with the model id and an input object containing your prompt to /v1/jobs, then poll GET /v1/jobs/{id} until the status is succeeded. The image URL is in outputs[0].url. No Google SDK or Cloud project is required when you go through Unicorn API.

Is Nano Banana the same as Gemini?

Nano Banana is the nickname for the image generation side of Google's Gemini models. Nano Banana is officially Gemini 2.5 Flash Image, and Nano Banana Pro is officially Gemini 3 Pro Image. The Gemini chat assistant uses these models when you ask it to make or edit pictures, and developers reach the same models through an API.

Does the Nano Banana API support image editing?

Yes. Editing is one of its strengths. Pass existing pictures in the ref_images field and describe the change in plain language, for example replacing a background or adding a sunset glow. Nano Banana accepts up to 3 reference images, Nano Banana Pro up to 8 and Nano Banana 2 Lite up to 10, which helps when you combine products, faces or styles.