Skip to content
Models

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.

Updated 5 min read

Nano Banana Pro is Google's highest-fidelity image model. On Frameport the Nano Banana Pro API is one request with a prompt, an aspect ratio, up to 4 images and, if you want, up to 6 reference pictures to edit or build on, for $0.16 an image, and you pay only for the images that succeed.

The same API key calls every other model of the catalog, so you can draft on a cheaper model and render the final picture here without a second account. This page covers what the model does on Frameport, a first request in curl, Python and Node, edits and reference pictures, shapes and batches, billing, and prompt tips.

Nano Banana Pro at a glance

MakerGoogle
What it doesImages from a prompt, edits of a picture you send
Reference picturesUp to 6 per request
Aspect ratios1:1, 3:4, 4:3, 9:16 and 16:9
Images per requestUp to 4
Price$0.16 per image
Model idnano-banana-pro
EndpointPOST /v1/images/generations

It is the model to reach for when the picture itself is the deliverable: a campaign visual, a cover, a hero image, a label or sign whose words must read cleanly. It also reads the pictures you send: edit one by instruction, or keep a product, a face or a place in a new scene (see edits and reference pictures below).

Your first Nano Banana Pro API request

An image request answers 202 at once with an id and the amount held; you then read the generation until its images are ready. This one asks for two takes of a product shot in 4:3:

# 1. Submit
curl https://frameport.ai/v1/images/generations \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "A glass bottle of olive oil on a stone counter with a handwritten label reading \"Harvest\", soft morning daylight, shallow depth of field",
    "n": 2,
    "aspect_ratio": "4:3"
  }'

# 2. Poll 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-pro",
  "status": "queued",
  "input": {
    "prompt": "A glass bottle of olive oil on a stone counter with a handwritten label reading \"Harvest\", soft morning daylight, shallow depth of field",
    "n": 2,
    "aspect_ratio": "4:3",
    "reference_images": 0
  },
  "reserved_usd": 0.32,
  "cost_usd": null,
  "outputs": [
    { "id": "file_8Hc2RkQw5ZpT1mVb7nXe3L", "status": "queued" },
    { "id": "file_3Vb8KqW2nTx7Lc5Rm1YdPs", "status": "queued" }
  ],
  "error": null,
  "created_at": "2026-11-28T10:00:00.000Z",
  "completed_at": null
}

Each finished output carries a url that opens without a key for about an hour, and its content_type. The images reference lists every field, and webhooks can tell you when a generation is done instead of polling.

For a full Python script with batches, saved files and retries, see image generation API in Python.

Edits and reference pictures

Send up to 6 pictures in reference_images and say in the prompt what to do with them. To edit, write the change rather than the whole scene; to build on them, say what each picture is for:

An edit by instruction · POST /v1/images/generations
{
  "model": "nano-banana-pro",
  "prompt": "Change the background to a beach at sunset. Keep the bottle and its label exactly as they are.",
  "reference_images": ["https://example.com/bottle.jpg"],
  "aspect_ratio": "4:3"
}
Two references in one scene
{
  "model": "nano-banana-pro",
  "prompt": "The woman from the first picture holds the bottle from the second picture at a rooftop bar, golden hour, 50mm",
  "reference_images": ["https://example.com/her.jpg", "https://example.com/bottle.jpg"],
  "n": 2
}

A picture can be a public URL, an upload id or the id of an image you made on Frameport, so a take you like can come back as the start of the next one. Post the body to POST /v1/generations/quote first to see its exact price.

Aspect ratios and batches of up to four

Three more fields shape the request:

  • aspect_ratio: 1:1, 3:4, 4:3, 9:16 and 16:9, 1:1 when left out. 16:9 suits banners and covers, 9:16 stories and phone screens, 3:4 and 4:3 product and editorial frames.
  • n: 1 to 4 images, 1 when left out. Each image is rendered on its own from the same prompt, so a batch gives you several takes to pick from, each charged on its own.
  • prompt: up to 2,400 characters.

A value the model does not take is refused with 400 invalid_request before anything is held. Send an Idempotency-Key header to retry a request safely: a retry with the same key returns the first generation instead of paying twice.

How each image is billed

Each image costs $0.16. When you submit, the price of the whole batch is held from your balance; each image is charged when it succeeds, and an image that fails costs nothing. With n: 4, three can succeed and one fail, and only three are charged.

ImagesNano Banana ProNano Banana 2.1
1$0.16$0.085
4$0.64$0.34
100$16.00$8.50

To see the price of a body before you send it, post it to POST /v1/generations/quote. Nothing is held or started, and the answer says whether your balance covers it:

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

Add max_cost_usd to a request built from user input, and anything priced above it is refused before anything is held. Nano Banana Pro keeps Google's own content policy: a prompt it refuses answers 400 content_policy, an image refused after it started fails, and neither costs anything.

Volume costs and ways to spend less are in Nano Banana Pro API pricing.

Nano Banana Pro or Nano Banana 2.1

Both come from Google, take the same request and the same aspect ratios, and make up to 4 images a call. Nano Banana 2.1 is its fast model, at $0.085 an image; Nano Banana Pro is its highest-fidelity one, at $0.16. One way to use the pair: try prompts on Nano Banana 2.1 until the framing is right, then render the keeper on Nano Banana Pro by changing model.

For posters and layouts with text, also look at GPT Image 2.5, on the same key. The Nano Banana Pro vs GPT Image 2.5 comparison puts the three side by side.

Pro and 2.1 are compared in full in Nano Banana Pro vs Nano Banana 2.1.

Prompt tips for Nano Banana Pro

  • Be specific and layered: subject, wardrobe, setting, light, lens and mood, in that order. "A ceramicist at her wheel, linen apron, sunlit studio with clay dust in the air, 50 mm lens, warm and quiet" leaves little to chance.
  • Quote the words that must appear, and keep them short: a label reading "Harvest", a sign that says "Open late".
  • Describe the light as you would to a photographer: soft window light, golden hour, overcast, a single hard key light.
  • Change one thing at a time between runs, so you know what each change did.
  • Use the batch: n: 4 on one prompt gives four takes to choose from in a single request.

Templates and worked examples are in the Nano Banana Pro prompt guide. For icons, items and textures in one style, see the AI game assets API.

FAQ

How do I get a Nano Banana Pro API key?

Use a Frameport key: create an account, add funds under Billing, then create a key under API keys. It starts with fp_live_, is shown once, and calls Nano Banana Pro and every other model of the catalog. No second account is needed.

Is there a free Nano Banana Pro API?

The account, the key and quotes are free, and an image that fails costs nothing. Images are paid from a prepaid balance, topped up from $10, with no subscription. You can also try Nano Banana Pro online before writing code.

How much does the Nano Banana Pro API cost?

$0.16 per image, so a batch of four costs $0.64 and a hundred images $16.00. The price is the same at every aspect ratio.

Can I send my own pictures to Nano Banana Pro?

Yes: up to 6 per request in reference_images, as URLs, upload ids or images you made here. Write the change you want to edit one ("make it night, keep the label"), or describe a new scene to keep a product, a face or a place from them.

Where is the Nano Banana Pro API documentation?

The images reference documents the endpoint and every field, the model page lists its options and prices, and GET /v1/models returns the live values your code should read: options.aspect_ratios, options.max_images and pricing.per_image.

Pricing5 min read

Nano Banana 2.1 API Pricing per Image

Nano Banana 2.1 API pricing per image and per batch, partial batches billed per success, a price cap per request, and when Pro is worth the step up.

Start building.

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