v1
latestOpenAPI 3.0.02026-07-265013.1 KBGenerate or Edit Image
Submit Nanobanana image generation or editing task.
Usage Modes
-
Text-to-Image Generation (TEXTTOIAMGE)
- Provide prompt and set type to "TEXTTOIAMGE"
- Model will generate a new image based on the text description
-
Image-to-Image Editing (IMAGETOIAMGE)
- Provide prompt, imageUrls and set type to "IMAGETOIAMGE"
- Model will edit the input images according to the prompt
Important Notes
- You can generate 1-4 images per request
- Callback URL is required for task completion notifications
post/api/v1/nanobanana/generate
Request body
Example request
{
"prompt": "A serene mountain landscape at sunset with a lake reflecting the orange sky",
"numImages": 1,
"type": "TEXTTOIAMGE",
"image_size": "16:9",
"callBackUrl": "https://your-callback-url.com/callback"
}Response
Request successful
Example response
{
"msg": "success",
"data": {
"taskId": "task12345"
}
}