概要
- 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.
主要パラメータ
- model | string | 必須 | gemini-3.1-flash-image-official | - | Exact image model identifier from ToAPIs.
- prompt | string | 必須 | - | - | Primary image instruction prompt.
- size | string | 任意 | 1:1 | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 21:9 | Output aspect ratio.
- resolution | string | 任意 | 1K | 1K | 2K | 4K(按模型能力) | Output resolution, varies by model variant.
- reference_images | file[] | 任意 | - | max 14 | Reference image array for style/composition control.
- temperature | number | 任意 | 0.8 | 0-2 | Sampling temperature for diversity control.
- topP | number | 任意 | 0.95 | 0-1 | Nucleus sampling threshold.
よくあるエラー
- 400 invalid_request_error: 発生条件=Missing or invalid request payload fields.; 対処=Validate model/prompt/size/resolution fields.; 再試行=Retry only after fixing payload.
- 401 authentication_error: 発生条件=Missing or invalid API key.; 対処=Verify Authorization header and API key scope.; 再試行=Retry after auth fix.
- 429 rate_limit_exceeded: 発生条件=Request rate, concurrency, or current quota hits upstream rate limiting.; 対処=Apply exponential backoff first, then review request rate, concurrency, and quota usage.; 再試行=Use 1s/2s/4s backoff with jitter; if it persists, reduce submission pressure.







