gemini-nano-banana-2.1 at $0.045 per call for 1K, 2K, or 4K.
What Nano Banana 2.1 supports
2K and 4K images cost less than Google’s standard price per output image:
- 2K: $0.0504 at Google, $0.045 on LaoZhang API
- 4K: $0.113 at Google, $0.045 on LaoZhang API

Output of the generate example below: 2K, 16:9
Parameters and limits
To compare all five Nano Banana models, see the Nano Banana overview.
Nano Banana 2.1 or Nano Banana 2?
Both models take the same request and return the same response shape, so switching means changing only the model ID.New projects: Nano Banana 2.1
Lower price per call at 1K to 4K, with better text and layout.
512px previews: Nano Banana 2
Nano Banana 2.1 has no
512 size. Nano Banana 2 stays available at the same price, so existing integrations don’t have to move.
Nano Banana 2.1, 2K, 16:9: 25 s, $0.045

Nano Banana 2, 2K, 16:9: 21 s, $0.055
Before you call
1
Create an API key
In Token management, create a key in the
default group and set Billing mode (计费模式) to Usage first (按量优先, recommended) or Per-call (按次计费). A Usage-based (按量计费) key can’t call per-call models such as Nano Banana 2.1.2
Set the key and install the dependencies
3
Add a save function for cURL
The cURL examples need When the response holds no image, the function prints the error,
jq. This shell function saves the last non-thought image in a Gemini-native response, with the extension that matches its mimeType:promptFeedback, and finishReason fields instead.
The examples allow 300 seconds; give your client and any proxy the same headroom. An occasional request runs past that limit, so check call logs before resending one that timed out.
Generate an image
- cURL
- Python
candidates[0].content.parts[].inlineData.data, and mimeType gives its format. Both examples decode it and save a matching PNG, JPEG, or WebP file.
Without aspectRatio, the model picks the frame from the prompt. Output pixels for 1:1 and 16:9 are in the table under Before you call; other ratios are in Google’s image generation guide.
Edit images
Send the instruction first, then the reference images asinlineData parts, and refer to the images by their order in the prompt (“the first image”, “the second image”). Nano Banana 2.1 accepts up to 14 references: at most 10 object images and 4 character images.
- cURL
- Python
This request combines two local files. Build the body with
jq so large images don’t exceed shell argument limits, and keep each mimeType consistent with its file:Pass a large image by URL
Keep the whole request body under 20 MB. When a reference image is large or already on a CDN, pass its URL in afileData part instead of downloading and encoding it:
- Replace
https://cdn.example.com/your-photo.jpgwith your image URL and setmimeTypeto match its format. fileDataandinlineDataparts can share onepartsarray; they count as the first, second, and later references in order.- The server downloads the image, so the URL must be reachable without a login; see Large images and image URLs for the full conditions.
Ground images in Google Search
Add thegoogleSearch tool when an image depends on current facts or on what a real landmark looks like. This request turns on both web search and image search, and allows TEXT so any text the model writes comes back too:
searchTypesmust be an object. Without it, the tool uses web search only;imageSearchalone uses image search only.- The model decides whether to search and which type to use. The queries it ran appear in
groundingMetadata. - Image search can’t currently use real-world images of people as references.
- If you show grounded results to end users, display search suggestions as Google’s grounding guide requires.
- Each search adds $0.014 to the $0.045 call, so a request that runs 2 searches costs $0.073. Call logs show the number of searches; see the Nano Banana billing rules.
Use the OpenAI-compatible route
If your app already uses the OpenAI SDK, pointbase_url at https://api.laozhang.ai/v1 and set model to gemini-nano-banana-2.1. This route has no ratio, size, or format settings: it returns a 1K PNG whose frame the model picks from the prompt, often 16:9. For a fixed ratio, 2K and 4K, or JPEG, use the Gemini-native route.
The image comes back as a Base64 data URL inside message.content. Save this script as nano_banana_21_chat.py:
Errors and billing
Invalid parameters return HTTP 400 and aren’t charged. AnaspectRatio outside the 14 ratios, such as 7:3, returns 400, possibly with an empty error message; check the ratio against Parameters and limits. A request body that is too large returns 413; pass large images by URL instead.
- Each call costs $0.045, whatever the output size, thinking level, number of references, or whether it generates or edits.
- Google Search grounding adds $0.014 per search.
- A request can return HTTP 200 without an image, for example when the prompt doesn’t ask for one or a safety check blocks the output. It is charged as one call. Check
finishReason, then change the prompt or references before resending; see Avoid paying for empty responses. - Retry 429 and 5xx responses with backoff, and check call logs before resending a request that timed out.
FAQ
What do I change to move from Nano Banana 2?
Change the model ID fromgemini-3.1-flash-image to gemini-nano-banana-2.1; the request and response stay the same. Then check two things:
- Requests that set
"imageSize": "512"need1Kinstead, or should stay on Nano Banana 2. Nano Banana 2.1 returns a 1K image for them and charges the call. - Without a
thinkingLevel, Nano Banana 2.1 thinks atmedium, while Nano Banana 2 defaults tominimal. Setminimalexplicitly if you want the faster behavior.
How do I change the thinking level, and does it affect the price?
On the Gemini-native route, setgenerationConfig.thinkingConfig.thinkingLevel to minimal, medium, or high. Higher levels spend more effort on layout and text and take longer.
"includeThoughts": true, the response adds thought text and draft images marked "thought": true. The save_image function and the Python script skip them.
Does 4K cost more than 1K?
No. Every call costs $0.045 at 1K, 2K, and 4K alike, and that’s the amount your call logs show. Google bills by output tokens, about $0.113 for a 4K image, according to its pricing page. If you only need 1K images, Nano Banana 2 Lite costs less per call.Nano Banana 2.1 or Nano Banana Pro?
Start with Nano Banana 2.1 at $0.045 per call. Move to Nano Banana Pro (gemini-3-pro-image, $0.09 per call) when an image depends on world knowledge, multilingual text, or exact brand details, or when an edit needs style references and up to 5 character references. Both take the same request, so test your own prompts on both before deciding.
The same prompt at 2K, 16:9 on October 14, 2026 took 25 s on Nano Banana 2.1 and 69 s on Nano Banana Pro:

