Nano Banana Lite Image Generation
The fastest and cheapest image model in the Gemini 3.1 family, designed for large-scale, low-cost image generation
전체 문서/v1/images/generations- Supports 1K resolution only (passing 2K/4K/0.5K is automatically downgraded to 1K without an error)
- Supports text-to-image and image-to-image, up to 14 reference images
- Billed by input / output tokens; connects directly to the official Gemini channel, with asynchronous task-based image generation
Note
Model-name compatibility note:
gemini-3.1-flash-lite-imagealso accepts the aliasnano-banana-2-lite, andgemini-3.1-flash-lite-image-extalso accepts the aliasnano-banana-2-lite-ext; each name and its alias are equivalent and interchangeable.
요청 예시
# model can be "gemini-3.1-flash-lite-image", the alias "nano-banana-2-lite" also works
curl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-3.1-flash-lite-image",
"prompt": "赛博朋克风格的城市夜景,霓虹灯闪烁",
"size": "16:9",
"resolution": "1K",
"n": 1
}'Authorizations
AuthorizationstringrequiredAll API endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key Management Page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEYBody
modelstringrequireddefault: gemini-3.1-flash-lite-imageImage generation model name
The following model names are supported:
gemini-3.1-flash-lite-image(Nano Banana Lite, compatible aliasnano-banana-2-lite)gemini-3.1-flash-lite-image-ext(compatible aliasnano-banana-2-lite-ext)
Note
Both share the same parameters and constraints (1K only,
google_search/official_fallbacknot supported, up to 14 reference images). Neither has a-officialvariant, and neither supports theofficial_fallbackfallback parameter. Billing is subject to the backend configuration of each channel.The aliases
nano-banana-2-lite(forgemini-3.1-flash-lite-image) andnano-banana-2-lite-ext(forgemini-3.1-flash-lite-image-ext) are equivalent to their original names and interchangeable.
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the image task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequiredText description for image generation
sizestringImage aspect ratio
Supported ratios:
auto- Automatically choose the aspect ratio1:1- Square, avatars, social media3:2/2:3- Standard photos4:3/3:4- Traditional display ratio16:9/9:16- Widescreen / vertical video covers5:4/4:5- Instagram images21:9- Ultra-wide banner
Warning
For text-to-image, when
sizeisauto, the default is1:1or16:9; for image-to-image, the aspect ratio follows the upstream response. (We recommend specifying an aspect ratio.)
resolutionstringdefault: 1KOutput image resolution
Supported values:
1K- ~1024px, standard resolution (the only tier Lite supports)
Warning
Lite only supports 1K. Passing
2K/4K/0.5Kis silently downgraded to 1K — it won't raise an error, nor will it actually output higher resolution. The frontend UI does not need to expose a resolution option.
nintegerdefault: 1Number of images to generate
Range: 1 to 4, default 1
When n>1, the backend sends multiple concurrent requests upstream and bills by the actual number of successful images. We recommend the frontend always send 1 (to show progress image by image and make billing more intuitive).
⚠️ Note: Must enter a plain number (e.g., 1), do not use quotes or it will cause an error
image_urlsarrayReference image URL list for image-to-image generation
Two formats are supported:
1. Full image URL
- Publicly accessible image URL (http:// or https://)
- Example:
https://example.com/image.jpg
2. Base64 encoded format
- Must use the full Data URI format
- Format:
data:image/{format};base64,{base64data} - Supported image formats: jpeg, png, webp
- Example:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg... - ⚠️ Note: Must include the
data:image/jpeg;base64,prefix
Limitations:
- Maximum 14 reference images (recommended: up to 10 object refs + 4 character refs)
- Single image size: not exceeding 10MB
- Supported formats: jpeg, png, webp
webhookstringTask callback URL (base)
When a task succeeds / fails, the platform calls back to webhook + /callback (it does not forward the upstream request). Passing this parameter can significantly reduce polling; we still recommend keeping polling as a fallback.
Note
Lite usage notes
google_search/google_image_searchare not supported: Lite uses the Developer API'sinteractionsendpoint, and the upstream has not enabled the Search tool (it returns "Search as tool is not enabled for this model"), so the platform adapter does not send this parameter either. Passing it won't raise an error and images are generated as usual, but there is no search enhancement effect at all. If you need search enhancement, switch togemini-3.1-flash-image-preview.mask_urlinpainting is not supported (the Gemini family uses aspect ratio + reference images rather than masks).- Billed by token (unlike the fixed per-image price of flash/pro): input is about $0.25 per million tokens, image output is about $30 per million tokens, and a single 1K image ≈ 1120 output tokens ≈ $0.0336/image. The actual price is subject to the backend multiplier configuration.
- All generated images contain Google's SynthID invisible watermark (upstream behavior, cannot be disabled).
Response
codeintegerResponse status code
dataarrayResponse data array
Properties
statusstringTask status
submitted- Submitted
task_idstringUnique task identifier
응답
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}이 엔드포인트를 사용하는 모델
이 문서에서 문제를 발견하셨나요? support@apisea.ai(으)로 이메일을 보내주세요.