{
  "openapi": "3.1.0",
  "info": {
    "title": "Seedream - Multi-Image Fusion",
    "version": "1.0.0",
    "description": "Seedream Multi-Image Fusion API - Fuse and generate new image based on multiple reference images."
  },
  "servers": [
    {
      "url": "https://api.ttapi.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "CustomApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "TT-API-KEY",
        "description": "Get your API key from the <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>."
      }
    },
    "schemas": {
      "MultiImageRequest": {
        "type": "object",
        "description": "Multi-Image Fusion request parameters",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model name.",
            "enum": [
              "doubao-seedream-5-0-pro-260628",
              "doubao-seedream-5-0-flash-260915"
            ],
            "example": "doubao-seedream-5-0-pro-260628"
          },
          "prompt": {
            "type": "string",
            "description": "Text prompt describing the fusion intent."
          },
          "image": {
            "type": "array",
            "description": "Array of reference image URLs, supports 2-10 images.",
            "items": {
              "type": "string"
            },
            "minItems": 2,
            "maxItems": 10
          },
          "size": {
            "type": "string",
            "description": "Image size. 5.0 pro/flash options: 1K, 1.5K, 2K (default 2K), or specify pixel values.",
            "default": "2K",
            "enum": [
              "1K",
              "1.5K",
              "2K"
            ]
          },
          "output_format": {
            "type": "string",
            "description": "Output image format.",
            "default": "jpeg",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "response_format": {
            "type": "string",
            "description": "Return format.",
            "default": "url",
            "enum": [
              "url",
              "b64_json"
            ]
          },
          "watermark": {
            "type": "boolean",
            "description": "Whether to add watermark. true=Display \"AI Generated\" in bottom-right, false=Do not add.",
            "default": true,
            "enum": [
              true,
              false
            ],
            "example": false
          },
          "optimize_prompt_options": {
            "type": "object",
            "description": "Prompt optimization config",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "standard",
                  "fast"
                ],
                "default": "standard",
                "description": "Optimization mode. standard=standard mode (higher quality, longer time), fast=fast mode (shorter time, slightly lower quality, 5.0 flash not supported)"
              }
            }
          },
          "execution_expires_after": {
            "type": "integer",
            "default": 172800,
            "description": "Task timeout threshold (seconds). Range [3600, 259200] (1-72 hours), default 172800 (48 hours)"
          },
          "priority": {
            "type": "integer",
            "default": 0,
            "description": "Execution priority. Range [0, 9], higher value = higher priority, default 0 (FIFO)"
          },
          "safety_identifier": {
            "type": "string",
            "description": "End user unique identifier, max 64 characters. Recommend passing a hashed string"
          }
        },
        "required": [
          "model",
          "prompt",
          "image"
        ]
      }
    }
  },
  "paths": {
    "/sd/api/v3/images/generations/tasks": {
      "post": {
        "description": "Multi-Image Fusion - Submit async image generation task, return id",
        "security": [
          {
            "CustomApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultiImageRequest"
              },
              "example": {
                "model": "doubao-seedream-5-0-pro-260628",
                "prompt": "Fuse characters from two images into the same scene",
                "image": [
                  "https://example.com/ref1.jpg",
                  "https://example.com/ref2.jpg"
                ],
                "size": "2K",
                "watermark": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "PENDING_QUEUE",
                      "description": "Task status"
                    },
                    "message": {
                      "type": "string",
                      "example": "success"
                    },
                    "id": {
                      "type": "string",
                      "description": "Task ID",
                      "example": "30d9b07d-7349-4cbc-8e11-9ba302c6d165"
                    }
                  },
                  "required": [
                    "status",
                    "message",
                    "id"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
