{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 臉部拉提",
    "description": "# 概述\nAI 臉部拉提是生成式 AI 的臉部增強功能，透過可調整的參數達成精準自然的臉部精修。系統不是套用濾鏡，而是智慧地分析臉部結構、膚質與比例，然後重建影像，產生保留個人特徵的寫實改善。\n\n使用者可用 0 到 100 的數值控制特定的臉部區域，例如眼袋、臉頰、額頭、整體臉型與嘴巴。每個參數逐步提升增強程度，依使用者偏好達成細微修飾或更精緻的結果。所有調整都設計為維持自然與平衡，避免誇張或不自然的結果。\n\nAI 臉部拉提提供彈性、功能層級的控制，創造清新、自信且專業的外觀，適合社群媒體、個人頭像、創意內容或商務用途。\n\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/01_1_6c0d97eb51.jpg)\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/01_2_8c428a25dc.jpg)\n\n\n## 整合指南\n本指南將引導您完成：\n\nAI 臉部拉提 API 的工作流程：\n\n**端點：** `/s2s/v2.0/task/face-lift`\n\n**需要認證：** `Authorization: Bearer YOUR_API_KEY`\n\n**工作流程步驟：**\n\n1. **圖片上傳準備：**\n  - 準備要上傳的自拍圖片。\n  - 呼叫 File API `/s2s/v2.0/file` 取得上傳網址與相關的 `file_id`。\n  - 使用提供的上傳網址上傳自拍圖片。\n\n2. **多張臉部的選填前處理：**\n    - 若圖片中有多於一張臉部，請對自拍圖片進行前處理。\n\n3. **臉部拉提特效設定：**\n   - 先選擇合適的臉部拉提參數。\n\n4. **啟動 AI 任務並取得任務 ID：**\n   - 透過 HTTP POST 請求，將 `file_id` 與所選特效設定傳送到 `/s2s/v2.0/task/face-lift`。\n   - 在回應中取得唯一的任務 ID，用以識別這次互動。\n\n5. **輪詢任務狀態（持續檢查）：**\n   - 使用取得的 `task_id`，透過 HTTP GET 請求（例如 `GET /s2s/v2.0/task/face-lift${task_id}`）定期輪詢任務狀態。\n   - 持續監控：\n     - `Task_status = \"success\"`（流程完成）。\n     - `Task_status = \"error\"`（視情況解決或重試）。\n   - 狀態轉為成功後，相應更新工作流程。\n\n這個結構化的工作流程確保與使用者輸入的高效整合、任務的自動化監控，以及無縫取得結果。\n\n\n---\n\n1.  認證\n    - 使用 **Bearer Token** 在請求標頭中納入您的 API key：\n        ```\n        Authorization: Bearer YOUR_API_KEY\n        ```\n    您可以在 https://yce.makeupar.com/api-console/en/api-keys/ 找到您的 API Key。\n\n\n2.  上傳圖片\n\n    您可以直接上傳檔案到伺服器，或在 AI 任務內容中提供有效的圖片網址。\n\n    * 上傳端點\n\n        ```\n        POST /s2s/v2.0/file\n        ```\n\n    或者，若您已有公開的圖片網址，可跳過此步驟。\n\n---\n\n3. 透過前處理選擇要增強的目標臉部\n\n   * 呼叫前處理 API\n    輸出以像素座標表示的偵測邊界框。使用結果的索引，在稍後建立臉部拉提 AI 任務。\n        ```\n        POST /s2s/v2.0/task/face-lift/pre-process\n        ```\n\n        ```\n        {\n            \"timed\": number,\n            \"result\": [\n                {\n                    \"left\": number,\n                    \"top\": number,\n                    \"width\": number,\n                    \"height\": number\n                }\n            ]\n        }\n        ```\n\n4. 建立臉部拉提 AI 任務並輪詢結果\n\n    當您取得圖片與完整的特效內容後，即可建立任務。API 以非同步方式處理請求。您必須輪詢任務狀態，直到達到 `success` 或 `error`。\n\n   * 建立任務端點\n\n        ```\n        POST /s2s/v2.0/task/face-lift\n        ```\n\n   * 輪詢端點\n\n        ```\n        GET /s2s/v2.0/task/face-lift/{task_id}\n        ```\n\n---\n\n## 檔案規格與錯誤\n\n* AI 臉部拉提規範\n\n**支援的自拍視角**\n圖片不得大於 1920 x 1920，在長邊為 640 時須包含清晰可見且足夠大的臉部（超過 32 x 32 像素），且拍攝的 roll 角度在正負 75 度內、yaw 角度在正負 90 度內，以確保可靠的臉部偵測。\n\n![](https://plugins-media.makeupar.com/strapi/assets/thumbnail_face_reshape_01_85c8ffc055.jpg)\n\n\n---\n\n* 支援的格式與尺寸\n\n| AI 功能 | 支援的尺寸 | 支援的檔案大小 | 支援的格式|\n|  ----  | ----  | ----  | ----  |\n| AI 臉部拉提 | 長邊 <= 1920 | < 10MB | jpg/jpeg/png |\n\n* 錯誤代碼\n\n| 錯誤代碼 | 說明 |\n|  ----  | ----  |\n| RUNTIME_ERROR | 臉部拉提執行期間發生不如預期的錯誤 |\n| PHOTO_DETECTION_FAIL | 無法正確處理使用者照片，例如未偵測到手 |\n| OBJECT_DETECTION_FAIL | 無法正確處理物件照片，例如未偵測到產品 |\n| PHOTO_CHECK_INVALID | 使用者照片的姿勢或尺寸無效 |\n| INPUT_ERROR | 輸入檔案格式不正確 |\n| INPUT_MAIN_IMAGE_EMPTY | 需要使用者圖片 |\n\n\n* 環境與相依性\n\n| 範例程式語言 / 工具 | 建議的執行環境版本 |\n|---|---|\n| cURL | - bash >= 3.2</br>   - curl >= 7.58（現代 TLS/HTTP 支援）</br>   - jq >= 1.6（穩健的 JSON 解析） |\n| Node.js（JavaScript） | Node >= 18（支援全域 fetch） |\n| JavaScript | - Chrome / Edge >= 80</br>   - Firefox >= 74</br>   - Safari >= 13.1 |\n| PHP | PHP >= 7.4（現代 TLS/相容性），ext-curl（建議）或 allow_url_fopen=On + ext-openssl、ext-json |\n| Python | Python >= 3.10（支援 f-strings），requests >= 2.20.0 |\n| Java | Java 11+（支援 HttpClient），Jackson Databind >= 2.12.0 |\n\n---\n\n## JS Camera Kit\n{% partial file=\"/_partials/js-camera-kit.md\" /%}\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 臉部拉提 V1.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": "V1.0",
      "description": "AI 臉部拉提是一項生成式 AI 臉部增強功能，可透過可調整的參數，進行精準而自然的臉部精修。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/face-lift/pre-process": {
      "post": {
        "summary": "執行 AI 臉部拉提的偵測任務。",
        "description": "當來源照片可能包含超過一個有效目標，或您的整合需要明確選擇哪個被偵測到的目標接受特效時，請使用前處理任務。對於單一目標的圖片，當功能支援預設的 `index` 值，且您的應用程式不需要手動選擇目標時，可以跳過前處理。\n\n前處理任務會偵測來源照片中的候選目標，並在 `data.results.result` 中回傳它們的座標。結果陣列中的每個項目代表一個被偵測到的目標。檢視回傳的座標，將它們對應到來源照片中預期的臉部或區域，並在建立特效任務時，將該項目的零基陣列索引作為 `index` 值使用。\n\n對於偵測到多張臉或多個區域的圖片，請不要在未檢查前處理結果的情況下依賴預設的 `index` 值。特效只會套用到由 `index` 選定的目標，因此整合必須在執行特效任務前，確認對應到預期目標的結果項目。\n\n這個任務是非同步的。建立任務後，若功能支援，請以 webhook 處理完成，否則輪詢對應的前處理狀態端點，直到 `data.task_status` 為 `success` 或 `error`。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  }
                ]
              }
            }
          }
        },
        "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/face-lift/pre-process/{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/TaskStatusResponsePreProcessSingleIndexWithTimed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/face-lift": {
      "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": {
                "$ref": "#/components/schemas/FaceLiftRunTask"
              }
            }
          }
        },
        "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/face-lift/{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/TaskStatusResponseV2WithTimedAndTimedApply"
                }
              }
            }
          },
          "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": {
      "FaceLiftRunTask": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "以 src_file_url 與 'auto' 類型執行任務"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "required": [
                      "src_file_url"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "auto"
                        ]
                      }
                    }
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "以 src_file_url 與 'custom' 類型執行任務"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "required": [
                      "src_file_url",
                      "features"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "custom"
                        ]
                      },
                      "features": {
                        "minProperties": 1
                      }
                    }
                  },
                  {
                    "title": "功能不可全為零",
                    "not": {
                      "properties": {
                        "features": {
                          "properties": {
                            "eye_bag": {
                              "enum": [
                                0
                              ]
                            },
                            "cheek": {
                              "enum": [
                                0
                              ]
                            },
                            "forehead": {
                              "enum": [
                                0
                              ]
                            },
                            "shape": {
                              "enum": [
                                0
                              ]
                            },
                            "mouth": {
                              "enum": [
                                0
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "以 src_file_id 與 'auto' 類型執行任務"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "required": [
                      "src_file_id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "auto"
                        ]
                      },
                      "features": {
                        "minProperties": 1
                      }
                    }
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "以 src_file_id 與 'custom' 類型執行任務"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "required": [
                      "src_file_id",
                      "features"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "custom"
                        ]
                      }
                    }
                  },
                  {
                    "title": "功能不可全為零",
                    "not": {
                      "properties": {
                        "features": {
                          "properties": {
                            "eye_bag": {
                              "enum": [
                                0
                              ]
                            },
                            "cheek": {
                              "enum": [
                                0
                              ]
                            },
                            "forehead": {
                              "enum": [
                                0
                              ]
                            },
                            "shape": {
                              "enum": [
                                0
                              ]
                            },
                            "mouth": {
                              "enum": [
                                0
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "type": "object",
            "required": [
              "version"
            ],
            "properties": {
              "version": {
                "type": "string",
                "description": "功能規範的版本。除非另有指定，預設為 `\"1.0\"`。\n",
                "default": "1.0",
                "example": "1.0"
              },
              "index": {
                "type": "integer",
                "example": 0,
                "default": 0,
                "description": "要套用特效的目標物件的零基索引。對於含多個物件的圖片，請先執行前處理任務，檢查 `data.results.result` 中的物件座標，並將所選物件的索引傳入此處。\n\n前處理步驟會在套用任何特效之前，分析輸入圖片以識別所有可偵測的物件。它執行一個偵測任務，為每個物件回傳結構化資料，包含一個邊界框座標清單。清單中每個項目的位置，就是它的零基索引，隨後用於指定特效的目標物件。\n\n這些資訊以結構化格式回傳，通常位於 `data.results.result` 之下。\n先執行這個步驟，您可以：\n    * 了解圖片中有多少物件\n    * 檢查它們的位置與大小\n    * 依索引選取正確的目標物件\n\n對於含多個物件的圖片，務必執行前處理步驟。\n檢視 `data.results.result` 以識別物件及其索引。\n使用對應的零基索引選取正確的目標。\n"
              },
              "type": {
                "type": "string",
                "default": "custom"
              },
              "features": {
                "type": "object",
                "additionalProperties": false,
                "description": "使用 'custom' 類型時不可全為零。",
                "properties": {
                  "eye_bag": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "cheek": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "forehead": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "shape": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "mouth": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 100
                  }
                }
              },
              "global": {
                "$ref": "#/components/schemas/GlobalSkinSmoothCommon"
              }
            }
          }
        ]
      },
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "要執行任務的檔案網址。該網址應可公開存取。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "要執行任務的檔案 ID。檔案 ID 來自上傳檔案 API。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2": {
        "title": "BasicRunTaskV2",
        "anyOf": [
          {
            "title": "Run task with src file url",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              }
            ]
          },
          {
            "title": "Run task with src file ID",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
              }
            ]
          }
        ]
      },
      "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\\` - 其他"
      },
      "TaskStatusResponsePreProcessNoUrlBase": {
        "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": "錯誤的詳細說明"
              }
            }
          }
        }
      },
      "TaskStatusResponsePreProcessSingleIndexWithTimed": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaskStatusResponsePreProcessNoUrlBase"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "results": {
                    "type": "object",
                    "properties": {
                      "timed": {
                        "type": "number"
                      },
                      "result": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "left": {
                              "type": "number"
                            },
                            "top": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number"
                            },
                            "height": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "GlobalSkinSmoothCommon": {
        "type": "object",
        "properties": {
          "skin_smooth_strength": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0
          },
          "skin_smooth_color_intensity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0
          }
        }
      },
      "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"
      },
      "TaskStatusResponseV2WithTimedAndTimedApply": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaskStatusResponseV2"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "results": {
                    "type": "object",
                    "properties": {
                      "timed": {
                        "type": "number"
                      },
                      "timed_apply": {
                        "type": "number"
                      }
                    }
                  },
                  "task_status": {
                    "type": "string",
                    "enum": [
                      "running",
                      "success",
                      "error"
                    ],
                    "description": "這個任務的狀態"
                  },
                  "error": {
                    "$ref": "#/components/schemas/EngineErrorCode"
                  },
                  "error_message": {
                    "type": "string",
                    "description": "錯誤的詳細說明"
                  }
                }
              }
            }
          }
        ]
      }
    },
    "responses": {
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}