> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbrod.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2.5 Sunburst 图像生成

> gpt-image-2.5-sunburst 的生成请求与响应。

## 模型选择

| 模型 ID | 请求地址 |
| - | - |
| `gpt-image-2.5-sunburst` | `POST /v1/images/generations` |

## 主要参数

下表列出常用参数；媒体引用的组合限制以接口校验结果为准。

| 字段 | 取值或限制 | 说明 |
| - | - | - |
| `model` | `gpt-image-2.5-sunburst` | 模型 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`，请先查询原任务，不要直接重复提交。


## OpenAPI

````yaml generated/gpt-image-2.5-sunburst.json POST /v1/images/generations
openapi: 3.0.3
info:
  title: new-api GPT Image 2.5 Sunburst API
  version: 0.1.0
servers:
  - url: https://ai.xbrod.com
    description: 本项目线上 API 网关
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: GPT Image 2.5 Sunburst 图像生成
      description: 使用当前模型发起生成请求。
      operationId: generate_gpt_image_2_5_sunburst
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - gpt-image-2.5-sunburst
                  description: 模型 ID
                prompt:
                  type: string
                  minLength: 1
                  description: 图片生成或编辑的文字描述；必填
                size:
                  type: string
                  default: auto
                  description: >-
                    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:
                  type: string
                  enum:
                    - 1k
                    - 2k
                    - 4k
                  default: 1k
                  description: 分辨率档位；精确像素尺寸会覆盖此档位
                quality:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - xhigh
                    - max
                    - auto
                  default: low
                  description: 图像质量；在本网关中 auto 会按 low 处理
                'n':
                  type: integer
                  minimum: 1
                  maximum: 4
                  default: 1
                  description: 生成张数；必须是数字
                output_format:
                  type: string
                  enum:
                    - png
                    - jpeg
                    - webp
                  default: png
                  description: 图像文件格式
                output_compression:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: JPEG 或 WebP 压缩强度
                background:
                  type: string
                  enum:
                    - transparent
                    - opaque
                    - auto
                  description: 透明背景仅适用于 PNG 或 WebP
                moderation:
                  type: string
                  enum:
                    - auto
                    - low
                  default: low
                  description: 内容审核强度
                image_urls:
                  type: array
                  maxItems: 16
                  items:
                    type: string
                  description: 图片编辑参考图；最多 16 张，须为公开可访问的 HTTP(S) 地址
                mask_url:
                  type: string
                  description: 局部编辑蒙版；需与第一张参考图同尺寸、带 Alpha 通道的 PNG，可使用公开 URL 或 Data URI
                response_format:
                  type: string
                  enum:
                    - url
                  description: 本网关仅支持 url 响应格式
              required:
                - model
                - prompt
            example:
              model: gpt-image-2.5-sunburst
              prompt: 一张简洁的绿色植物海报，干净背景
              size: '1:1'
              resolution: 1k
              quality: low
      responses:
        '200':
          description: 生成成功，返回图片 URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          format: uri
              example:
                created: 1
                data:
                  - url: https://example.com/result.png
        '504':
          description: 图片等待超时；根据响应中的 task_id 查询原任务，不要重复提交。
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 本项目签发的 API 密钥，不是上游密钥

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.