# 執行 AI 風格移轉（影片）任務。

AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook)。
若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 `success` 或 `error`。

Endpoint: POST /s2s/v2.0/task/video-trans
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Response 200:

  - `200` (unknown)
    任務執行成功

## Response 200 fields (application/json):

  - `status` (integer)
    回應狀態
    Example: 200

  - `data` (object)

  - `data.task_id` (string)
    這個任務的 ID。任務結果可以此 ID 查詢，有效期限 24 小時。
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400:

  - `400` (unknown)
    任務執行失敗

## Response 400 fields (application/json):

  - `status` (integer)
    回應狀態
    Example: 400

  - `error` (string)
    錯誤訊息
    Example: The operation could not be completed

  - `error_code` (string)
    錯誤代碼：
* InvalidParameters - 請求參數無效
* CreditInsufficiency - 點數不足，無法執行
* BadRequest - 非預期的請求參數
* InvalidStyleGroup - 風格群組 id 無效
* InvalidStyle - 風格 id 無效
    Enum: "InvalidParameters", "CreditInsufficiency", "InvalidStyleGroup", "InvalidStyle", "BadRequest"

## Response 401:

  - `401` (unknown)
    API 金鑰無效或缺失

## Response 401 fields (application/json):

  - `status` (integer)
    回應狀態
    Example: 401

  - `error` (string)
    Example: Invalid API key

## Response 429:

  - `429` (unknown)
    請求過多

## Response 429 fields (application/json):

  - `status` (integer)
    回應狀態
    Example: 429

  - `error` (string)
    Example: Too many requests

