Create Image Task
Creates an asynchronous text-to-image or image-to-image generation task.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Validation rules:
- Requests must use
application/json; multipart file upload is not supported modeland a non-emptypromptare requiredimage_urlsmust contain publicly accessible HTTP or HTTPS image URLs- An empty
image_urlsarray creates a text-to-image task; a non-empty array creates an image-to-image task
Image model to use.
gpt_image_2, nano_banana_2_lite, nano_banana_2, nano_banana_pro, gemini_25_flash_image Text instruction for image generation or editing.
1Publicly accessible HTTP or HTTPS input image URLs. Omit or pass an empty array for text-to-image. gpt_image_2 accepts up to 16 images; the other models accept up to 14. Multipart file upload is not supported.
16Output aspect ratio. Supported values vary by model; auto lets the model infer the ratio.
auto, 9:16, 2:3, 3:4, 4:5, 1:1, 5:4, 4:3, 3:2, 16:9, 21:9, 9:21, 1:2, 2:1, 1:4, 4:1, 1:8, 8:1 Output resolution. nano_banana_2_lite and gemini_25_flash_image support only 1K; the other models support 1K, 2K, and 4K.
1K, 2K, 4K Output quality for gpt_image_2. Other models ignore this field.
auto, low, medium, high Number of output images.
1 <= x <= 4