GPT Image 2 Edit Image
Edit an image with an instruction.
01概述
Edit applies a natural-language instruction to an existing image, optionally guided by a mask, and preserves the untouched regions.
POST
/api/v1/images/editsBase URL https://capi.minapp.xinAPI 版本 v1认证方式 Bearer YOUR_API_TOKEN
02参数
| 名称 | 类型 | 说明 |
|---|---|---|
| model* | string | Model ID, e.g. gpt-image-2.5-edit-image. |
| image_url* | string | Image to edit. |
| prompt* | string | Instruction describing the change. |
| mask_url | string | Optional mask restricting the edit area. |
03请求体
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"
}示例
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" }
}