語音合成

聲音克隆

對口型視頻

其他

查詢任務

通過任務 ID 查詢對口型任務的處理進度和結果

查詢對口型任務接口

接口地址

GET /api/open/lip-sync/query?id=YOUR_TASK_ID

// 或使用 POST 請求
POST /api/open/lip-sync/query

請求頭

Authorization: Bearer YOUR_API_TOKEN  // API 密鑰

請求參數 (POST 方式)

{
  "id": string  // 必填,創建任務時返回的任務 ID
}

返回數據

// 成功響應 - 200
{
  "success": true,
  "data": {
    "id": string,               // 任務 ID
    "status": string,           // 任務狀態:"pending" | "processing" | "completed" | "failed"
    "progress": number,         // 進度百分比 (0-100)
    "result_url": string,       // 結果視頻 URL(completed 時返回)
    "error_message": string,    // 錯誤信息(failed 時返回)
    "created_at": string,       // 創建時間
    "updated_at": string,       // 更新時間
    "completed_at": string,     // 完成時間
    "credits_used": number      // 消耗的積分
  }
}

// 錯誤響應
{
  "error": string               // 錯誤提示信息
}

輪詢建議

建議每 3-5 秒查詢一次任務狀態,直到 status 為 "completed" 或 "failed"

CURL 示例

curl -X GET "https://kittaai.com/api/open/lip-sync/query?id=YOUR_TASK_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

在線調試

輪詢建議

建議每 3-5 秒查詢一次任務狀態,直到 status 為 "completed" 或 "failed"

狀態碼說明

狀態碼說明:
200 OK                  - 請求成功
400 Bad Request         - 請求參數錯誤
401 Unauthorized        - API Token 無效
403 Forbidden          - 禁止訪問
404 Not Found          - 資源不存在
413 Payload Too Large  - 上傳文件過大
429 Too Many Requests  - 請求頻率超限/積分不足
500 Server Error       - 服務器內部錯誤

錯誤響應格式:
{
  "error": string,      // 錯誤信息
  "details": string,    // 詳細錯誤信息(可選)
  "code": string       // 錯誤代碼(可選)
}