{
  "openapi": "3.1.0",
  "info": {
    "title": "Seedream - 多图融合",
    "version": "1.0.0",
    "description": "Seedream 多图融合接口 - 基于多张参考图片融合生成新图片。"
  },
  "servers": [{ "url": "https://api.ttapi.io" }],
  "components": {
    "securitySchemes": {
      "CustomApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "TT-API-KEY",
        "description": "请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a> 获取 API 密钥。"
      }
    },
    "schemas": {
      "MultiImageRequest": {
        "type": "object",
        "description": "多图融合请求参数",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型名称。",
            "enum": ["doubao-seedream-5-0-pro-260628", "doubao-seedream-5-0-flash-260915"],
            "example": "doubao-seedream-5-0-pro-260628"
          },
          "prompt": {
            "type": "string",
            "description": "文本提示词，用于描述融合生成意图。"
          },
          "image": {
            "type": "array",
            "description": "参考图片 URL 数组，支持 2-10 张。",
            "items": { "type": "string" },
            "minItems": 2,
            "maxItems": 10
          },
          "size": {
            "type": "string",
            "description": "图像尺寸。5.0 pro/flash 可选：1K、1.5K、2K（默认 2K），或指定像素值。",
            "default": "2K",
            "enum": ["1K", "1.5K", "2K"]
          },
          "output_format": {
            "type": "string",
            "description": "输出图像格式。",
            "default": "jpeg",
            "enum": ["png", "jpeg"]
          },
          "response_format": {
            "type": "string",
            "description": "返回格式。",
            "default": "url",
            "enum": ["url", "b64_json"]
          },
          "watermark": {
            "type": "boolean",
            "description": "是否添加水印。true=右下角显示「AI 生成」，false=不添加。",
            "default": true,
            "enum": [true, false],
            "example": false
          },
          "optimize_prompt_options": {
            "type": "object",
            "description": "提示词优化配置",
            "properties": {
              "mode": { "type": "string", "enum": ["standard", "fast"], "default": "standard", "description": "优化模式。standard=标准模式（质量更高，耗时较长），fast=快速模式（耗时更短，效果略低，5.0 flash 不支持）" }
            }
          },
          "execution_expires_after": {
            "type": "integer",
            "default": 172800,
            "description": "任务超时阈值（秒）。范围 [3600, 259200]（1~72 小时），默认 172800（48 小时）"
          },
          "priority": {
            "type": "integer",
            "default": 0,
            "description": "执行优先级。范围 [0, 9]，数值越大优先级越高，默认 0（FIFO）"
          },
          "safety_identifier": {
            "type": "string",
            "description": "终端用户唯一标识符，不超过 64 字符。建议传入哈希处理后的字符串"
          }
        },
        "required": ["model", "prompt", "image"]
      }
    }
  },
  "paths": {
    "/sd/api/v3/images/generations/tasks": {
      "post": {
        "description": "多图融合 - 提交异步图片生成任务，返回 id",
        "security": [{ "CustomApiKey": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MultiImageRequest" },
              "example": {
                "model": "doubao-seedream-5-0-pro-260628",
                "prompt": "将两张图片中的人物融合在同一场景中",
                "image": ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg"],
                "size": "2K",
                "watermark": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string", "example": "PENDING_QUEUE", "description": "任务状态" },
                    "message": { "type": "string", "example": "success" },
                    "id": { "type": "string", "description": "任务 ID", "example": "30d9b07d-7349-4cbc-8e11-9ba302c6d165" }
                  },
                  "required": ["status", "message", "id"]
                }
              }
            }
          }
        }
      }
    }
  }
}
