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
| Model | Model ID | Notes |
|---|---|---|
| Nano Banana 2.1 | gemini-nano-banana-2.1 | Flagship (Oct 6, 2026): 4K, 14 reference images, thinking, grounding, Batch API |
| Nano Banana 2 Lite | See AI Studio model list | Light tier; not optimized for multi-reference input |
| Nano Banana Pro | See Gemini API model docs | Previous 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"
}
}'
aspect_ratio: e.g.1:1,16:9,9:16,4:3,5:4, panoramic1:4โฆ8:1image_size:1K(default) /2K/4K- Optional:
tools: [{"type": "google_search"}]for grounding;previous_interaction_idto continue a conversation
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
| Route | Cost | Source |
|---|---|---|
| Nano Banana 2 family (third-party host, fal.ai) | $0.08 / image | fal.ai model listing |
| Nano Banana Pro (third-party host, fal.ai) | $0.15 / image | fal.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 tier | Gemini API free tier includes image models with rate limits | Rate 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.