跳轉到主要內容
POST
/
kling
/
v1
/
videos
/
video-extend
Video Extension
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/video-extend \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "video_id": "example"
}
'
{
  "code": 123,
  "message": "<string>",
  "request_id": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "task_status_msg": "<string>",
    "task_info": {
      "parent_video": {
        "id": "<string>",
        "url": "<string>",
        "duration": "<string>"
      }
    },
    "task_result": {
      "videos": [
        {
          "id": "<string>",
          "url": "<string>",
          "duration": "<string>"
        }
      ]
    },
    "created_at": 123,
    "updated_at": 123
  }
}
使用此端點可將現有的 Kling 影片作為後續任務進行延展。

呼叫前須知

  • 從已完成的 Kling 影片結果開始
  • 傳入父任務結果中的 video_id
  • 在與父任務相同的帳號上下文中執行延展
  • 在父任務資源過期前儘快觸發延展

任務流程

1

完成父影片任務

建立原始 Kling 影片,並等待其結果可用。
2

提交延展請求

傳送 video_id 與選填的 prompt,然後儲存回傳的 task id。
3

輪詢延展任務

持續使用個別查詢,直到延展後的影片進入最終狀態。
完整參數說明請參閱官方 Kling 文件

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
video_id
string
預設值:example
必填

Video id from a previously generated Kling video task to extend.

prompt
string

Text prompt describing the desired motion for the extended segment. Maximum 500 characters.

callback_url
string

Webhook URL to receive task status updates when the task completes.

回應

200 - application/json

Successful Response

code
integer
必填

Error code; specifically define the error code

message
string
必填

error message

request_id
string
必填

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object
必填