Image generation.
Body
modelstringYes- A model ID in the IMAGE category
promptstringYes- 1–4000 characters
nintegerNo- Number of images to generate, 1–10 (default 1)
sizestringNo256x256·512x512·1024x1024·1792x1024·1024x1792·1536x1024·1024x1536·autoqualitystringNostandard·hd·low·medium·high·auto— see model-specific values and omission defaults belowresponse_formatstringNourl(default) ·b64_jsonuserstringNo- End-user identifier
Some models have a lower limit on n (see the Imagen model notes).
For the image models you can use, check GET /v1/models for entries whose category is IMAGE.
Model-specific size, quality, and count
Check capabilities.image_generation, limits.max_images, limits.supported_sizes, and limits.supported_qualities in GET /v1/models. Omitted fields mean unverified support. Even a value in the shared schema returns 400 when the model does not support it.
| Model | Supported values and meaning |
|---|---|
| Native Gemini image | Supports only n: 1. Explicit quality returns 400. auto/omission uses provider defaults; 1024x1024 means 1:1, 1536x1024 means 3:2, 1024x1536 means 2:3, 1792x1024 means 16:9, and 1024x1792 means 9:16. These are not guarantees of exact pixel dimensions |
| Gemini 3 image | These aspect ratios use a 1K resolution request by default. 512x512 is supported only by Gemini 3.1 Flash Image; 256x256 is unsupported. Gemini 3.1 Flash-Lite Image supports 1K only |
| Gemini 2.5 image | Uses the provider's fixed native resolution. 256x256 and 512x512 are unsupported |
| Imagen | Regular generation supports n: 1–4; upscale uses the edit endpoint with 1. Explicit quality returns 400. Sizes are aspect-ratio aliases, not pixel guarantees: all three square sizes mean 1:1; 1536x1024 means 4:3, 1024x1536 means 3:4, 1792x1024 means 16:9, and 1024x1792 means 9:16 |
| OpenAI GPT Image | Supports low/medium/high/auto. standard→medium and hd→high are compatibility aliases. Omitted quality retains the existing medium default. Sizes are limited to 1024x1024, 1536x1024, 1024x1536, and auto; omission uses 1024x1024. 256x256 and 512x512 return 400 instead of being enlarged |
| Meta image | Explicit quality returns 400 |
Returns
url is a presigned URL valid for 10 minutes. To keep an image longer, download and store it yourself.
Once it expires you can re-issue one through GET /v1/outputs/{requestId} for up to 24 hours.