{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 文字生成圖片",
    "description": "# 概述\n透過我們創新的文字生成圖片，發現 AI 的力量！立即將您的想法轉化為令人驚豔的視覺，實驗提示詞，探索卡通、油畫或素描等獨特風格，讓您的創意發光發熱。無論您是藝術家、設計師，或富有創意的人，我們的工具提供無限可能，讓您的願景成真。加入圖片作為參考，激發新的藝術方向，同時讓 AI 將它們精煉成完全原創的傑作。\n\n想要更多靈感？請參考 https://yce.makeupar.com/ai-art-generator。\n\n應用案例：\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v3_video_02f161f909.jpg \"AI 文字生成圖片\")\n\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v4_poster_092d2fbb9f.jpg \"AI 文字生成圖片\")\n\n輸出範例：\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_2_e325681588.jpg \"AI 文字生成圖片\")\n\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_5_8b4fa13c6a.jpg \"AI 文字生成圖片\")\n\n## 檔案規格與錯誤\n\n* 支援的格式與尺寸\n\n|AI 功能|支援的尺寸|支援的檔案大小|支援的格式|\n| ---- | ---- | ---- | ---- |\n| V1.0 文字轉影像 | 輸出：長邊 1024 像素。 | 提示詞不得超過 500 字元 | N/A |\n| V2.0 文字轉影像 | 輸出：預設解析度為 1664 × 928，支援的解析度為 1664 × 928（16:9）、1472 × 1104（4:3）、1328 × 1328（1:1）、1104 × 1472（3:4）與 928 × 1664（9:16）。 | 提示詞不得超過 800 字元 | N/A |\n| V2.0 影像轉影像 | 輸入：寬與高都必須落在 384 到 3072 像素的範圍內。 <br>輸出：可自訂的寬與高範圍為 512 到 2,048 像素，預設配置維持約 1,024 × 1,024 的總像素數，長寬比依輸入圖片而定。 | <10MB<br> 提示詞不得超過 800 字元 | JPG、JPEG、PNG、BMP、TIFF、WEBP 與 GIF。 <br>動畫 GIF 僅處理第一影格。 |\n\n* 錯誤代碼\n\n| 錯誤代碼 | 說明 |\n| ---------- | ----------- |\n| exceed_max_filesize | 上傳的檔案大小超過允許的上限。 |\n| invalid_parameter | 有一個或多個參數缺失或無效 |\n| error_download_image | 下載來源圖片失敗。 |\n| error_decode_image | 解碼或解析來源圖片失敗。 |\n| error_nsfw_content_detected | 在來源圖片中偵測到不適合工作場合（NSFW）的內容。 |\n| error_unsupport_ratio | 輸入圖片的長寬比不受支援。 |\n| unknown_internal_error | 發生未指明的內部錯誤。 |\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 文字生成圖片 V1.0 | 2 |\n| AI 文字生成圖片 V2.0 | 1 |\n\n---\n",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "tags": [
    {
      "name": "V2.0",
      "description": "使用 AI 文字生成圖片 V2.0 API，您可以從文字提示或既有圖片，立即生成高品質影像，並提升視覺、細節與一致性。"
    },
    {
      "name": "V1.0",
      "description": "AI 文字生成圖片 API 可讓您使用預先定義的範本，從文字提示生成影像。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/text-to-image": {
      "get": {
        "summary": "列出預先定義的範本。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "example": 20
            },
            "description": "這一頁要回傳的結果數量。有效值應介於 1 到 20 之間。預設為 20。"
          },
          {
            "name": "starting_token",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "73a3c9e69b89"
            },
            "description": "目前頁面的令牌。第一頁以 `null` 開始，並使用上一個回應中的 `next_token` 開始下一頁"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TemplateResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameters"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image": {
      "post": {
        "summary": "執行 AI 文字生成圖片任務。",
        "description": "AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook.md)。\n\n若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 `success` 或 `error`。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "prompt",
                      "template_id"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "description": "用於生成影像的提示",
                        "example": "A little cat"
                      },
                      "negative_prompt": {
                        "type": "string",
                        "description": "提示不想要的內容",
                        "example": "dog"
                      },
                      "template_id": {
                        "type": "string",
                        "description": "範本的 ID。請先列出預先定義的範本，然後使用某個範本的 id。",
                        "example": "good_template_001"
                      },
                      "steps": {
                        "type": "integer",
                        "description": "Steps 會影響影像品質與處理時間。 <br> 建議的 Steps 數量 <br> 10-15 Steps：最適合快速測試提示與做大幅調整。 <br> 15–20 Steps：社群公認的最佳區間。多數模型在此範圍達到理想的品質與時間比例。 <br> 20–30 Steps：最適合生成高度細節的主體，例如臉部、毛髮或建築元素。",
                        "example": 10
                      },
                      "cfg_scale": {
                        "type": "number",
                        "description": "CFG（Classifier-Free Guidance）尺度是一個數學設定，決定 AI 模型遵循您文字提示的嚴格程度。 <br> 低 CFG（1 – 4）：AI 有很高的創作自由度。它會寬鬆地解讀您的提示，可能產生抽象、繪畫感的結果，或完全偏離主題的影像。 <br> 中等 CFG（5 – 10）：理想的最佳區間。生成器緊隨您的文字，同時維持自然且高品質的視覺效果。 <br> 高 CFG（11+）：AI 會嚴格遵守提示中的每個字。細節會更鮮明、更照字面呈現，但尺度過高常導致過度飽和的色彩、雜訊與不自然的偽影。",
                        "example": 4
                      },
                      "seed": {
                        "type": "array",
                        "description": "每張影像都以唯一的 seed 生成。使用相同的 seed 可重現同一張影像。僅接受 1 個 seed。",
                        "items": {
                          "type": "integer",
                          "example": 3843718472198472
                        }
                      },
                      "width_ratio": {
                        "type": "integer",
                        "description": "影像比例的寬度。",
                        "example": 3
                      },
                      "height_ratio": {
                        "type": "integer",
                        "description": "影像比例的高度。",
                        "example": 4
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任務執行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任務執行失敗",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/{task_id}": {
      "get": {
        "summary": "查詢 AI 文字生成圖片任務的狀態。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查詢的任務 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "成功查詢任務狀態",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/youcam": {
      "post": {
        "summary": "執行用於文字轉影像的 AI 文字生成圖片任務 V2。",
        "description": "AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook.md)。\n\n若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 `success` 或 `error`。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "模型名稱。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "描述您想要的影像內容、風格與構圖的正面提示。 <br>支援中文與英文。最大長度為 800 個字元。每個中文字、字母、數字或符號都計為一個字元。",
                        "example": "A sitting orange cat with a joyful expression, lively and adorable, highly realistic."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "描述您不想要出現在影像中的內容的負面提示。 <br>支援中文與英文。最大長度為 500 個字元。",
                        "example": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text."
                      },
                      "size": {
                        "type": "string",
                        "description": "輸出影像解析度，格式為 width\\*height。 <br> 支援的解析度及其長寬比： <br>- 1664\\*928（預設）：16:9 <br>- 1472\\*1104：4:3 <br>- 1328\\*1328：1:1 <br>- 1104\\*1472：3:4 <br>- 928\\*1664：9:16",
                        "enum": [
                          "1664*928",
                          "1472*1104",
                          "1328*1328",
                          "1104*1472",
                          "928*1664"
                        ],
                        "example": "1664*928",
                        "default": "1664*928"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "啟用智慧提示改寫。模型會最佳化正面提示。不會影響負面提示。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任務執行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任務執行失敗",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/youcam/{task_id}": {
      "get": {
        "summary": "查詢用於文字轉影像的 AI 文字生成圖片任務 V2 的狀態。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查詢的任務 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "成功查詢任務狀態",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-image/youcam": {
      "post": {
        "summary": "執行用於影像轉影像的 AI 文字生成圖片任務 V2。",
        "description": "AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook.md)。\n\n若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 `success` 或 `error`。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "title": "以 src_file_urls 執行任務",
                        "type": "object",
                        "required": [
                          "src_file_urls"
                        ],
                        "properties": {
                          "src_file_urls": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "來自上傳檔案 API 的檔案網址。應提供 'src_file_urls' 或 'src_file_ids' 其中之一。",
                            "example": [
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "title": "以 3 個角度的來源檔案 ID 執行任務",
                        "type": "object",
                        "required": [
                          "src_file_ids"
                        ],
                        "properties": {
                          "src_file_ids": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "來自上傳檔案 API 的檔案 ID。應提供 'src_file_urls' 或 'src_file_ids' 其中之一。",
                            "example": [
                              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=",
                              "pkVzplMv8Y1QPgHbqtKfyJmg+xJDUbTP16YijZ3qARNf",
                              "B5LNohvvO+7d/78Ymuhp6vMiSooN/5DX9oVuupzkKctf"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "模型名稱。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "描述您希望生成影像中具備的元素與視覺特徵的影像編輯指示（正面提示）。 <br>此參數支援中文與英文，最大長度為 800 個字元。每個中文字或英文字母都計為一個字元。",
                        "example": "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged, and ensure the action is natural and smooth."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "負面提示，描述您不希望出現在生成影像中的內容。 <br>此參數支援中文與英文，最大長度為 500 個字元。每個中文字或英文字母都計為一個字元。",
                        "example": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions."
                      },
                      "size": {
                        "type": "string",
                        "description": "以 width*height 格式指定輸出影像的解析度，例如 \"1024\\*1536\"。 <br>- 寬與高都必須落在 [512, 2048] 像素的範圍內。 <br>- 預設總像素數約為 1024\\*1024，長寬比與輸入圖片（或多張圖片請求中的最後一張）相近。 <br>當您指定 size 參數時，系統會以 size 指定的寬與高為目標，並將實際輸出影像的寬與高調整為最接近的 16 的倍數。例如，若指定 1033\\*1032，輸出影像尺寸為 1040\\*1024。 <br>常見長寬比的建議解析度： <br>- 1:1：1024\\*1024、1536\\*1536 <br>- 2:3：768\\*1152、1024\\*1536 <br>- 3:2：1152\\*768、1536\\*1024 <br>- 3:4：960\\*1280、1080\\*1440 <br>- 4:3：1280\\*960、1440\\*1080 <br>- 9:16：720\\*1280、1080\\*1920 <br>- 16:9：1280\\*720、1920\\*1080 <br>- 21:9：1344\\*576、2048\\*872",
                        "example": "1024*1024"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "啟用智慧提示改寫。模型會最佳化正面提示。不會影響負面提示。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任務執行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任務執行失敗",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-image/youcam/{task_id}": {
      "get": {
        "summary": "查詢用於影像轉影像的 AI 文字生成圖片任務 V2 的狀態。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查詢的任務 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "成功查詢任務狀態",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'：`Authorization:Bearer YOUR_API_KEY`。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"
      }
    },
    "schemas": {
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "範本的 ID。執行任務時作為 \\`template_id\\` 使用。",
            "example": "good_template_001"
          },
          "thumb": {
            "type": "string",
            "description": "風格的縮略圖。"
          },
          "title": {
            "type": "string",
            "description": "範本的標題。"
          },
          "category_name": {
            "type": "string",
            "description": "範本的類別名稱。"
          }
        }
      },
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "回應狀態",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "這個任務的 ID。任務結果可以此 ID 查詢，有效期限 24 小時。",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "RunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "回應狀態",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "錯誤訊息",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters",
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest"
            ],
            "description": "錯誤代碼：\n* InvalidParameters - 請求參數無效\n* CreditInsufficiency - 點數不足，無法執行\n* BadRequest - 非預期的請求參數\n* InvalidStyleGroup - 風格群組 id 無效\n* InvalidStyle - 風格 id 無效\n"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "error_exceed_max_image_size",
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "錯誤：\n- \\`error_exceed_max_image_size\\`  - 輸入圖片尺寸超過上限\n- \\`exceed_max_filesize\\` - 輸入檔案大小超過上限\n- \\`invalid_parameter\\` - 參數值無效\n- \\`error_download_image\\` - 下載來源圖片錯誤\n- \\`error_download_mask\\` - 下載遮罩圖片錯誤\n- \\`error_decode_image\\` - 解析來源圖片錯誤\n- \\`error_decode_mask\\` - 解析遮罩圖片錯誤\n- \\`error_nsfw_content_detected\\` - 在來源圖片中偵測到 NSFW 內容\n- \\`error_no_face\\` - 來源圖片未偵測到臉部\n- \\`error_pose\\` - 無法偵測來源圖片的姿势\n- \\`error_face_parsing\\` - 無法對來源圖片進行臉部分割\n- \\`error_inference\\` - 推論流程錯誤\n- \\`exceed_nsfw_retry_limits\\` - 超過重試上限以避免產生 NSFW 圖片\n- \\`error_upload\\` - 上傳結果圖片錯誤\n- \\`unknown_internal_error\\` - 其他"
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "下載這個結果的網址。有效期限 2 小時",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "回應狀態",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "這個任務的狀態"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "錯誤的詳細說明"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "TemplateResponse": {
        "description": "成功取得風格",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "description": "回應狀態",
                  "example": 200
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "next_token": {
                      "type": "string",
                      "example": "73a3c9e69b89",
                      "description": "查詢下一頁的令牌。"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InvalidParameters": {
        "description": "請求參數無效",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "回應狀態"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid parameter value"
                },
                "error_code": {
                  "type": "string",
                  "example": "InvalidParameters"
                }
              }
            }
          }
        }
      },
      "InvalidApiKey": {
        "description": "API 金鑰無效或缺失",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "回應狀態"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "請求過多",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "回應狀態"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "任務 ID 無效",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "回應狀態"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "任務執行逾時",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "回應狀態"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}