编辑图像
根据一个或多个输入图像和提示创建编辑图像。支持通过 response_format 选择返回图像 URL 或 Base64 数据。Base64-only 模型的 URL 交付需要由平台管理员启用。
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"
}
}最后更新于
