Request
Input

Response

Parameters
header
An optional header used for spend logging metadata, containing JSON properties like
user_id, project_id, and env.string
required
Name of the model to use (for example: gemini-3.1-flash-image-preview). To see the complete list of supported image generation models, visit: https://znapai.com/models/image_generation
string
required
Text description of the desired edit.
file | array
required
Reference image(s) to edit. Must be uploaded via multipart form data — image URLs are not supported.Supported number of images:
-
gemini-2.5-flash-image: up to 3 images -
gemini-3.1-flash-image: up to 14 images -
gemini-3-pro-image: up to 14 images - GPT models: up to 16 images
-
-F "image=@file.png"or-F "image[]=@file1.png" -F "image[]=@file2.png"
file | object
Alpha mask PNG. Transparent areas are regenerated; opaque areas are preserved. Must be uploaded via multipart — mask URLs are not supported.
-F "mask=@mask.png"
string
default:"1024x1024"
Output image dimensions. Supports arbitrary
WIDTHxHEIGHT where both edges are multiples of 16, aspect ratio between 1:3 and 3:1, max edge 3840.Standard values: 1024x1024, 1536x1024, 1024x1536, auto.Supported values depend on the selected model. See the OpenAI image generation guide for the latest model-specific ranges.string
default:"auto"
Allowed values:
low, medium, high, autointeger
default:"1"
Number of edited images to return.
string
default:"png"
Allowed values:
png, jpeginteger
Compression level (0–100). Only applies when
output_format is jpeg.string
default:"auto"
Allowed values:
auto, lowboolean
default:"false"
Stream partial edit results.
integer
Number of partial images during streaming (0–3). Only used when
stream is true.