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.
Authorization
Bearer
AuthorizationBearer <token>
In: header
Request Body
multipart/form-data
image*file|
要编辑的一张或多张图像。多图请求使用 image[] 字段。
mask?file
可选遮罩图像。
Format
binarymodel*string
用于图像编辑的模型,例如 gpt-image-1、gpt-image-1.5 或 gpt-image-2。
prompt*string
期望编辑效果的文本描述。
n?integer
Default
1Range
1 <= value <= 10size?string
quality?string
background?string
Value in
"transparent" | "opaque" | "auto"output_format?string
Value in
"png" | "jpeg" | "webp"output_compression?integer
Range
0 <= value <= 100input_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
