What Lite supports
The OpenAI-compatible route has no ratio setting; text-only prompts return 1:1 images.

Output of the generate example below: 1K, 16:9
Before you call
1
Create an API key
In Token management, open the create-token dialog (创建令牌), set Billing mode (计费模式) to Usage first (按量优先, recommended) or Per-call (按次计费), and click Create (创建). Lite has only a per-call price, and a Usage-based (按量计费) key can’t call it; the billing rules explain when a request is charged.
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. Define this shell function to save the last image in a Gemini-native response, which is the final result if interim images come back too, with the extension that matches its mimeType:promptFeedback, and finishReason fields instead.Generate an image
- cURL
- Python
candidates[0].content.parts[].inlineData.data, and mimeType gives its format. Both examples decode it and save a PNG, JPEG, or WebP file to match.
Edit an image
Put the instruction first and the image after it inparts. A local file goes in as Base64 inlineData, with a mimeType that matches the file.
- cURL
- Python
Build the request body with
jq so a large image doesn’t exceed shell argument limits:Use the OpenAI-compatible route
If your app already uses the OpenAI SDK, call Lite through chat completions. This route has no ratio or size settings, so a text-only prompt returns a 1:1 image at 1K. The image comes back as a Base64 data URL insidemessage.content. Save this script as nano_banana_lite_chat.py:
Run Lite at high volume
Lite suits drafts, previews, and interactive apps that create many images. The platform doesn’t limit concurrency, and an occasional429 comes from upstream capacity; see Concurrency and 429. For production traffic:
- Reuse HTTP connections instead of creating a new client for every image.
- Retry 429 and 5xx responses and network errors with jittered exponential backoff.
- Set a business timeout, and check call logs before retrying a timed-out request so it isn’t billed twice.
- Don’t retry an HTTP 200 response that has no image. It’s already charged, and resending the same content usually returns nothing again.
- Log the model, status code, latency, and request time of each call.
- Before a sustained launch, send your expected peak concurrency, daily volume, and input image sizes to support at hi@laozhang.ai to confirm capacity.
Errors and billing
- Lite supports only
1K. Don’t send512,2K, or4K; use Nano Banana 2.1, Nano Banana 2, or Pro for other sizes. - Write sizes with an uppercase K. Google rejects lowercase values such as
1k. - 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, so change the prompt or image before resending; see Avoid paying for empty responses.
- HTTP 401 means the key or the
Authorization: Bearerheader is wrong. Retry 429 and 5xx responses with backoff.
FAQ
Can Lite output 2K or 4K images, or use Google Search grounding?
No to both. Lite outputs 1K only and doesn’t support grounding. Usegemini-nano-banana-2.1 (Nano Banana 2.1, $0.045 per call) for 1K to 4K, gemini-3.1-flash-image (Nano Banana 2) when you also need 512px, 14 aspect ratios, or web and image search grounding, and gemini-3-pro-image (Nano Banana Pro) for 1K to 4K with web search grounding on complex layouts. All three take the same requests, so you only change the model ID.
Is Lite good for multi-image composites or consistent characters?
Not really. Lite accepts up to 14 object images, but Google’s reference table lists no character or style references for it, and Google notes that it isn’t optimized for multiple reference inputs or multi-turn sequential editing. Lite handles single-image local edits, such as swapping colors or adjusting a background. To combine several images into one or keep the same person consistent across a series, use Nano Banana 2.1 or Nano Banana 2, which take up to 10 object images and 4 character images.Is gemini-3.1-flash-lite-image a stable model ID?
Yes. Google’s model page lists it as the stable version, with no -preview suffix. Use it exactly as written.
Can I run Lite at high concurrency?
Yes. The platform doesn’t limit concurrency. Before launch, follow Run Lite at high volume for retries and timeouts, and tell support your expected peak so upstream capacity can be confirmed.Related pages and sources
- Nano Banana overview — compare the five models, the two protocols, and billing
- Nano Banana 2.1 — 1K to 4K output, 14 aspect ratios, and Search grounding at a lower price
- Nano Banana 2 — 512px to 4K output, 14 aspect ratios, and Search grounding
- Nano Banana Pro — complex layouts and brand-critical assets
- Nano Banana image editing (Standard) — choose between Lite and Nano Banana 2 when you move
gemini-2.5-flash-imageedits - Google: Nano Banana image generation — Gemini 3.1 Flash Lite Image sizes, aspect ratios, and reference limits
- Google: Gemini 3.1 Flash Lite Image model page — stable model ID and supported capabilities
- Call logs — check a request’s status and charge