Nano Banana 2.1

Nano Banana 2.1 API: model ID, formats & pricing

Everything needed to call gemini-nano-banana-2.1: the Interactions API request shape, reference-image editing, resolution options and current pricing context. The playground on our home page uses this exact API, client-side.

Model IDs

ModelModel IDNotes
Nano Banana 2.1gemini-nano-banana-2.1Flagship (Oct 6, 2026): 4K, 14 reference images, thinking, grounding, Batch API
Nano Banana 2 LiteSee AI Studio model listLight tier; not optimized for multi-reference input
Nano Banana ProSee Gemini API model docsPrevious flagship โ€” 2.1 vs Pro comparison

Inputs for 2.1: text, image, video, PDF ยท 131,072-token input / 32,768-token output limits. Image sizes must use a capital K (1K, 2K, 4K โ€” lowercase is rejected).

Text-to-image (Interactions API)

curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-nano-banana-2.1",
    "input": [
      { "type": "text", "text": "A studio product photo of a glass perfume bottle on wet slate, rim lighting, photorealistic" }
    ],
    "response_format": {
      "type": "image",
      "aspect_ratio": "16:9",
      "image_size": "2K"
    }
  }'

Editing with reference images (up to 14)

Add image blocks to input after the text instruction (base64, no data-URL prefix):

{
  "model": "gemini-nano-banana-2.1",
  "input": [
    { "type": "text",  "text": "An office group photo of these people in a modern atrium, natural light" },
    { "type": "image", "mime_type": "image/png", "data": "<BASE64_IMG_1>" },
    { "type": "image", "mime_type": "image/png", "data": "<BASE64_IMG_2>" }
  ],
  "response_format": { "type": "image", "aspect_ratio": "5:4", "image_size": "2K" }
}

Limits per Google's docs: up to 14 object images (Nano Banana 2.1), up to 4 consistent characters; Nano Banana 2 Lite is not optimized for multi-reference input.

Reading the response

The returned interaction contains steps; the generated image is a base64 data block inside the model_output step's content blocks:

// find step.type === "model_output", then in step.content_block[]:
// { "type": "image", "mime_type": "image/png", "data": "<base64>" }
// { "type": "text",  "text": "โ€ฆ" }   // mixed responses may interleave
const img = document.createElement("img");
img.src = `data:${block.mime_type};base64,${block.data}`;

Pricing context

RouteCostSource
Nano Banana 2 family (third-party host, fal.ai)$0.08 / imagefal.ai model listing
Nano Banana Pro (third-party host, fal.ai)$0.15 / imagefal.ai model listing
Official Gemini API (2.1)Positioned below Pro โ€” "better images for less money"The Decoder launch report; official rates: Google pricing page
Free tierGemini API free tier includes image models with rate limitsRate limits docs

Figures last verified 2026-10-14. Google's official per-image rates for 2.1 belong on Google's pricing page โ€” always confirm there before budgeting. Higher-volume batch runs can use the Batch API (higher limits, up to 24 h turnaround).

Minimal JavaScript (browser)

const res = await fetch("https://generativelanguage.googleapis.com/v1beta/interactions", {
  method: "POST",
  headers: { "x-goog-api-key": KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "gemini-nano-banana-2.1",
    input: [{ type: "text", text: prompt }],
    response_format: { type: "image", aspect_ratio: "1:1", image_size: "1K" }
  })
});
const data = await res.json(); // walk data.steps[].content_block[] for type === "image"

โš ๏ธ Don't ship your own key in client-side code โ€” that's how keys get stolen. Either use a tiny server proxy, or do what our playground does: let each user bring their own key, stored in their browser.

๐ŸŒ Next steps: grab a prompt from the library and test the API in the free playground, or compare models first in 2.1 vs Pro.