ChatGPT Images 2.6 Flare 和 Sunburst 模型的完整 API 参考文档。
模型版本
此 API 支持四种模型版本:
快速对比
Flare 和 Sunburst 具有以下相同的请求选项。
支持的宽高比
16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
ChatGPT Images 2.6 Flare (文生图)
端点
POST /api/v1/image/task
身份验证
Authorization: Bearer YOUR_API_KEY
请求参数
必填
width:height 比例必须与上方列出的某个支持的宽高比一致。
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.6-flare',
prompt: 'A looping animation of steam rising from a ceramic mug on a pale stone table, warm studio lighting',
width: 1,
height: 1,
resolution: '1k',
quality: 'medium',
output_format: 'gif',
frame_count: 9,
frame_duration_ms: 200
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.6 Flare Edit (图像编辑)
端点
POST /api/v1/image/task
请求参数
必填
width:height 比例必须与上方列出的某个支持的宽高比一致。
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.6-flare-edit',
prompt: 'Replace the background with a warm studio setting while keeping the product unchanged',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 1,
height: 1,
resolution: '1k',
quality: 'medium',
output_format: 'png'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.6 Sunburst (文生图)
端点
POST /api/v1/image/task
请求参数
必填
width:height 比例必须与上方列出的某个支持的宽高比一致。
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.6-sunburst',
prompt: 'A looping animation of steam rising from a ceramic mug on a pale stone table, warm studio lighting',
width: 1,
height: 1,
resolution: '1k',
quality: 'medium',
output_format: 'gif',
frame_count: 9,
frame_duration_ms: 200
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.6 Sunburst Edit (图像编辑)
端点
POST /api/v1/image/task
请求参数
必填
width:height 比例必须与上方列出的某个支持的宽高比一致。
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.6-sunburst-edit',
prompt: 'Replace the background with a warm studio setting while keeping the product unchanged',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 1,
height: 1,
resolution: '1k',
quality: 'medium',
output_format: 'png'
})
});
const { data } = await response.json();
const taskId = data.task_id;
响应格式
初始响应
ChatGPT Images 2.6 的四种版本均返回用于轮询的 task_id:
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "submitted",
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}"
},
"message": "success"
}
轮询响应
轮询 GET /api/v1/image/{task_id} 以检查状态:
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}",
"task_result": {
"credit": 0.0997,
"images": [
{
"url": "https://example.com/generated-image.jpeg"
}
]
}
},
"message": "success"
}
状态值
submitted: 任务已接受
processing: 正在生成或编辑图像
succeed: 任务成功完成
failed: 任务失败
处理时间
处理时间因模型、输出设置、提示词复杂程度和参考图像数量而异。请持续轮询,直到任务状态为 succeed 或 failed;已提交或处理中的任务可能尚未包含图像结果。
最佳实践
- 明确描述构图:提示词清晰描述主体、取景、光线和预期风格时,ChatGPT Images 2.6 的效果最佳。
- 根据发布场景选择宽高比:为社交帖子、横幅、产品页面或编辑排版预先设置比例。
- 使用清晰的原图进行编辑:清晰、光线良好的输入图像有助于保持主体身份特征,并提高局部编辑质量。
- 多图请求仅使用有效参考图:对于编辑请求,仅提供相关图像,避免视觉指引相互冲突。