Nano Banana 2.1, 2K, 16:9: 25 s, $0.045

Nano Banana Pro, 2K, 16:9: 69 s, $0.09
Do I need a Google account or an AI Studio key?
No. A LaoZhang API key in thedefault group is enough; requests go to https://api.laozhang.ai with either the Gemini-native or the OpenAI-compatible format on this page.
Am I charged when a request fails or returns no image?
Any non-200 upstream response (a 400 for invalid parameters, or a 429 or 5xx before generation) isn’t charged. An HTTP 200 is charged as one call, with or without an image; see Errors and billing and the billing and failure rules.Can I get JPEG output?
Yes. On the Gemini-native route, addimageOutputOptions to generationConfig.imageConfig:
mimeTypeacceptsimage/png(the default) andimage/jpeg.image/webpreturns a 400 and isn’t billed.compressionQualityapplies to JPEG only and runs from 0 to 100; lower values give smaller files.- The response’s
inlineData.mimeTypechanges toimage/jpeg. The same 1K square image is about 1.1 MB as PNG and 40–60 KB as JPEG, at the same price. - The OpenAI-compatible route can’t set a format and always returns PNG.
Why does the OpenAI-compatible route return landscape images?
That route can’t pass an aspect ratio, so the model chooses the frame from the prompt, often 16:9. For square or portrait output, use the Gemini-native route and setaspectRatio.
Related pages and sources
- Nano Banana overview — compare the five models, the two protocols, and billing
- Nano Banana 2 — when you need 512px output
- Nano Banana 2 Lite — low-cost 1K images
- Nano Banana Pro — complex layouts and brand-critical assets
- Gemini protocol — native request structure and SDK setup
- Google: Gemini Nano Banana 2.1 — official capabilities and limits
- Google: Nano Banana image generation — sizes, aspect ratios, and reference limits
- Call logs — check a request’s status and charge