gpt-image-2.5
Call gpt-image-2.5-flare and gpt-image-2.5-sunburst through the unified async task API
GPT-Image-2.5 uses the unified asynchronous task API. Submit a task to /api/generate/submit, save the returned platform task_id, then poll /api/generate/status/:task_id for the result.
gpt-image-2.5-flareprioritizes speed for everyday generation, batches, and rapid prototyping.gpt-image-2.5-sunburstprioritizes editing precision for product imagery and production-ready creative work.- Put every request parameter at the top level of the JSON body. Reference images must be public HTTP(S) URLs.
naccepts 1–4. When multiple images are generated,data.filescontains every result.
Both models support localized editing with mask_url, accepting a public HTTP(S) URL or PNG Data URL. The mask must have an alpha channel and match the first reference image; fully transparent areas mark edits. image and images together accept up to 16 references. Masks have no effect without a reference image.
Authorization
BearerAuth
使用用户令牌认证:Authorization: Bearer sk-xxxxxx
In: header
Request Body
application/json
Flare 速度优先;Sunburst 编辑精度优先。
"gpt-image-2.5-flare" | "gpt-image-2.5-sunburst"生成或编辑指令,必填。
输出比例或精确像素尺寸。支持 auto、1:1、3:2、2:3、4:3、3:4、5:4、4:5、16:9、9:16、2:1、1:2、21:9、9:21、3:1、1:3,或如 1600x1200。
"auto"比例尺寸的分辨率档位;精确像素尺寸下会被上游忽略。
"1k""1k" | "2k" | "4k""auto""auto" | "low" | "medium" | "high" | "xhigh" | "max"生成图片数量。
11 <= value <= 4"png""png" | "jpeg" | "webp"仅对 jpeg 或 webp 生效,其他格式忽略;0 会被正常透传。
0 <= value <= 100transparent 仅可搭配 png 或 webp。
"transparent" | "opaque" | "auto""low""auto" | "low"单张公网 HTTP(S) 参考图 URL。
uri多张公网 HTTP(S) 参考图 URL;与 image 合计最多 16 张,image 排在最前。
items <= 16Flare 和 Sunburst 均支持。接受公网 HTTP(S) URL 或 data:image/png;base64,...,仅提供参考图时生效。须为带 Alpha 通道的 PNG,尺寸与第一张参考图一致,alpha=0 区域用于修改;多参考图时仅作用于第一张,不保证蒙版外像素完全不变。调用方保证格式、尺寸与可访问性。建议小于 4 MB,非已验证硬上限。
可选。任务终态时由平台 POST 的回调地址。
uriResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.apimp.ai/api/generate/submit" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2.5-sunburst", "prompt": "仅将蒙版透明区域替换为金色丝带", "images": [ "https://example.com/product.png" ], "mask_url": "https://example.com/mask.png", "quality": "xhigh" }'{
"code": 200,
"data": {
"task_id": "task_01KXXXXXXXXXXXXXXX",
"status": "not_started",
"created_time": "2026-09-09T10:30:00",
"error_message": null
}
}{
"code": 400,
"error": {
"message": "string",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "string",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "string",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "string",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "string",
"type": "invalid_request_error"
}
}How is this guide?
Last updated on