GPT Image 2.5 Flare 图像生成
curl --request POST \
--url https://ai.xbrod.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.5-flare",
"prompt": "一张简洁的绿色植物海报,干净背景",
"size": "1:1",
"resolution": "1k",
"quality": "low"
}
'import requests
url = "https://ai.xbrod.com/v1/images/generations"
payload = {
"model": "gpt-image-2.5-flare",
"prompt": "一张简洁的绿色植物海报,干净背景",
"size": "1:1",
"resolution": "1k",
"quality": "low"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-image-2.5-flare',
prompt: '一张简洁的绿色植物海报,干净背景',
size: '1:1',
resolution: '1k',
quality: 'low'
})
};
fetch('https://ai.xbrod.com/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created": 1,
"data": [
{
"url": "https://example.com/result.png"
}
]
}GPT Image 2.5
GPT Image 2.5 Flare 图像生成
gpt-image-2.5-flare 的生成请求与响应。
POST
/
v1
/
images
/
generations
GPT Image 2.5 Flare 图像生成
curl --request POST \
--url https://ai.xbrod.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.5-flare",
"prompt": "一张简洁的绿色植物海报,干净背景",
"size": "1:1",
"resolution": "1k",
"quality": "low"
}
'import requests
url = "https://ai.xbrod.com/v1/images/generations"
payload = {
"model": "gpt-image-2.5-flare",
"prompt": "一张简洁的绿色植物海报,干净背景",
"size": "1:1",
"resolution": "1k",
"quality": "low"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-image-2.5-flare',
prompt: '一张简洁的绿色植物海报,干净背景',
size: '1:1',
resolution: '1k',
quality: 'low'
})
};
fetch('https://ai.xbrod.com/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"created": 1,
"data": [
{
"url": "https://example.com/result.png"
}
]
}模型选择
| 模型 ID | 请求地址 |
|---|---|
gpt-image-2.5-flare | POST /v1/images/generations |
主要参数
下表列出常用参数;媒体引用的组合限制以接口校验结果为准。| 字段 | 取值或限制 | 说明 |
|---|---|---|
model | gpt-image-2.5-flare | 模型 ID |
prompt | string | 图片生成或编辑的文字描述;必填 |
size | string;默认 auto | 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);图生图建议省略 |
resolution | 1k、2k、4k;默认 1k | 分辨率档位;精确像素尺寸会覆盖此档位 |
quality | low、medium、high、xhigh、max、auto;默认 low | 图像质量;在本网关中 auto 会按 low 处理 |
n | 1–4;默认 1 | 生成张数;必须是数字 |
output_format | png、jpeg、webp;默认 png | 图像文件格式 |
output_compression | 0–100 | JPEG 或 WebP 压缩强度 |
background | transparent、opaque、auto | 透明背景仅适用于 PNG 或 WebP |
moderation | auto、low;默认 low | 内容审核强度 |
image_urls | 最多 16 项 | 图片编辑参考图;最多 16 张,须为公开可访问的 HTTP(S) 地址 |
mask_url | string | 局部编辑蒙版;需与第一张参考图同尺寸、带 Alpha 通道的 PNG,可使用公开 URL 或 Data URI |
response_format | url | 本网关仅支持 url 响应格式 |
尺寸对照
size 为比例时,下表给出不同 resolution 对应的输出像素:
| size | 1k | 2k | 4k |
|---|---|---|---|
1:1 | 1024x1024 | 2048x2048 | 2880x2880 |
3:2 | 1536x1024 | 2048x1360 | 3520x2336 |
2:3 | 1024x1536 | 1360x2048 | 2336x3520 |
4:3 | 1024x768 | 2048x1536 | 3312x2480 |
3:4 | 768x1024 | 1536x2048 | 2480x3312 |
5:4 | 1280x1024 | 2560x2048 | 3216x2576 |
4:5 | 1024x1280 | 2048x2560 | 2576x3216 |
16:9 | 1536x864 | 2048x1152 | 3840x2160 |
9:16 | 864x1536 | 1152x2048 | 2160x3840 |
2:1 | 2048x1024 | 2688x1344 | 3840x1920 |
1:2 | 1024x2048 | 1344x2688 | 1920x3840 |
21:9 | 2016x864 | 2688x1152 | 3840x1648 |
9:21 | 864x2016 | 1152x2688 | 1648x3840 |
3:1 | 1536x512 | 3072x1024 | 3840x1280 |
1:3 | 512x1536 | 1024x3072 | 1280x3840 |
1600x1200:宽高均为 16 的倍数、单边不超过 3840、长短边比不超过 3:1、总像素介于 655360 与 8294400 之间。此时 resolution 不决定输出尺寸。
返回说明
成功时返回data[].url。如返回 504 与 task_id,请先查询原任务,不要直接重复提交。授权
本项目签发的 API 密钥,不是上游密钥
请求体
application/json
模型 ID
可用选项:
gpt-image-2.5-flare 图片生成或编辑的文字描述;必填
Minimum string length:
1auto、比例(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);图生图建议省略
分辨率档位;精确像素尺寸会覆盖此档位
可用选项:
1k, 2k, 4k 图像质量;在本网关中 auto 会按 low 处理
可用选项:
low, medium, high, xhigh, max, auto 生成张数;必须是数字
必填范围:
1 <= x <= 4图像文件格式
可用选项:
png, jpeg, webp JPEG 或 WebP 压缩强度
必填范围:
0 <= x <= 100透明背景仅适用于 PNG 或 WebP
可用选项:
transparent, opaque, auto 内容审核强度
可用选项:
auto, low 图片编辑参考图;最多 16 张,须为公开可访问的 HTTP(S) 地址
Maximum array length:
16局部编辑蒙版;需与第一张参考图同尺寸、带 Alpha 通道的 PNG,可使用公开 URL 或 Data URI
本网关仅支持 url 响应格式
可用选项:
url