Unode
User GuideAPI ReferenceHelp & SupportBusiness Cooperation

Edit Image

Creates edited images from one or more input images and a prompt. Use response_format to request temporary image URLs or Base64 data.

POST
/v1/images/edits
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

image*file|

要编辑的一张或多张图像。多图请求使用 image[] 字段。

mask?file

可选遮罩图像。

Formatbinary
model*string

用于图像编辑的模型,例如 gpt-image-1、gpt-image-1.5 或 gpt-image-2。

prompt*string

期望编辑效果的文本描述。

n?integer
Default1
Range1 <= value <= 10
size?string
quality?string
background?string
Value in"transparent" | "opaque" | "auto"
output_format?string
Value in"png" | "jpeg" | "webp"
output_compression?integer
Range0 <= value <= 100
input_fidelity?string
Value in"high" | "low"
response_format?string

响应图像格式。url 请求图像 URL,仅适用于非流式完整 JSON 响应;原生 URL 会直接返回,Base64-only 模型会在 URL 交付已启用时返回临时签名 URL。b64_json 返回 Base64 数据。不传时保留模型或上游渠道的默认行为。

Value in"url" | "b64_json"
user?string

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/images/edits" \  -F image="string" \  -F model="string" \  -F prompt="string"
{
  "created": 0,
  "data": [
    {
      "url": "http://example.com",
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ],
  "usage": {}
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "image_delivery_error",
    "code": "image_url_delivery_failed"
  }
}
{
  "error": {
    "message": "string",
    "type": "image_delivery_error",
    "code": "image_url_delivery_unavailable"
  }
}

Last updated on