Quick Answer
- Supports prompt-based image generation with multiple aspect ratios.
- Supports reference_images for stronger style consistency.
- Official variants expose richer generation controls for production tuning.
Key Parameters
- model | string | required | gemini-3-pro-image-preview | - | Exact image model identifier from ToAPIs.
- prompt | string | required | - | - | Primary image instruction prompt.
- size | string | optional | 1:1 | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 21:9 | Output aspect ratio.
- resolution | string | optional | 1K | 1K | 2K | 4K(按模型能力) | Output resolution, varies by model variant.
- reference_images | file[] | optional | - | max 14 | Reference image array for style/composition control.
Common Errors
- 400 invalid_request_error: trigger=Missing or invalid request payload fields.; fix=Validate model/prompt/size/resolution fields.; retry=Retry only after fixing payload.
- 401 authentication_error: trigger=Missing or invalid API key.; fix=Verify Authorization header and API key scope.; retry=Retry after auth fix.
- 429 rate_limit_exceeded: trigger=Request rate, concurrency, or current quota hits upstream rate limiting.; fix=Apply exponential backoff first, then review request rate, concurrency, and quota usage.; retry=Use 1s/2s/4s backoff with jitter; if it persists, reduce submission pressure.


