Generate image
POST /api/v1/image/nano-banana for text-to-image or image-to-image. Send multipart/form-data when uploading reference images.
Method: POSTPath: /api/v1/image/nano-banana
Payload fields
- prompt (required): description to generate.
- model (required): nano-banana-fast | nano-banana | nano-banana-pro.
- mode (optional): text-to-image (default) or image-to-image; image mode needs a reference image.
- aspectRatio (optional): default auto; accepts 1:1, 16:9, 9:16, etc.
- imageSize (optional): default 1K; accepts 1K/2K/4K.
- imageFile (optional, FormData): upload reference files for image-to-image; up to 14 files, each ≤10 MB.
- imageUrl (optional): reference image URL(s); accepts string or string[], counts toward the 14-image cap.
- imageData (optional, legacy): base64 data URL is still accepted for compatibility, but multipart upload is recommended.
Failure cases:400: missing required fields / no reference image for image-to-image / invalid model.;401: not logged in.;402: insufficient credits.;500: service configuration or downstream error.
Sample request
curl -X POST https://nanobananapro.cloud/api/v1/image/nano-banana \
-H "Authorization: Bearer api-key" \
-F "prompt=A banana cat in a spacesuit on the moon" \
-F "model=nano-banana-pro" \
-F "mode=image-to-image" \
-F "aspectRatio=auto" \
-F "imageSize=1K" \
-F "imageFile=@/path/to/ref.png"Sample response
{
"data": {
"id": "task-id-xxx",
"results": [],
"progress": 0,
"status": "running",
"failure_reason": null,
"error": null,
"credits_cost": 20
}
}