curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "A premium product photo of a silver espresso machine in a bright studio",
"size": "16:9",
"resolution": "2K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1786751400-abcd1234",
"status": "not_started",
"created_time": "2026-09-09T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}OpenAI
GPT Image 2.5 Flare
GPT Image 2.5 Flare API 根据提示词生成一张图像,或编辑最多 16 张参考图。它是 GPT Image 2.5 中速度更快的选项,支持蒙版、透明背景以及 1K 到 4K 输出。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "A premium product photo of a silver espresso machine in a bright studio",
"size": "16:9",
"resolution": "2K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1786751400-abcd1234",
"status": "not_started",
"created_time": "2026-09-09T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
gpt-image-2.5-flare 根据提示词生成一张图像,或编辑最多 16 张参考图。传入非空的 image_urls 数组会自动进入编辑模式;省略该字段或传入空数组则为文生图。
模型
- gpt-image-2.5-flare — GPT Image 2.5 Flare
必填参数
prompt必填,最多支持 32,000 个字符。
可选参数
quality:low、medium、high(默认)、xhigh或max。background:auto(默认)、transparent或opaque。output_format:png(默认)、jpeg或webp。透明背景需要 PNG 或 WebP。mask_url:可选的 HTTP(S) 蒙版图像 URL,用于标识要编辑的区域;需要非空的image_urls。- 参考图必须使用 HTTP(S) URL。每次请求输出一张图像。
尺寸
size默认为1:1。支持的比例:1:1、2:3、3:2、4:3、3:4、4:5、5:4、16:9、9:16、21:9。resolution支持1K(默认)、2K和4K。省略 size 时,使用所选档位的正方形。- 显式指定
size=auto仅可与1K搭配,由模型决定图像尺寸。2K或4K请选择比例或自定义尺寸。 - 使用宽高比时,实际像素尺寸可能因模型和每次生成而不同。请以返回图像为准确认精确尺寸;需要精确像素时请使用自定义尺寸。
- 自定义
WIDTHxHEIGHT尺寸需要2K或4K。两个维度都必须能被 16 整除,最长边不得超过 3840,宽高比不得超过 3:1,总像素数必须在 655,360 到 8,294,400 之间。边长为 3840 像素时需要4K。
示例
文生图
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "A premium product photo of a silver espresso machine in a bright studio",
"size": "16:9",
"resolution": "2K",
"quality": "medium"
}
}
图像编辑
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "Keep the product and replace the background with a warm modern studio",
"image_urls": [
"https://example.com/product.png"
],
"size": "1:1",
"quality": "high"
}
}
蒙版编辑
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "Replace only the masked area with a small vase of flowers",
"image_urls": [
"https://example.com/room.png"
],
"mask_url": "https://example.com/mask.png",
"size": "auto"
}
}
透明背景
{
"model": "gpt-image-2.5-flare",
"input": {
"prompt": "A clean cutout of a small silver robot",
"background": "transparent",
"output_format": "webp",
"size": "1:1",
"resolution": "4K",
"quality": "xhigh"
}
}
授权
所有 API 接口都需要 Bearer Token 认证。
创建 API Key:登录 PoYo,进入 仪表盘 → API 密钥(poyo.ai/zh/dashboard/api-key),点击创建 Key。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
响应
任务提交成功
Show child attributes
Show child attributes