Skip to content
English

Nano Banana 2 Lite API

POST /v1/tasks

All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name Nano-Banana-2-Lite
Type Image generation (text-to-image)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

Google Nano Banana 2 Lite: the entry tier of the Nano Banana family — low-latency 1K output at an ultra-low price, up to 10 optional reference images, 15 ratios including ultra-wide banners.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.

Best suited for

High-volume drafts

The lowest unit price in the family with low latency — first choice for batch generation, fast prompt iteration and high-concurrency loads.

prompt
Optional reference remixing

Up to 10 reference images for editing and style blending; omit them for pure text-to-image — one model, both modes.

image_urls
Ultra-wide banners

Fifteen ratios including 8:1 / 1:8 cover web banners and tall vertical layouts.

aspect_ratio
Entry tier & playgrounds

Fixed 1K output at a flat per-image price — ideal as the default trial tier in your product.

promptaspect_ratio

Request parameters

model string required

Fixed value Nano-Banana-2-Lite.

example Nano-Banana-2-Lite
input object required

Business parameters. Put Nano Banana 2 Lite-specific configuration here.

prompt string required

Text prompt for the image. Maximum 20000 characters.

image_urls string[] optional

Optional reference image URLs (up to 10) for editing or remixing. JPEG/PNG/WebP, up to 30MB each. Omit for pure text-to-image.

aspect_ratio enum required

Output aspect ratio. auto lets the model choose.

default auto enum: auto1:12:33:23:44:34:55:49:1616:9 +5
callback object optional

Optional callback configuration. When set, HiAPI notifies your service when the task reaches a terminal state.

url string required

Required when callback is set; HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final.

default final enum: final

Example requests

Bioluminescent jellyfish (photoreal)

16:9 — dark-scene lighting and detail.

Request body
{
  "model": "Nano-Banana-2-Lite",
  "input": {
    "prompt": "A single giant bioluminescent jellyfish as the hero subject in deep dark water, intricate glowing lace-like tentacles in cyan fading to magenta, a school of tiny silver fish circling it, cinematic composition, dramatic directional lighting, ultra-detailed, premium commercial finish, subtle film grain",
    "aspect_ratio": "16:9"
  }
}
Desert night camp

3:2 — warm/cold contrast night scene.

Request body
{
  "model": "Nano-Banana-2-Lite",
  "input": {
    "prompt": "A glowing canvas tent under a starry desert sky, camera low behind wind-carved dune ridges leading to the tent, warm lantern glow contrasting cold blue night sand, shooting star streak, cinematic composition, ultra-detailed",
    "aspect_ratio": "3:2"
  }
}
Poster to sticker set (reference remix)

Pass one reference poster, redraw as stickers.

Request body
{
  "model": "Nano-Banana-2-Lite",
  "input": {
    "prompt": "Redraw this dim sum menu poster as a cute flat sticker set: each dish becomes a glossy die-cut sticker with bold white borders on a soft pastel mint background, keep all the bilingual dish names readable, playful kawaii style",
    "image_urls": [
      "https://static.hiapi.ai/previews/seedream-5.0-lite/2026/07/03/1783057560002-96c337af0a111069-seedream-lite-t2i-g4-dimsum.webp"
    ],
    "aspect_ratio": "3:4"
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated image from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

FAQ

Lite vs Nano Banana 2 / Pro — which one?

Lite is fixed 1K, the cheapest and fastest — best for batches and playgrounds. Pick Nano-Banana-2 or Nano-Banana-Pro when you need 2K/4K output or higher fidelity. All three share the same parameter style; switching is just a model name change.

Are reference images supported? How is it billed?

Up to 10 optional reference images (JPEG/PNG/WebP, ≤30MB each) for editing or style blending. Billing is a flat per-image price whether or not you pass references. See the pricing page for live rates. View pricing

What does aspect_ratio auto do?

auto lets the model pick a suitable ratio from your prompt; specify one of the 15 fixed ratios (including 8:1 / 1:8 banners) when you need exact dimensions.

How do I get the generated image?

The request returns a taskId immediately. When the task reaches a terminal state, download the image from output[].url. In production, pass callback.url at the top level of the request body instead of polling.

Next steps