POST
/
v1
/
images
/
edits
Image Editing (gpt-image-1.5)
curl --request POST \
  --url https://api.example.com/v1/images/edits

Image Editing (gpt-image-1.5)

Edit existing images using the gpt-image-1.5 model based on text prompts.

Endpoint

POST /v1/images/edits

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID: gpt-image-1.5
promptstringYesText describing how to edit the image
imagefile/stringYesThe image to edit, can be a file upload or URL
nintegerNoNumber of images to generate, default 1
sizestringNoImage size, default 1024x1024

Request Example

curl -X POST "https://www.anyfast.ai/v1/images/edits" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-1.5",
    "prompt": "a cute pig",
    "image": "https://example.com/original-image.png",
    "n": 1,
    "size": "1024x1024"
  }'

Response Example

{
  "created": 1700000000,
  "data": [
    {
      "url": "https://example.com/edited-image.png",
      "revised_prompt": "a cute pig"
    }
  ]
}

Response Fields

FieldTypeDescription
createdintegerCreation timestamp
dataarrayList of edited images
data[].urlstringImage URL
data[].revised_promptstringModel’s revised prompt