curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-image-2.6-flare/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": [
"https://cdn.vidgo.ai/temp/reference-product.png"
],
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-10-09T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}OpenAI
GPT Image 2.6 Flare 图像编辑
GPT Image 2.6 Flare 图像编辑 API 基于 1–16 张参考图编辑出一张 1K、2K 或 4K 图像,支持可选蒙版、透明背景和输出压缩。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-image-2.6-flare/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": [
"https://cdn.vidgo.ai/temp/reference-product.png"
],
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-10-09T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
openai/gpt-image-2.6-flare/text-to-image)。GPT Image 2.6 的参数与 GPT Image 2.5 Flare 相同,另外新增 output_compression、moderation 和 complexity。
模型
- openai/gpt-image-2.6-flare/edit — GPT Image 2.6 Flare 图像编辑,1–16 张参考图,每次请求生成一张图像。
功能
- 基于文字指令编辑,最多 16 张参考图,在提示词中按顺序引用。
- 可选蒙版,只编辑指定区域。
- 三档分辨率(
1K、2K、4K),支持宽高比预设、auto或自定义WIDTHxHEIGHT尺寸。 - 五档质量:
low、medium、high、xhigh、max。 - 透明或不透明背景;输出 PNG、JPEG 或 WebP。
- 可调节 JPEG/WebP 压缩、内容审核强度和规划力度(
complexity)。
必填参数
prompt(string):描述编辑内容的文字指令。最多 32,000 个字符,不能为空白。image_urls(string[]):1–16 张参考图,使用公开可访问的 HTTP(S) URL,顺序与提示词中引用的顺序一致。
可选参数
size(string):宽高比预设、auto或自定义WIDTHxHEIGHT。省略时输出跟随第一张参考图的宽高比。参见尺寸。resolution(string):1K、2K或4K。默认1K。quality(string):low、medium、high、xhigh或max。默认high。background(string):auto、transparent或opaque。默认auto。透明背景需要输出png或webp。output_format(string):png、jpeg或webp。默认png。output_compression(integer):压缩级别,0到100。仅当output_format为jpeg或webp时可用。省略时使用默认压缩。mask_url(string):选定编辑区域的蒙版图像,使用公开可访问的 HTTP(S) URL。需要同时传入image_urls。moderation(string):内容审核严格程度,auto或low。默认auto;low过滤更宽松。complexity(string):模型生成前的规划力度,low、medium或high。默认high。不影响价格。
尺寸
- 预设:
1:1、2:3、3:2、4:3、3:4、4:5、5:4、16:9、9:16、21:9。省略size时,输出跟随第一张参考图的宽高比,在所选resolution档位下取最接近的支持比例。传入size可覆盖。 - 预设保持所选
resolution档位;实际像素尺寸可能因每次生成而不同。需要精确像素时请使用自定义尺寸。 auto由模型决定图像尺寸(约 150 万像素),可与任意resolution搭配,按1K档计费。- 自定义
WIDTHxHEIGHT(用x或X分隔,例如2304x1536)可与任意resolution搭配。两条边都必须是 16 的倍数,最长边不超过 3,840 像素,宽高比不超过 3:1,总像素数在 655,360 到 8,294,400 之间。 - 自定义尺寸按总像素数对应的档位计费;所选
resolution更高时按所选档位:
| 总像素数(自定义尺寸) | 计费档位 |
|---|---|
| 不超过 1,572,864 | 1K |
| 1,572,865–4,194,304 | 2K |
| 超过 4,194,304 | 4K |
示例
- 使用参考图编辑:在
2K下替换背景,不传size,输出保持参考图的宽高比。 - 蒙版编辑:只修改蒙版区域,
size: auto。 - 透明背景:去除背景,WebP、
4K、xhigh质量。 - 自定义尺寸:把产品放入
2304x1536的全景场景,2K、medium质量。 - 压缩 JPEG:
3:2、medium质量,output_format: jpeg、output_compression: 80。
注意事项
- 每次请求只返回一张图像;
n不为1时返回 400。未列出的字段返回 400。model和callback_url放在请求根级,不放在input内。 - 透明背景搭配
output_format: jpeg返回 400。output_compression搭配output_format: png同样返回 400。 image_urls为空数组、超过 16 张,或 URL 不是有效的 HTTP(S) URL 时返回 400。- 积分取决于
quality、计费档位(resolution,或尺寸中所述的自定义尺寸档位)和参考图数量。complexity和moderation不影响价格。提交时预扣单张图像的封顶积分;任务完成后按实际 token 用量计费(不超过封顶),差额退还。任务失败全额退还。当前价格见定价页。
授权
使用 Authorization: Bearer VIDGO_API_KEY。
请求体
application/json