Skip to main content
POST /v1/images/edits Start with multipart upload: model, prompt, image, and optional mask. Let the SDK/cURL generate the boundary; use repeated image[] when required by a multi-image channel. The JSON schema describes images[].image_url only for channels supporting that form; other plugins can differ. Confirm mask semantics, reference count, formats, and sizes for the model. The generic Files API is unimplemented; there is no universal file_id upload workflow. Integration guide and runnable example 简体中文

Authorizations

Authorization
string
header
required

模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials

Body

model
string
required

当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint

Example:

"YOUR_MODEL_ID"

prompt
string
required

任务描述;遵循模型的长度和内容要求 / Task description; follow model length and content requirements

image
file
required

输入图片文件;重复 image[] 的支持取决于渠道 / Input image file; repeated image[] support depends on the channel

n
integer

请求图片数,模型通常有更小限制;建议从 1 开始 / Requested image count; models usually impose a smaller limit; start with 1

Required range: 1 <= x <= 128
size
string

模型支持的尺寸,使用 x 而不是 × / Model-supported size; use x rather than ×

quality
string

质量档位,由模型决定 / Quality setting determined by the model

response_format
string

url 或 b64_json,仅在模型支持时指定;有些模型固定返回 Base64 / url or b64_json when supported; some models always return Base64

output_format
string

输出编码,例如 png、jpeg、webp;需模型支持 / Output encoding such as png, jpeg, webp; requires model support

background
string

背景选项;透明背景需模型和编码支持 / Background option; transparency requires model and format support

mask
file

可选蒙版;格式、尺寸与透明区域语义由模型决定 / Optional mask; format, dimensions, and transparent-area semantics depend on the model

Response

图片结果 / Image result

data
object[]
required

检查每项的 url 或 b64_json,不能仅凭 HTTP 200 判断有图片 / Check url or b64_json in each item; HTTP 200 alone does not guarantee an image

created
integer

Unix 秒 / Unix seconds