Skip to main content
POST
/
api
/
v3
/
openai
/
gpt-image-1
/
image-edit
gpt-image-1 (image edit)
curl --request POST \
  --url https://api.example.com/api/v3/openai/gpt-image-1/image-edit
OpenAI’s GPTProto format for the image edit API.
curl --location 'https://gptproto.com/api/v3/openai/gpt-image-1/image-edit' \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "image": [
        "https://heyoo.oss-ap-southeast-1.aliyuncs.com/ai-draw/java/test/d95aeb5f-2081-4db5-9e41-7230f51b49e0.png"
    ],
    "prompt": "The cat is running on the grassland",
    "n": 1,
    "quality": "auto",
    "background": "auto",
    "enable_sync_mode": "false",
    "response_format": "b64_json"
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
imagearray✅ Yes-The images to edit. A maximum of 16 reference images can be uploaded.
promptstring✅ YesThe cat is running on the grasslandA text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1.
maskstring❌ No-An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
ninteger❌ No1The number of images to generate. Must be between 1 and 10.
qualitystring❌ NoautoThe quality of the image that will be generated. Options: high, medium, low. Only supported for gpt-image-1.
backgroundstring❌ NoautoAllows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image.
enable_sync_modestring❌ NofalseWhether to enable synchronous mode. Options: false, true
response_formatstring❌ Nob64_jsonThe format in which the generated images are returned. Must be one of url or b64_json.