{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 照片轉影片",
    "description": "# 概述\nYouCam AI 照片轉影片輕鬆將文字提示與圖片轉化為引人入勝的影片。由先進 AI 技術驅動，它創造逼真的動態效果，讓您的想法與照片活起來。透過大量專業最佳化的範本，您可以快速將靜態圖片轉為引人入勝的高品質影片內容。\n\n要從圖片建立 AI 影片，請先使用一張背景乾淨、人像清晰可見的照片。只需上傳您的圖片，讓 YouCam AI 照片轉影片完成其餘工作，在瞬間將您的文字提示與照片轉化為動態影片。\n\n應用案例：\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_Animate%20Photo_047_d9e1cff579.jpg)\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/AI_Dance_Video_61cf4c58d1.png)\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/241216_AI_Kiss_image05_c3b7f1ac5b.jpg)\n\n\n## 檔案規格與錯誤\n\n* 支援的格式與尺寸\n\n|AI 功能|支援的尺寸|支援的檔案大小|支援的格式|\n|  ----  | ----  | ----  | ----  |\n| V1.0 影像轉影片（標準）|輸入：>= 300*300px，長寬比介於 1:2.5 ~ 2.5:1。輸出：最高 720p 30fps|輸入：<10MB。輸出：5 秒或 10 秒|jpg/jpeg/png|\n| V1.0 影像轉影片（專業）|輸入：>= 300*300px，長寬比介於 1:2.5 ~ 2.5:1。輸出：最高 1080p 30fps|輸入：<10MB。輸出：5 秒或 10 秒|jpg/jpeg/png|\n| V2.0 影像轉影片 | 輸入圖片的長邊不得超過 4096 像素，長寬比介於 1:2.5 與 2.5:1 之間。 <br> 支援的輸出解析度為 480p、720p 與 1080p。若輸入圖片的短邊超過所選解析度，或其長邊小於目標，圖片會自動調整尺寸，使短邊符合所選解析度。 |輸入：<10MB。輸出：5 秒或 10 秒|jpg/jpeg/png|\n\n* 錯誤代碼\n\n| 錯誤類別 | 情境 / 說明 | 建議動作 |\n| -------------- | ---------------------- | ---------------- |\n| 請求參數無效 | 請求參數無效或缺失 | 確認所有請求參數皆正確 |\n| | 參數值無效（例如鍵錯誤或非法值） | 檢查回應中的錯誤訊息欄位，並更新請求參數 |\n| | 請求方法無效 | 查閱 API 文件並使用正確的 HTTP 方法 |\n| | 請求的資源不存在（例如找不到模型） | 參考回應中的錯誤訊息欄位並修正請求參數|\n| 觸發策略 | 已觸發平台政策 | 檢查是否違反任何平台政策 |\n| | 觸發內容安全政策  | 檢查並修改輸入內容，然後重新發送請求 |\n| | 請求頻率過高（超過速率限制）| 降低請求頻率、稍後重試，或聯絡客服以提高限制 |\n| | 並行數或 QPS 超過配額   | 降低請求頻率，或稍後重試 |\n| 內部錯誤  | 內部伺服器錯誤 | 稍後重試或聯絡客服 |\n| | 伺服器暫時不可用 | 稍後重試或聯絡客服 |\n| | 因請求積壓導致內部逾時| 稍後重試或聯絡客服 |\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 照片轉影片（標準）V1.0 | 3（1 秒）* |\n| AI 照片轉影片（專業）V1.0 | 6（1 秒）* |\n| AI 照片轉影片（影像轉影片）V2.0 | 1 點（480p / 1 秒）* <br> 2 點（720p / 1 秒）* <br> 3 點（1080p / 1 秒）* |\n| AI 照片轉影片（文字轉影片）V2.0 | 2 點（720p / 1 秒）* <br> 3 點（1080p / 1 秒）* |\n\n    > *若圖片數量或影片長度無法整除，點數無條件進位。\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 影像轉影片生成，讓您的照片活起來。上傳一張圖片並提供描述，系統立即以先進 AI 技術將其轉換為充滿動態的視覺影像。這是無需學習任何編輯工具，就能享受高品質影像轉影片生成最簡單的方式。"
    },
    {
      "name": "V1.0",
      "description": "透過 AI 影像轉影片生成，您可以上傳單張照片，看著它隨著動態與個性活起來。先進的人工智慧將您的圖片轉化為動態視覺，讓您在沒有任何影片編輯經驗的情況下，也能創造令人驚豔的影片。享受最佳的 AI 驅動影像轉影片創作。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/image-to-video": {
      "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/image-to-video": {
      "post": {
        "summary": "執行影像轉影片任務。",
        "description": "這個端點啟動影像轉影片的轉換流程。您必須提供範本 ID 與來源檔案（透過網址或檔案 ID）。任務會以非同步方式處理，您可以使用這個回應回傳的 task_id 查詢其狀態。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RunWithSingleTemplateAndSrcUrl"
                  },
                  {
                    "type": "object",
                    "required": [
                      "dst_duration"
                    ],
                    "properties": {
                      "dst_duration": {
                        "type": "integer",
                        "description": "影片長度，以秒計。僅接受 5 或 10 秒\n",
                        "enum": [
                          5,
                          10
                        ]
                      },
                      "mode": {
                        "type": "string",
                        "enum": [
                          "std",
                          "pro"
                        ],
                        "description": "品質模式。標準（std）模式速度較快，品質尚可。專業（pro）模式品質最佳，細節更豐富。若未提供，會依風格自動選擇最佳模式。"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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-video/{task_id}": {
      "get": {
        "summary": "查詢影像轉影片任務的狀態。",
        "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/VidTaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-video/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": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  },
                  {
                    "type": "object",
                    "required": [
                      "resolution",
                      "dst_duration"
                    ],
                    "properties": {
                      "resolution": {
                        "type": "string",
                        "description": "用於選擇推論時使用的輸出解析度。",
                        "enum": [
                          "480",
                          "720",
                          "1080"
                        ],
                        "example": "480"
                      },
                      "dst_duration": {
                        "type": "integer",
                        "description": "用於選擇推論時使用的輸出長度。",
                        "enum": [
                          5,
                          10
                        ],
                        "example": 5
                      },
                      "prompt": {
                        "minLength": 1,
                        "maxLength": 1500,
                        "type": "string",
                        "description": "可使用任何語言。會透過 Gemini API 自動增強並輸出為英文。簡短的提示最為理想。",
                        "example": "その女性は微笑んで、カメラを見ています"
                      },
                      "negative_prompt": {
                        "minLength": 1,
                        "maxLength": 1500,
                        "type": "string",
                        "description": "負面提示。",
                        "example": "worst quality, low quality, JPEG compression residue, ugly."
                      },
                      "model": {
                        "type": "string",
                        "description": "模型名稱。",
                        "enum": [
                          "youcam-video-v2"
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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-video/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/VidTaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-video/youcam": {
      "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": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "prompt",
                      "dst_duration"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "模型名稱。",
                        "default": "youcam-video-v2",
                        "enum": [
                          "youcam-video-v2"
                        ]
                      },
                      "prompt": {
                        "minLength": 1,
                        "maxLength": 5000,
                        "type": "string",
                        "description": "描述影片內容與視覺風格的文字提示。\n支援中文與英文。每個字或字母計為一個字元。\n",
                        "example": "A kitten running in the moonlight."
                      },
                      "negative_prompt": {
                        "minLength": 1,
                        "maxLength": 500,
                        "type": "string",
                        "description": "負面提示，描述要從影片中排除的內容，以約束輸出。\n支援中文與英文。\n",
                        "example": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions."
                      },
                      "resolution": {
                        "type": "string",
                        "description": "生成影片的解析度等級，控制清晰度（總像素數）。",
                        "default": "1080P",
                        "enum": [
                          "720P",
                          "1080P"
                        ],
                        "example": "1080P"
                      },
                      "ratio": {
                        "type": "string",
                        "description": "生成影片的長寬比。\n\n各長寬比的輸出影片解析度（width*height）見下表：\n\n| 解析度等級 | 長寬比 | 輸出影片解析度（width*height） |\n|:---|:---|:---|\n| **720P** | 16:9 | 1280*720 |\n| **720P** | 9:16 | 720*1280 |\n| **720P** | 1:1 | 960*960 |\n| **720P** | 4:3 | 1104*832 |\n| **720P** | 3:4 | 832*1104 |\n| **1080P** | 16:9 | 1920*1080 |\n| **1080P** | 9:16 | 1080*1920 |\n| **1080P** | 1:1 | 1440*1440 |\n| **1080P** | 4:3 | 1648*1248 |\n| **1080P** | 3:4 | 1248*1648 |\n",
                        "default": "16:9",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "4:3",
                          "3:4"
                        ],
                        "example": "16:9"
                      },
                      "dst_duration": {
                        "type": "integer",
                        "description": "生成影片的長度（秒）。",
                        "default": 5,
                        "minimum": 2,
                        "maximum": 15,
                        "example": 5
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "啟用提示改寫。啟用時，大型語言模型會智慧地改寫輸入的提示。這可改善短提示的結果，但會增加延遲。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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-video/youcam/{task_id}": {
      "get": {
        "summary": "查詢 AI 文字轉影片任務的狀態。",
        "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": "範本的類別名稱。"
          }
        }
      },
      "RunWithSingleTemplate": {
        "title": "RunWithSingleTemplate",
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "範本的 ID。請先列出預先定義的範本，然後使用某個範本的 id。",
            "example": "good_template_001"
          }
        },
        "required": [
          "template_id"
        ]
      },
      "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"
              }
            ]
          }
        ]
      },
      "RunWithSingleTemplateAndSrcUrl": {
        "title": "RunWithSingleTemplateAndSrcUrl",
        "allOf": [
          {
            "$ref": "#/components/schemas/RunWithSingleTemplate"
          },
          {
            "$ref": "#/components/schemas/BasicRunTaskV2"
          }
        ]
      },
      "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\\` - 其他"
      },
      "VidTaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "下載這個結果的網址。有效期限 2 小時",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "VidTaskStatusResponseV2": {
        "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/VidTaskStatusResponseBodySingleUrlResultsV2"
      },
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}