Nano Banana 2 Lite
An image-to-image model (NANOBANANA-2-LITE) available through the ImageGPT Image Generation API. The example below uses image-to-image (/generate/image-image) with an input image.
| Property | Value |
|---|---|
| Model ID | NANOBANANA-2-LITE |
| Playground | Image |
| Pricing | 10 credits per image |
Headers
Send your API key in the x-api-key header on every request. See
Authentication for details.
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | YOUR_API_KEY |
Content-Type | Yes | application/json |
A missing or invalid key returns 401 Unauthorized.
Parameters
Request body fields for /generate/image-image:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Model ID to use for generation. See the model list below for all available IDs. |
prompt | string | Yes | — | Text description of the image you want to generate. |
width | number | No | 512 | Output image width in pixels. |
height | number | No | 512 | Output image height in pixels. |
outputType | string | No | "binary" | Output delivery format. One of "binary" (image blob), "url" (hosted link), or "base64" (encoded string). |
outputFormat | string | No | "png" | Image file format. Either "png" or "jpg". |
image | string[] | No | — | Array of input image URLs (max 3). Required only for image-to-image generation. |
Request examples
- cURL
- JavaScript
- Python
curl -X POST https://api.imagegpt.online/generate/image-image \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"prompt":"Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo","width":512,"height":512,"model":"NANOBANANA-2-LITE","outputType":"binary","outputFormat":"png","image":["https://ai.imagegpt.online/sample/437104513_792860259041679_1643623203130153012_n.jpg"]}'
fetch('https://api.imagegpt.online/generate/image-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
"prompt": "Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo",
"width": 512,
"height": 512,
"model": "NANOBANANA-2-LITE",
"outputType": "binary",
"outputFormat": "png",
"image": [
"https://ai.imagegpt.online/sample/437104513_792860259041679_1643623203130153012_n.jpg"
]
})
})
.then(res => res.blob())
.then(blob => {
const img = new Image();
img.src = URL.createObjectURL(blob);
document.body.appendChild(img);
});
import requests
resp = requests.post(
"https://api.imagegpt.online/generate/image-image",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"prompt": "Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo",
"width": 512,
"height": 512,
"model": "NANOBANANA-2-LITE",
"outputType": "binary",
"outputFormat": "png",
"image": [
"https://ai.imagegpt.online/sample/437104513_792860259041679_1643623203130153012_n.jpg"
]
},
)
with open("image.png", "wb") as f:
f.write(resp.content)
Response example
binary
const blob = await response.blob();
const url = URL.createObjectURL(blob);
url
{
"success": true,
"taskId": "imagegpt_img-...",
"url": "https://...",
"creditsDeducted": 3
}
base64
{
"success": true,
"taskId": "imagegpt_img-...",
"base64": "/9j/4QWm...",
"creditsDeducted": 3
}
Pricing
10 credits per image. Each image deducts the credit value shown for the selected model.
Playground
Try this model live. Your key is used only in your browser to call the API directly and is never stored. This example sends an input image URL; swap it for your own.
The browser playground calls https://api.imagegpt.online directly, so it only works if the API
allows cross-origin requests from this site. If it is blocked, use the cURL,
JavaScript, or Python samples above from your own server.