Skip to main content
POST
/
v1
/
images
/
edits
gemini-3-pro-image-preview (image edit)
curl --request POST \
  --url https://api.example.com/v1/images/edits
Gemini’s OpenAI-compatible format for the image edit API.
curl --location 'https://gptproto.com/v1/images/edits' \
--header 'Authorization: sk-***********' \
--form 'model="gemini-3-pro-image-preview"' \
--form 'image="@/path/to/image.jpg"' \
--form 'prompt="Add a smiling face to the image"' \
--form 'n="1"' \
--form 'size="1024x1024"'
{
  "error": {
    "message": "Invalid request: The image format is not supported",
    "type": "400"
  }
}

Path Parameters

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yes-The model to use for image editing (e.g., “gemini-3-pro-image-preview”).
imagefile✅ Yes-The image file to edit. Must be a PNG, JPEG, or WEBP file.
maskfile❌ No-An optional mask image that specifies where to edit the image.
promptstring✅ Yes-The text prompt describing the desired edits.
ninteger❌ No1The number of images to generate.
sizestring❌ No1024x1024The size of the generated images (e.g., “256x256”, “512x512”, “1024x1024”).
response_formatstring❌ NourlThe format of the response (“url” or “b64_json”).
stylestring❌ NovividThe style of the generated images (“vivid” or “natural”).