{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hop-base.com/spec/models/gpt-image-2.5-flare.json",
  "title": "POST /v1/images/generations · gpt-image-2.5-flare",
  "description": "GPT Image 2.5 Flare 的请求体契约，由插件校验代码导出的 spec 生成。未列出的字段网关会忽略或原样转发。",
  "type": "object",
  "required": [
    "model",
    "prompt"
  ],
  "properties": {
    "model": {
      "const": "gpt-image-2.5-flare"
    },
    "prompt": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "maxLength": 32000,
      "description": "去除首尾空白后不能为空，否则 400「prompt must not be empty」"
    },
    "size": {
      "description": "auto 或 宽x高：边长为 16 的倍数、单边 ≤ 3840、长短边比 ≤ 3:1、总像素 655360–8294400",
      "anyOf": [
        {
          "const": "auto"
        },
        {
          "type": "string",
          "pattern": "^[1-9][0-9]*x[1-9][0-9]*$"
        }
      ],
      "x-hopbase-constraints": {
        "side_multiple": 16,
        "max_side": 3840,
        "max_aspect_ratio": 3,
        "pixels": {
          "min": 655360,
          "max": 8294400
        }
      }
    },
    "quality": {
      "enum": [
        "auto",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "description": "网关不校验、原样转发；档位越高输出 token 越多"
    },
    "n": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "default": 1
    },
    "background": {
      "enum": [
        "auto",
        "opaque",
        "transparent"
      ]
    },
    "output_format": {
      "enum": [
        "png",
        "jpeg",
        "webp"
      ]
    },
    "output_compression": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "default": 100
    },
    "moderation": {
      "enum": [
        "auto",
        "low"
      ]
    },
    "user": {
      "type": "string"
    },
    "response_format": {
      "type": "string",
      "description": "传什么都以 b64_json 返回，请省略"
    },
    "stream": {
      "type": "boolean",
      "default": false,
      "description": "true 返回 HopBase Images SSE，SDK 请保持 false"
    },
    "input_fidelity": {
      "enum": [
        "low",
        "high"
      ]
    }
  },
  "allOf": [
    {
      "$comment": "transparent 需要 png 或 webp",
      "if": {
        "properties": {
          "background": {
            "const": "transparent"
          }
        },
        "required": [
          "background"
        ]
      },
      "then": {
        "properties": {
          "output_format": {
            "enum": [
              "png",
              "webp"
            ]
          }
        }
      }
    },
    {
      "$comment": "output_compression 只对 jpeg / webp 生效",
      "if": {
        "required": [
          "output_compression"
        ]
      },
      "then": {
        "required": [
          "output_format"
        ],
        "properties": {
          "output_format": {
            "enum": [
              "jpeg",
              "webp"
            ]
          }
        }
      }
    }
  ],
  "additionalProperties": true,
  "$defs": {
    "edits": {
      "$comment": "POST /v1/images/edits 的 JSON 请求体（也可用 multipart，字段同名、参考图为 image[]）",
      "type": "object",
      "required": [
        "model",
        "prompt",
        "image"
      ],
      "properties": {
        "model": {
          "const": "gpt-image-2.5-flare"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S",
          "maxLength": 32000,
          "description": "去除首尾空白后不能为空，否则 400「prompt must not be empty」"
        },
        "size": {
          "description": "auto 或 宽x高：边长为 16 的倍数、单边 ≤ 3840、长短边比 ≤ 3:1、总像素 655360–8294400",
          "anyOf": [
            {
              "const": "auto"
            },
            {
              "type": "string",
              "pattern": "^[1-9][0-9]*x[1-9][0-9]*$"
            }
          ],
          "x-hopbase-constraints": {
            "side_multiple": 16,
            "max_side": 3840,
            "max_aspect_ratio": 3,
            "pixels": {
              "min": 655360,
              "max": 8294400
            }
          }
        },
        "quality": {
          "enum": [
            "auto",
            "low",
            "medium",
            "high",
            "xhigh",
            "max"
          ],
          "description": "网关不校验、原样转发；档位越高输出 token 越多"
        },
        "n": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "default": 1
        },
        "background": {
          "enum": [
            "auto",
            "opaque",
            "transparent"
          ]
        },
        "output_format": {
          "enum": [
            "png",
            "jpeg",
            "webp"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "default": 100
        },
        "moderation": {
          "enum": [
            "auto",
            "low"
          ]
        },
        "user": {
          "type": "string"
        },
        "response_format": {
          "type": "string",
          "description": "传什么都以 b64_json 返回，请省略"
        },
        "stream": {
          "type": "boolean",
          "default": false,
          "description": "true 返回 HopBase Images SSE，SDK 请保持 false"
        },
        "input_fidelity": {
          "enum": [
            "low",
            "high"
          ]
        },
        "image": {
          "description": "1–16 张（官方上限）；远程 URL 单张 ≤ 26214400 字节且须返回 image/*。只读 image，不读 images",
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(https?://|data:image/)",
              "description": "HTTP(S) URL 或图片 Data URL"
            },
            {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^(https?://|data:image/)",
                "description": "HTTP(S) URL 或图片 Data URL"
              },
              "minItems": 1,
              "maxItems": 16
            }
          ]
        },
        "mask": {
          "type": "string",
          "pattern": "^(https?://|data:image/png)",
          "description": "带 alpha 通道的 PNG；透明区域表示要编辑"
        }
      },
      "allOf": [
        {
          "$comment": "transparent 需要 png 或 webp",
          "if": {
            "properties": {
              "background": {
                "const": "transparent"
              }
            },
            "required": [
              "background"
            ]
          },
          "then": {
            "properties": {
              "output_format": {
                "enum": [
                  "png",
                  "webp"
                ]
              }
            }
          }
        },
        {
          "$comment": "output_compression 只对 jpeg / webp 生效",
          "if": {
            "required": [
              "output_compression"
            ]
          },
          "then": {
            "required": [
              "output_format"
            ],
            "properties": {
              "output_format": {
                "enum": [
                  "jpeg",
                  "webp"
                ]
              }
            }
          }
        }
      ],
      "additionalProperties": true
    }
  },
  "x-hopbase": {
    "model_name": "GPT Image 2.5 Flare",
    "family": "gpt-image",
    "endpoints": [
      "POST /v1/images/generations",
      "POST /v1/images/edits"
    ],
    "response_field": "data[].b64_json",
    "groups": [
      {
        "id": 15,
        "name": "GPT Image 全系",
        "name_en": "GPT Image (all models)"
      }
    ],
    "pricing": {
      "currency": "USD",
      "label": "官方价，实际按分组倍率计费",
      "source": "https://api.hop-base.com/api/v1/models/pricing",
      "snapshot": "2026-09-25",
      "unit": "token",
      "input_per_million": 5,
      "output_per_million": 30,
      "cached_input_per_million": 1.25
    },
    "rejected": [],
    "references": {
      "max": 16,
      "enforced_by": "official",
      "max_bytes": 26214400
    },
    "quality_note": "xhigh / max 仅 GPT Image 2.5",
    "verified": {
      "date": null,
      "feed": "https://hop-base.com/docs-verified.json",
      "route": "media/images"
    },
    "docs": "https://hop-base.com/zh-cn/docs/media/images#gpt-image-请求参数",
    "source": [
      "toc-landing/docs-app/spec/openai.json#images.gptImage (airgate-openai)",
      "toc-landing/docs-app/spec/official.json#gptImage (https://developers.openai.com/api/reference/resources/images/methods/generate)"
    ],
    "generated_by": "toc-landing/docs-app/scripts/build-model-schemas.mjs"
  }
}
