跳转到内容
中文

GPT Image 2.5 Flare

POST Base URL: https://api.hiapi.ai /v1/tasks

图片、视频和音频模型通过 统一异步接口 POST /v1/tasks 调用,区别只在 input 字段(见下方 input 参数)。

模型概览

模型名称 gpt-image-2.5-flare
类型 文生图 / 图像编辑
输出 每次请求生成一张图片
价格 查看实时价格

GPT Image 2.5 Flare 使用同一个模型 ID 完成文生图和图像编辑,支持最多 16 张参考图、六档画质,以及比例或像素尺寸选择。

生产建议

图片输入与输出
  • 只使用提示词时省略 image_urls;需要编辑或参考时传入图片地址,不要传空数组。
  • 每次请求生成一张图片。生成后及时下载或转存结果,避免临时结果地址过期。
  • 透明背景需要 PNG 或 WebP 格式;也请在提示词中说明主体和背景要求。

适用场景

商品与场景图

描述主体、材质、构图与光线,从文字生成完整画面。

promptaspect_ratio
编辑与多图参考

通过参考图提供主体或风格,并说明需要改变和保留的元素。

promptimage_urls

请求参数

model string 必填

选择此模型。

示例 gpt-image-2.5-flare
input object 必填

图片生成或编辑参数。

prompt string 必填

描述需要生成的画面;编辑图片时,说明要修改和保留的内容。长度为 1–32000 个字符。

image_urls string[] 可选

用于编辑或视觉参考的图片 URL 数组,传入时包含 1–16 张图片。纯文生图请省略此字段;多图时按数组顺序说明每张图片的用途。

aspect_ratio enum 可选

选择输出画幅比例,或直接选择宽x高像素尺寸。auto 由模型选择适合内容的画幅;像素尺寸使用小写 x 分隔。

默认 1:1

比例预设

1:13:22:34:33:416:99:16auto

像素尺寸

1024x10241536x10241024x15361536x11521152x15362048x20482048x11521152x20483840x21602160x3840
quality enum 可选

选择图片质量档位。low、medium、high、xhigh、max 提供不同的细节程度;auto 由模型决定。

默认 medium 可选值: lowmediumhighxhighmaxauto
background enum 可选

背景方式:auto 自动选择,transparent 请求透明背景,opaque 请求不透明背景。

默认 auto 可选值: autotransparentopaque
output_format enum 可选

下载图片的文件格式。需要透明背景时选择 PNG 或 WebP;JPEG 不支持透明度。

默认 webp 可选值: pngjpegwebp
callback object 可选

设置任务完成后的通知。

url string 必填

接收任务终态通知的 HTTPS 地址。

示例 https://your-domain.com/hiapi/callback
when enum 可选

任务成功或失败时触发通知。

默认 final 可选值: final

用例示例

地中海泳池边的创意现场

描绘泳池边的设计师、鲜明的印刷样张与地中海午间光线,不传参考图。

请求体
{
  "model": "gpt-image-2.5-flare",
  "input": {
    "prompt": "Create a premium square editorial lifestyle photograph set at a sunlit 1960s Mediterranean poolside creative studio. One stylish young adult designer in an ivory linen shirt and cobalt shorts is arranging bold ultramarine, tangerine, and cream print samples on a white travertine table. Behind them: a cobalt-blue swimming pool, one sculptural orange parasol, a chrome tubular chair, a compact analog camera, and a few geometric paper mockups lifting slightly in a warm sea breeze. Crisp midday sunlight, elegant hard-edged shadows, natural skin, tactile paper and linen, subtle film grain, refined Italian resort color palette, sophisticated magazine art direction, balanced negative space, photorealistic, no cyberpunk, no neon, no logos, no watermark, no readable text.",
    "aspect_ratio": "1:1",
    "quality": "high",
    "background": "opaque",
    "output_format": "webp"
  }
}
泳池遮阳伞配色编辑

将示例地址替换为自己的泳池场景图片,仅调整遮阳伞颜色,并保留人物、印刷样张与光线。

请求体
{
  "model": "gpt-image-2.5-flare",
  "input": {
    "prompt": "Change only the orange parasol fabric to warm cream in this Mediterranean poolside creative studio. Preserve the designer, print samples, swimming pool, chair, camera, paper mockups, table, sunlight, shadows, and framing. Do not add text, logos, or other objects.",
    "image_urls": [
      "https://example.com/reference.webp"
    ],
    "aspect_ratio": "1:1",
    "quality": "high",
    "background": "opaque",
    "output_format": "webp"
  }
}

获取结果

  1. 提交后获得 taskId,图片将在后台生成。
  2. 轮询 GET /v1/tasks/:id,或等待 callback.url 接收终态通知。
  3. status=success 时,从 data.output[].url 保存图片,并留意 expireAt。
  4. status=fail 时查看 data.error,修正请求后再决定是否重新提交。

常见问题

文生图和图生图需要不同的模型 ID 吗?

不需要。使用本页的同一模型 ID;省略 image_urls 为文生图,传入图片则用于编辑或视觉参考。

多张参考图应该如何组织?

按 image_urls 的顺序说明每张图片承担的角色,例如第一张作为商品主体,第二张作为场景参考,同时写出应保留的元素。

怎样选择尺寸?

常用画幅可选择比例值;需要准确像素尺寸时,从 aspect_ratio 参数列出的宽x高枚举中选择。不要传入枚举之外的自定义尺寸。

是否需要分别创建 API Key?

使用 HiAPI 控制台创建的 API Key,并以 Bearer Token 发送即可。密钥应保存在服务端。

下一步