Skip to main content
POST
cURL
使用此端点可将现有的 Kling 视频作为后续任务进行延长。

调用前准备

  • 从一个已完成的 Kling 视频结果开始
  • 传入父任务结果中的 video_id
  • 将父 task_idvideo_id 一起传入
  • 使用与延长兼容的源视频;不受支持的源视频会返回 HTTP 400,而不是创建延长任务
  • 已完成的 5 秒 Kling v1 或 v1-6 文生视频或图生视频父任务,是更稳妥的延长兼容性起点
  • 仅在需要引导续写内容时添加 promptnegative_promptcfg_scale
  • 在与父任务相同的账户上下文中运行延长任务
  • 在父任务资源过期前尽快触发延长

任务流程

1

完成父视频任务

创建原始 Kling 视频,并等待其结果可用。
2

提交延长请求

发送父 task_idvideo_id 和可选 prompt,然后保存返回的任务 id。
3

轮询延长任务

继续使用获取一个 Kling 任务,直到延长后的视频达到终态。
完整的参数参考请见官方 Kling 文档

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
task_id
string
必填

Parent Kling task id for the extension-compatible video being extended.

video_id
string
必填

Video id from a parent task result. The source video must be extension-compatible; unsupported videos return HTTP 400.

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.

negative_prompt
string

Elements to avoid in the extension.

cfg_scale
number

Prompt adherence strength for the extension. Range: 0-1.

响应

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
必填