##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, official channel with better stability and controllability, suitable for commercial scenarios
gemini-3-pro-image-preview "gemini-3-pro-image-preview"
Prompt describing the image you want to generate, or describing how to edit the input image, limited to 2000 tokens
2000"A cat playing on the grass"
Aspect ratio of 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 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 features
Note:
10 images10MB.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
"gemini-3-pro-image-preview"
Specific task type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Async task information
Task output type
text, image, audio, video "image"
Usage and billing information