根据原始图片和 Prompt 生成修改后的图片,使用 multipart/form‑data 上传 image 文件
Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
or
Body Params multipart/form-dataRequired
Request Code Samples
curl --location '/v1/images/edits' \
--header 'Authorization: Bearer <token>' \
--form 'model="gpt-image-2"' \
--form 'prompt="Change the character'\''s clothes to a black suit, keep the character'\''s pose and background unchanged"' \
--form 'image=@"二进制图片文件"' \
--form 'n="1"' \
--form 'size="1024x1024"' \
--form 'quality=""' \
--form 'response_format="url"' \
--form 'style=""' \
--form 'user=""'
Responses
{"created":1713833628,"data":[{"url":"https://cdn.example.com/image-001.png"}]}
Modified at 2026-08-19 06:43:15