GPT Image 2 Edit Image

Edit an image with an instruction.

01Overview

Edit applies a natural-language instruction to an existing image, optionally guided by a mask, and preserves the untouched regions.

POST/api/v1/images/edits
Base URL https://capi.minapp.xinAPI version v1Authentication Bearer YOUR_API_TOKEN

02Parameters

NameTypeDescription
model*stringModel ID, e.g. gpt-image-2.5-edit-image.
image_url*stringImage to edit.
prompt*stringInstruction describing the change.
mask_urlstringOptional mask restricting the edit area.

03Request body

JSON
{
  "model": "gpt-image-2.5-edit-image",
  "image_url": "https://file.capi.minapp.xin/images/out-1.png",
  "prompt": "swap the background to a snowy street",
  "mask_url": "https://file.capi.minapp.xin/masks/bg.png"
}

Example

GPT Image 2 Edit Image

cURL
curl -X POST https://capi.minapp.xin/api/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.5-edit-image",
    "image_url": "https://file.capi.minapp.xin/images/out-1.png",
    "prompt": "swap the background to a snowy street"
  }'
HTTP 200· OK
{
  "data": [
    { "url": "https://file.capi.minapp.xin/images/edited-1.png" }
  ],
  "cost": { "amount": 0.06, "currency": "USD" }
}