{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 虛擬耳環",
    "description": "# 概述\n終極的 AI 虛擬耳環\n頂尖的 AI 耳洞模擬器，用於虛擬耳環試戴與虛擬穿孔試戴\n\n從 2D 圖片創造寫實且動態的耳環虛擬試戴，無需昂貴的 3D 建模。我們先進的演算法以精緻的光線效果與物理精確的動作，創造栩栩如生的虛擬試戴耳環 SKU。\n\n## 整合指南\n本指南將引導您完成：\n\n*   **端點：** `/s2s/v2.0/task/2d-vto/earring`\n*   **認證：** 所有請求都需要 `Authorization: Bearer YOUR_API_KEY`\n*   **工作流程：**\n    1.  **準備自拍圖片：** 上傳圖片，或提供有效的圖片網址\n    2.  **準備耳環圖片：** 上傳圖片，或提供耳環產品的有效圖片網址\n    3.  **啟動 AI 任務並取得任務 ID：** 從回應中取得 `task_id`。\n    4.  **輪詢狀態（`GET`）：** 使用 `task_id` 查詢任務狀態。持續輪詢直到 `task_status` 為 `\"success\"` 或 `\"error\"`。\n\n---\n\n* API Playground\n\n使用我們的官方 playground 進行互動式探索與測試：\n\n**API Playground：**\n[http://yce.makeupar.com/api-console/en/api-playground/ai-earring-virtual-try-on/](http://yce.makeupar.com/api-console/en/api-playground/ai-earring-virtual-try-on/)\n\n---\n\n* 認證\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\n* 1. 上傳圖片\n\n您可以直接上傳檔案到伺服器，或在 VTO 任務內容中提供有效的圖片網址。\n\n   * 上傳端點\n\n```\nPOST /s2s/v2.0/file\n```\n\n或者，若您已有公開的圖片網址，可跳過此步驟。\n\n您可以直接上傳檔案到 File API 回應中提供的網址，然後使用 File API 回傳的對應 `src_file_id`，在後續呼叫 AI 任務。或在 VTO 任務內容中提供有效的圖片網址作為 `src_file_url`。`src_file_id` 或 `src_file_url` 將作為虛擬試戴的目標。\n\n您也必須使用 `ref_file_ids` 或 `ref_file_urls` 提供另一張耳環產品圖片作為參考，以套用到您的 `src_file_id` 或 `src_file_url`。\n\nAI 引擎支援為您的耳環產品圖片自動移除背景。不過，您可以為您的手部（`srcmsk_file_id` 或 `srcmsk_file_url`）或耳環產品（`refmsk_file_ids` 或 `refmsk_file_urls`）提供遮擋遮罩圖片檔案，以微調分割結果。\n\n---\n\n* 2. 建立耳環 VTO 任務並輪詢結果\n\n當您取得圖片與範本 ID 後，即可建立任務。API 以非同步方式處理請求。您必須輪詢任務狀態，直到達到 `success` 或 `error`。\n\n   * 建立任務端點\n\n```\nPOST /s2s/v2.0/task/2d-vto/earring\n```\n\n   * 輪詢端點\n\n```\nGET /s2s/v2.0/task/2d-vto/earring/{task_id}\n```\n\n---\n\n## 檔案規格與錯誤\n\n* AI 虛擬耳環規範\n\n**支援的耳環參考圖片**\n* 單個耳環的圖片，正面視角清晰且無遮擋。\n*   所有參數（包括錨點、遮罩、位置等）**僅**在參考圖片展示**單個耳環**佩戴時適用。\n*   若試戴參考圖片展示**兩邊耳環**，所有參數將使用**自動偵測與預設設定**。\n*   試戴**兩邊耳環**時，較清晰的耳朵將作為來源，另一邊則以其鏡像生成。\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/earring_product_01_41c943f9fc_037ffb1241.jpg) ![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/earring_product_07_5476e0a156_a69e8e6549.jpg)\n\n**支援的自拍視角**\n\n*   AI 虛擬耳環支援正面圖片，但側面圖片可達到最佳結果。\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/Earring_restriction_cdf1de3c7b.png)\n\n**earring\\_wearing\\_location：長度為 2 的整數陣列**\n指定自拍中耳環應放置的目標位置。\n預設值：null（引擎預設）\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/wearing_location_b4f6f4453a.jpg)\n\n**earring\\_scale：大於 0 的數值**\n以公分控制耳環尺寸。\n預設值：null（引擎預設）\n\n**earring\\_is\\_right\\_ear：boolean**\nindicating 耳環是否佩戴在右耳。預設佩戴在右耳。\n預設值：true\n\n**earring\\_occluded\\_type：number（Enum：0、1、2）**\n指定遮擋類型：\n0 代表自動偵測\n1 代表被遮擋\n2 代表無遮擋\n預設值：0\n\n**earring\\_shadow\\_intensity：float（0.0 到 1.0）**\n控制陰影強度：\n0.0 代表無陰影\n1.0 代表最大陰影\n預設值：0.15\n\n**earring\\_ambient\\_light\\_intensity：float（0.0 到 1.0）**\n定義光線參考自拍圖片的程度：\n0.0 忽略自拍圖片的光線\n1.0 完全符合自拍圖片的光線與陰影渲染\n預設值：1.0\n\n**earring\\_anchor\\_point：以像素座標表示的一點陣列（選填）**\n指定耳環產品圖片中的佩戴位置。\n預設值：null（引擎預設）\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/anchor_point_787282aa19.jpg)\n\n\n---\n\n* 支援的格式與尺寸\n\n|AI 功能|支援的尺寸|支援的檔案大小|支援的格式|\n|  ----  | ----  | ----  | ----  |\n|AI 虛擬耳環|長邊 <= 4096 |< 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 點 <br> 疊戴 2 點 |\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 處理，為上傳的圖片生成耳環虛擬試戴體驗，支援對位與陰影參數。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/2d-vto/earring": {
      "post": {
        "summary": "執行 AI 2D 耳環虛擬試戴任務。",
        "description": "這個端點啟動耳環虛擬試戴流程。您必須提供來源檔案與參考圖片（透過網址或檔案 ID），以及對位、陰影與佩戴位置的特定參數。任務會以非同步方式處理，您可以使用這個回應回傳的 task_id 查詢其狀態。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarringRunTaskV2"
              }
            }
          }
        },
        "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/2d-vto/earring/{task_id}": {
      "get": {
        "summary": "查詢 AI 2D 耳環虛擬試戴任務的狀態。",
        "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"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'：`Authorization:Bearer YOUR_API_KEY`。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"
      }
    },
    "schemas": {
      "EarringRunTaskV2": {
        "allOf": [
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2"
          },
          {
            "type": "object",
            "properties": {
              "object_infos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "parameter": {
                      "type": "object",
                      "properties": {
                        "earring_need_remove_background": {
                          "type": "boolean",
                          "description": "耳環圖片是否需要移除背景。",
                          "default": true,
                          "example": true
                        },
                        "earring_anchor_point": {
                          "type": "array",
                          "description": "耳環圖片的錨點，用於對位。 <br>類型：2 個整數的清單 <br>範圍：[x, y]（像素座標） <br>預設：null（使用引擎預設）",
                          "default": null,
                          "example": null,
                          "minItems": 2,
                          "maxItems": 2,
                          "items": {
                            "type": "integer"
                          }
                        },
                        "earring_wearing_location": {
                          "type": "array",
                          "description": "照片中應放置耳環的目標位置。 <br>類型：2 個整數的清單 <br>範圍：[x, y]（像素座標） <br>預設：null（使用引擎預設）",
                          "default": null,
                          "example": null,
                          "minItems": 2,
                          "maxItems": 2,
                          "items": {
                            "type": "integer"
                          }
                        },
                        "earring_scale": {
                          "type": "number",
                          "description": "以公分控制耳環的大小。 <br>預設：null（使用引擎預設）",
                          "default": null,
                          "minimum": 0,
                          "exclusiveMinimum": true,
                          "example": null
                        },
                        "earring_is_right_ear": {
                          "type": "boolean",
                          "description": "耳環是否戴在右耳，預設戴在右耳。",
                          "default": true,
                          "example": true
                        },
                        "earring_occluded_type": {
                          "type": "number",
                          "description": "耳環屬於哪種遮擋類型。0 代表自動偵測，1 代表遮擋類型，2 代表無。",
                          "default": 0,
                          "enum": [
                            0,
                            1,
                            2
                          ],
                          "example": 0
                        },
                        "earring_shadow_intensity": {
                          "type": "number",
                          "description": "套用到耳環的陰影強度（較高＝較深的陰影）。",
                          "minimum": 0,
                          "maximum": 1,
                          "default": 0.5,
                          "example": 0.5
                        },
                        "earring_ambient_light_intensity": {
                          "type": "number",
                          "description": "耳環的環境光調整強度。",
                          "minimum": 0,
                          "maximum": 1,
                          "default": 0.5,
                          "example": 0.5
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "要執行任務的檔案網址。該網址應可公開存取。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "2dVtoRunTaskV2SrcmskFileUrl": {
        "type": "object",
        "properties": {
          "srcmsk_file_url": {
            "type": "string",
            "description": "執行任務所用來源遮罩檔案的網址。該網址需可公開存取。",
            "example": "https://example.com/src_mask.jpg"
          }
        }
      },
      "2dVtoRunTaskV2RefFileUrls": {
        "type": "object",
        "required": [
          "ref_file_urls"
        ],
        "properties": {
          "ref_file_urls": {
            "type": "array",
            "description": "執行任務所用參考檔案的網址。該網址需可公開存取。",
            "example": [
              "https://example.com/vto_sku.jpg"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefmskFileUrls": {
        "type": "object",
        "properties": {
          "refmsk_file_urls": {
            "type": "array",
            "description": "執行任務所用參考遮罩檔案的網址。該網址需可公開存取。",
            "example": [
              "https://example.com/vto_sku_mask.jpg"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefFileIds": {
        "type": "object",
        "required": [
          "ref_file_ids"
        ],
        "properties": {
          "ref_file_ids": {
            "type": "array",
            "description": "執行任務所用參考檔案的 ID。來自上傳檔案 API 的檔案 ID。",
            "example": [
              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefmskFileIds": {
        "type": "object",
        "properties": {
          "refmsk_file_ids": {
            "type": "array",
            "description": "執行任務所用參考遮罩檔案的 ID。來自上傳檔案 API 的檔案 ID。",
            "example": [
              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "要執行任務的檔案 ID。檔案 ID 來自上傳檔案 API。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "2dVtoRunTaskV2SrcmskFileId": {
        "type": "object",
        "properties": {
          "srcmsk_file_id": {
            "type": "string",
            "description": "執行任務所用來源遮罩檔案的 ID。來自上傳檔案 API 的檔案 ID。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "2dVtoRunTaskV2SrcInfo": {
        "type": "object",
        "required": [
          "source_info"
        ],
        "properties": {
          "source_info": {
            "type": "object",
            "description": "包含來源照片資訊。",
            "properties": {
              "name": {
                "type": "string",
                "description": "來源網址或檔案 ID。",
                "example": "https://example.com/selfie.jpg"
              },
              "mask_name": {
                "type": "string",
                "description": "來源遮罩網址或檔案 ID。",
                "example": "https://example.com/src_mask.jpg"
              }
            },
            "required": [
              "name"
            ]
          }
        }
      },
      "2dVtoRunTaskV2ObjInfos": {
        "type": "object",
        "required": [
          "object_infos"
        ],
        "properties": {
          "object_infos": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "此清單中包含數個物件的資訊。",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "參考網址或檔案 ID。指出要對應哪個參考產品圖片。",
                  "example": "https://example.com/vto_sku.jpg"
                },
                "mask_name": {
                  "type": "string",
                  "description": "參考遮罩網址或檔案 ID。指出應對應哪個參考產品圖片。",
                  "example": "https://example.com/vto_sku_mask.jpg"
                }
              },
              "required": [
                "name"
              ]
            }
          }
        }
      },
      "2dVtoRunTaskV2": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "Run task with src file url & srcmsk file url & ref file urls & refmsk file urls"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileUrls"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileUrls"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "Run task with src file url & srcmsk file url & ref file IDs & refmsk file IDs"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileIds"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileIds"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "Run task with src file ID & srcmsk file ID & ref file urls & refmsk file urls"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileUrls"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileUrls"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "Run task with src file ID & srcmsk file ID & ref file IDs & refmsk file IDs"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileIds"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileIds"
                  }
                ]
              }
            ]
          },
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2SrcInfo"
          },
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2ObjInfos"
          }
        ]
      },
      "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": {
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}