跳转到主要内容
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,然后保存返回的任务 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
必填