##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header when using:
Authorization: Bearer YOUR_API_KEYImage generation model name, currently two options available
-nano-banana-2-lite: Cost-effective, but slightly weaker stability
-gemini-3-pro-image-preview: Official channel, better stability and controllability, suitable for high-demand commercial scenarios
nano-banana-2-lite, gemini-3-pro-image-preview "nano-banana-2-lite"
Prompt describing the image to be generated, or describing how to edit the input image, limited to 2000 tokens
2000"A cat playing in the grass"
Aspect ratio of the generated image, default is auto
auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 Quality of the generated image, default is 2K
Note:
4K quality will incur additional charges1K, 2K, 4K Reference image URL list for image-to-image and image editing functions
Note:
1010MB.jpeg, .jpg, .png, .webp.png, .jpg)5 real person images can be uploaded[
"https://example.com/image1.png",
"https://example.com/image2.png"
]HTTPS callback address after task completion
Callback Timing:
Security Restrictions:
2048 charactersCallback Mechanism:
10 seconds3 retries on failure (retries after 1 second/2 seconds/4 seconds)"https://your-domain.com/webhooks/image-task-completed"
Image generation task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-uyujaw3d"
Actual model name used
"nano-banana-2-lite"
Specific task type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Asynchronous task information
Task output type
text, image, audio, video "image"
Usage and billing information