nano-banana-2-lite
Nano Banana 2 Lite (Gemini 3.1 Flash-Lite Image) on reAPI — fast, low-cost 1K text-to-image and prompt-based image editing with up to 10 reference images, on one async endpoint.
Google DeepMind's Nano Banana 2 Lite (aka Gemini 3.1 Flash-Lite Image) on
reAPI — the speed-focused member of the Nano Banana family: fast 1K
text-to-image and prompt-based image editing with up to 10 reference
images. Submit returns a task_id; poll until ready. See current pricing on
the model page.
Quick example
curl https://reapi.ai/api/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2-lite",
"prompt": "a pig on the grass, cinematic light",
"aspect_ratio": "16:9"
}'import requests
resp = requests.post(
"https://reapi.ai/api/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "nano-banana-2-lite",
"prompt": "a pig on the grass, cinematic light",
"aspect_ratio": "16:9",
},
timeout=30,
)
print(resp.json())const r = await fetch("https://reapi.ai/api/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "nano-banana-2-lite",
prompt: "a pig on the grass, cinematic light",
aspect_ratio: "16:9",
}),
});
console.log(await r.json());package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"model": "nano-banana-2-lite",
"prompt": "a pig on the grass, cinematic light",
"aspect_ratio": "16:9",
})
req, _ := http.NewRequest("POST",
"https://reapi.ai/api/v1/images/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}Submit response
{
"id": "task_019f25700fef760e879fc22ad9de512c",
"model": "nano-banana-2-lite",
"status": "processing",
"created_at": 1783039530
}Poll GET /api/v1/tasks/{id} (see the Tasks reference) until
status === "completed". The completed payload's output.image_urls holds the
generated image URL.
Authentication
Every call needs a Bearer token. Generate keys at reapi.ai/settings/apikeys.
Authorization: Bearer YOUR_API_KEYEndpoint
POST /api/v1/images/generations
GET /api/v1/tasks/{id}Submission is async. The POST returns immediately with a task_id; the task
endpoint returns the same envelope until completion. Polling does not consume
credits.
The generation mode is implicit — there is no mode field:
- No
image_urls(or an empty array) → text-to-image. image_urlsset → prompt-based editing / reference-driven generation using up to 10 input images.
Each request produces exactly one 1K image (no n parameter, no
resolution control).
Request body
model — string, required
Must be nano-banana-2-lite.
prompt — string, required
Up to 20,000 characters. For text-to-image, describe subject, scene, style and composition. For editing, state the change you want ("replace the background with…", "make it nighttime, keep the subject unchanged").
image_urls — string[], optional
Up to 10 public http(s) image URLs used as edit sources or visual references. Accepted types: JPEG, PNG, WebP; up to 30 MB per image. Omit it (or pass an empty array) for pure text-to-image.
Base64 / data: URIs are rejected platform-wide — host the image on a
public URL first.
aspect_ratio — string, default auto
One of 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4,
8:1, 9:16, 16:9, 21:9, auto. With auto the model chooses the
ratio itself (for edits it follows the source image).
Pricing
Nano Banana 2 Lite bills a flat rate per generated image, independent of aspect ratio and mode (text-to-image and editing cost the same). Each request produces one image:
credits = ceil(per_image_usd × 1000)where 1 credit = $0.001 USD. It is one of the lowest per-image rates on the
platform. Failed and rejected requests are not charged.
The exact per-image credit cost surfaces on the model page and through the playground estimator before submit.
Response
The poll envelope returns the image URL in output.image_urls:
{
"id": "task_019f25700fef760e879fc22ad9de512c",
"model": "nano-banana-2-lite",
"status": "completed",
"output": {
"image_urls": [
"https://cdn.reapi.ai/...jpeg"
]
}
}Generated URLs expire — mirror them to your own storage if you need long-term retention.
Errors
Failures return the standard reAPI envelope { error: { code, message, request_id } }. Common cases:
- Invalid input (prompt over 20,000 characters, more than 10
image_urls, an unsupportedaspect_ratio) →400. - Insufficient credits →
402. - Rate limited →
429.
See the full catalog at /docs/api/errors.
Tips
- Nano Banana 2 Lite is the speed tier of the Nano Banana family — pick it for drafts, previews and high-volume 1K assets; step up to Nano Banana 2 when you need 2K/4K output or maximum quality.
- For edits, reference what should stay unchanged ("keep the furniture and composition unchanged") — the model is strong at targeted, consistent edits.
aspect_ratio: "auto"follows the source image on edits; set an explicit ratio when you need a fixed canvas (e.g.16:9thumbnails).