Skip to content
Models

Nano Banana 2.1 API: Code, Batches and Price per Image

The Nano Banana 2.1 API on one key: Google's general-purpose image model from a prompt, with aspect ratios, batches, code in three languages and pricing.

Updated 5 min read

Nano Banana 2.1 is Google's general-purpose image model, and on Frameport the Nano Banana 2.1 API is one request: a prompt, an aspect ratio and up to 4 images, for $0.085 per image delivered. It renders from text alone, so everything you want in the frame goes into the prompt, and an image that fails is never charged.

Below: the model's options, a first call in curl, Python and Node, the shapes and batch sizes it takes, how billing works, prompts that suit it, and when its bigger sibling, Nano Banana Pro, is worth the difference.

Nano Banana 2.1 at a glance

MakerGoogle
Model idnano-banana-2-1
InputA text prompt, up to 2,400 characters
Pictures it readsNone: it generates from the prompt
Aspect ratios1:1, 3:4, 4:3, 9:16 and 16:9
Images per request1 to 4
Price$0.085 per image
EndpointPOST /v1/images/generations

Reach for it when you need many images of an idea and the look matters more than the last fraction of detail: artwork for posts and newsletters, storyboard frames, rough product mockups, a set of illustrations in one style. Name the medium in the prompt and it moves between photographic and illustrated looks, and a plain description of the scene is enough for it to work from.

Your first Nano Banana 2.1 API call

The endpoint answers 202 Accepted right away, with the generation's id and the amount held; the images are ready when a later read says so. This call asks for four takes of one illustration in 16:9 and keeps the ones that succeed:

# 1. Submit four takes in 16:9
curl https://frameport.ai/v1/images/generations \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2-1",
    "prompt": "Flat vector illustration of a bicycle courier crossing a rainy city square at dusk, muted teal and orange palette, clean shapes",
    "n": 4,
    "aspect_ratio": "16:9"
  }'

# 2. Read it again with the id it returned, until "status" is "succeeded"
curl https://frameport.ai/v1/images/generations/$GENERATION_ID \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY"
202 Accepted
{
  "id": "gen_4kQ8vT2nLm9Xr7Wd1sYcPa",
  "object": "generation",
  "type": "image",
  "model": "nano-banana-2-1",
  "status": "queued",
  "input": {
    "prompt": "Flat vector illustration of a bicycle courier crossing a rainy city square at dusk, muted teal and orange palette, clean shapes",
    "n": 4,
    "aspect_ratio": "16:9",
    "reference_images": 0
  },
  "reserved_usd": 0.34,
  "cost_usd": null,
  "outputs": [
    { "id": "file_8Hc2RkQw5ZpT1mVb7nXe3L", "status": "queued" },
    { "id": "file_3Vb8KqW2nTx7Lc5Rm1YdPs", "status": "queued" },
    { "id": "file_2Tn7XcQ9vLm4Ra8Ws1KbZd", "status": "queued" },
    { "id": "file_5Wq1ZtR8xNc3Hv6Lp9KmTa", "status": "queued" }
  ],
  "error": null,
  "created_at": "2026-11-28T10:00:00.000Z",
  "completed_at": null
}

Once an output is done it carries its own status, a url signed for about an hour and a content_type. To be told when the whole generation has settled instead of asking, register a webhook; the images reference documents every field.

Nano Banana 2.1 aspect ratios and batch size

Two fields shape what comes back:

  • aspect_ratio: 1:1, 3:4, 4:3, 9:16 and 16:9, square when you leave it out. Square suits avatars and feed posts, 16:9 headers and slides, 9:16 stories and phone wallpapers, 4:3 and 3:4 product and editorial frames.
  • n: 1 to 4 images, one when you leave it out. Every image is a separate render of the same prompt, so a single request returns several readings of your brief.

There is no picture input on this model: the subject, the setting and the style all have to be put into words. Send a value outside those lists and the API answers 400 invalid_request, holding nothing, with the accepted values in its message. An Idempotency-Key header makes a retry safe, since the same key returns the first generation instead of starting another (idempotency).

How Nano Banana 2.1 images are billed

Every image costs $0.085, whatever its shape and however long the prompt. Submitting holds the price of the whole batch on your balance; each image is then charged as it succeeds, and the share of any image that fails returns to your balance.

ImagesPrice
1$0.085
4$0.34
100$8.50
1,000$85.00

