Get API Key Get API
Docs

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

  • 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
Info

Model-name compatibility note: gemini-3.1-flash-lite-image also accepts the alias nano-banana-2-lite, and gemini-3.1-flash-lite-image-ext also accepts the alias nano-banana-2-lite-ext; each name and its alias are equivalent and interchangeable.

Request example

# model can be "gemini-3.1-flash-lite-image", the alias "nano-banana-2-lite" also works
curl --request POST \
  --url https://api.openveer.com/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
  }'

Response example

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

Authorizations

Authorization string

All 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_KEY

Body

model string

Image generation model name

The following model names are supported:

  • gemini-3.1-flash-lite-image (Nano Banana Lite, compatible alias nano-banana-2-lite)
  • gemini-3.1-flash-lite-image-ext (compatible alias nano-banana-2-lite-ext)

Note



Both share the same parameters and constraints (1K only, google_search / official_fallback not supported, up to 14 reference images). Neither has a -official variant, and neither supports the official_fallback fallback parameter. Billing is subject to the backend configuration of each channel.

The aliases `nano-banana-2-lite` (for `gemini-3.1-flash-lite-image`) and `nano-banana-2-lite-ext` (for `gemini-3.1-flash-lite-image-ext`) are equivalent to their original names and interchangeable.

nsfw_check boolean

Whether to run content moderation before submitting the image task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
prompt string

Text description for image generation

size string

Image aspect ratio

Supported ratios:

  • auto - Automatically choose the aspect ratio
  • 1:1 - Square, avatars, social media
  • 3:2 / 2:3 - Standard photos
  • 4:3 / 3:4 - Traditional display ratio
  • 16:9 / 9:16 - Widescreen / vertical video covers
  • 5:4 / 4:5 - Instagram images
  • 21:9 - Ultra-wide banner

Warning



For text-to-image, when size is auto, the default is 1:1 or 16:9; for image-to-image, the aspect ratio follows the upstream response. (We recommend specifying an aspect ratio.)

resolution string

Output image resolution

Supported values:

  • 1K - \~1024px, standard resolution (the only tier Lite supports)

Warning



Lite only supports 1K. Passing 2K / 4K / 0.5K is 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.

n integer

Number 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_urls array

Reference 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
webhook string

Task 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_search are not supported: Lite uses the Developer API's interactions endpoint, 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 to gemini-3.1-flash-image-preview.
  • mask_url inpainting 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

code integer

Response status code

data array
Response data array
status string

Task status

  * submitted - Submitted
task_id string

Unique task identifier

This documentation is built and hosted on Mintlify, a developer documentation platform.