So a batch of four in which one image fails costs $0.255. POST /v1/generations/quote prices the same body without running it: no hold, and a flag that says whether your balance is enough.

Quote · 200 OK
{
  "object": "quote",
  "model": "nano-banana-2-1",
  "type": "image",
  "mode": "generate",
  "price_usd": 0.34,
  "reserved_usd": 0.34,
  "breakdown": "4 images × $0.085",
  "available_usd": 42.5,
  "enough_balance": true
}

Code that builds requests from user input can add max_cost_usd: a request priced above it is refused before anything is held (quotes). The model keeps Google's content policy, so a prompt it turns down answers 400 content_policy, an image refused mid-run fails, and neither is charged. Pricing explains the balance, topped up from $10.

Prompts that suit Nano Banana 2.1

  • Lead with the medium. "Watercolor", "isometric 3D render", "35mm street photograph": open with it, so the look is settled before the details arrive.
  • One sentence for the scene, then short clauses. Say what happens, then add the palette, the light and the framing, each in a few words.
  • Describe recurring things the same way every time. The model sees no pictures, so a mascot or a product that returns across images needs the same words each time: color, shape, material, one distinctive detail.
  • Read the batch before rewriting. Four takes of one prompt show what the prompt leaves open; tighten the clause that changes most between them.
  • Keep lettering to a word or two, in quotes. For posters and packaging carried by their text, a model built for typography such as GPT Image 2.5 fits better.

A vague prompt like "a cozy cafe" leaves most choices to chance. "Isometric 3D render of a corner café at night, warm window light, two empty chairs outside, wet cobblestones, soft pastel palette" makes those choices for it.

Nano Banana 2.1 or Nano Banana Pro?

Both come from Google and take the same request, so a prompt moves from one to the other with a change of model. What changes is what you pay for:

  • Nano Banana 2.1, $0.085 per image: prompt only, made for exploring and for volume.
  • Nano Banana Pro, $0.16 per image: the maker's highest-fidelity model, which also reads up to 6 pictures and edits them by instruction.

Settle the composition on the cheaper model, and spend the Pro price only on the frames you will publish. For a table of the two and code that runs one prompt on both, read Nano Banana Pro vs Nano Banana 2.1; edits with reference pictures are in the Nano Banana Pro API guide.

Looking for a Nano Banana 2 alternative on the same key? For photoreal people and products, Frameport Image 3 is priced at $0.025 an image; for concepts with a characterful look, try Grok Imagine 2.0. The cheapest image generation API guide ranks every image model by price.

Batch and volume costs are in Nano Banana 2.1 API pricing.

FAQ

How do I get a Nano Banana 2.1 API key?

You use a Frameport key, not a Google one. Sign up, add funds, then create a key from the API keys page of the dashboard. Copy it when it appears, because it is displayed a single time; every key begins with fp_live_. No Google account or cloud project is involved.

Is this the Nano Banana 2 API?

The version on sale is Nano Banana 2.1, called with the id nano-banana-2-1. The catalog has no Nano Banana 2.5 or Lite model; the models page and GET /v1/models list what you can call. If you were after a Pro version, the catalog sells Nano Banana Pro, Google's highest-fidelity image model, on the same key.

Can Nano Banana 2.1 edit my photos?

No. It renders from the prompt alone and does not use pictures. For edits by instruction, send your pictures to Nano Banana Pro, up to 6 per request, or to Frameport Image 1, up to 10.

Is there a free Nano Banana 2.1 API?

The account, the key and quotes cost nothing, and failed images are not charged. The images themselves are paid from a prepaid balance, from $10, with no subscription. You can also try Nano Banana 2.1 online before writing code.

Where is the Nano Banana 2.1 API documentation?

The images reference covers the endpoint and its fields, and the model page lists the options and the price. GET /v1/models/nano-banana-2-1 returns the live values your code should read: options.aspect_ratios, options.max_images and pricing.per_image.

Models5 min read

Nano Banana Pro API: Generate Images by Code

The Nano Banana Pro API on one key: Google's highest-fidelity image model by code, edits from your pictures, batches, curl, Python and Node, and the price.

Pricing6 min read

Cheapest Image Generation API Models (2026)

The cheapest image generation API models in our catalog, what each gives up for its price, and how batches and per-image billing set the real cost.

Start building.

Your API key is free. Top up from $10 when you are ready.