{
  "Create Task": "Create Task\nPOST\n/v1/videos/video-extend\ncURL\nCopy\nCollapse\ncurl --request POST \\\n--url https://api-singapore.klingai.com/v1/videos/video-extend \\\n--header 'Authorization: Bearer <token>' \\\n--header 'Content-Type: application/json' \\\n--data '{\n\"prompt\": \"A puppy appears\",\n\"video_id\": \"743211632612511839\",\n\"negative_prompt\": \"\",\n\"callback_url\": \"\"\n}'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; Specific definitions can be found in Error codes\n\"message\": \"string\", // Error information\n\"request_id\": \"string\", // Request ID, generated by the system, is used to track requests and troubleshoot problems\n\"data\": {\n\"task_id\": \"string\", // Task ID, generated by the system\n\"task_status\": \"string\", // Task status, Enum values: submitted, processing, succeed, failed\n\"task_info\":{ // Task creation parameters\n\"external_task_id\": \"string\" // Customer-defined task ID\n},\n\"created_at\": 1722769557708, // Task creation time, Unix timestamp, unit: ms\n\"updated_at\": 1722769557708 //Task update time, Unix timestamp, unit: ms\n}\n}\nNote 1: Video extension refers to extending the duration of text-to-video/image-to-video results. Each extension can add 4 to 5 seconds, and the model and mode used cannot be selected; they must be the same as the source video.\nNote 2: Videos that have been extended can be extended again, but the total video duration cannot exceed 3 minutes.\nRequest Header\nContent-Type\nstring\nRequired\nDefault to application/json\nData Exchange Format\nAuthorization\nstring\nRequired\nAuthentication information, refer to API authentication\nRequest Body\nvideo_id\nstring\nRequired\nVideo ID\nSupports video IDs generated by the text-to-video, the image-to-video and the video extension interface (it cannot exceed 3 minutes).\nOnly videos generated by V1.0, V1.5, and V1.6 models are supported.\nPlease note that based on the current cleanup policy, videos will be cleared 30 days after generation, and extension will not be possible.\nprompt\nstring\nOptional\nText Prompt\nCannot exceed 2500 characters\nnegative_prompt\nstring\nOptional\nNegative text prompt\nCannot exceed 2500 characters\ncfg_scale\nfloat\nOptional\nDefault to 0.5\nPrompt reference strength. The higher the value, the stronger the reference to the prompt.\nValue range: [0, 1]\nwatermark_info\nobject\nOptional\nWhether to generate watermarked results simultaneously\nDefined by the enabled parameter, format:\n\"watermark_info\": { \"enabled\": boolean }\ntrue: generate watermarked result, false: do not generate\nCustom watermarks are not currently supported\ncallback_url\nstring\nOptional",
  "Parameters": "\"task_info\":{ // Task creation parameters\n\"external_task_id\": \"string\" // Customer-defined task ID\n},\n\"created_at\": 1722769557708, // Task creation time, Unix timestamp, unit: ms\n\"updated_at\": 1722769557708 //Task update time, Unix timestamp, unit: ms\n}\n}\nNote 1: Video extension refers to extending the duration of text-to-video/image-to-video results. Each extension can add 4 to 5 seconds, and the model and mode used cannot be selected; they must be the same as the source video.\nNote 2: Videos that have been extended can be extended again, but the total video duration cannot exceed 3 minutes.\nRequest Header\nContent-Type\nstring\nRequired\nDefault to application/json\nData Exchange Format\nAuthorization\nstring\nRequired\nAuthentication information, refer to API authentication\nRequest Body\nvideo_id\nstring\nRequired\nVideo ID\nSupports video IDs generated by the text-to-video, the image-to-video and the video extension interface (it cannot exceed 3 minutes).\nOnly videos generated by V1.0, V1.5, and V1.6 models are supported.\nPlease note that based on the current cleanup policy, videos will be cleared 30 days after generation, and extension will not be possible.\nprompt\nstring\nOptional\nText Prompt\nCannot exceed 2500 characters\nnegative_prompt\nstring\nOptional\nNegative text prompt\nCannot exceed 2500 characters\ncfg_scale\nfloat\nOptional\nDefault to 0.5\nPrompt reference strength. The higher the value, the stronger the reference to the prompt.\nValue range: [0, 1]\nwatermark_info\nobject\nOptional\nWhether to generate watermarked results simultaneously\nDefined by the enabled parameter, format:\n\"watermark_info\": { \"enabled\": boolean }\ntrue: generate watermarked result, false: do not generate\nCustom watermarks are not currently supported\ncallback_url\nstring\nOptional\nThe callback notification address for the task results. If configured, the server will actively notify when the task status changes.\nFor specific message schema, see Callback Protocol\nexternal_task_id\nstring\nOptional\nCustomized Task ID\nUser-defined task ID. It will not override the system-generated task ID, but supports querying tasks by this ID\nPlease note that it must be unique for each user\nQuery Task (Single)\nGET\n/v1/videos/video-extend/{id}\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url https://api-singapore.klingai.com/v1/videos/video-extend/{task_id} \\\n--header 'Authorization: Bearer <token>'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; Specific definitions can be found in Error codes\n\"message\": \"string\", // Error information\n\"request_id\": \"string\", // Request ID, generated by the system, is used to track requests and troubleshoot problems\n\"data\": {\n\"task_id\": \"string\", // Task ID, generated by the system",
  "Callback Protocol": "For specific message schema, see Callback Protocol\nexternal_task_id\nstring\nOptional\nCustomized Task ID\nUser-defined task ID. It will not override the system-generated task ID, but supports querying tasks by this ID\nPlease note that it must be unique for each user\nQuery Task (Single)\nGET\n/v1/videos/video-extend/{id}\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url https://api-singapore.klingai.com/v1/videos/video-extend/{task_id} \\\n--header 'Authorization: Bearer <token>'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; Specific definitions can be found in Error codes\n\"message\": \"string\", // Error information\n\"request_id\": \"string\", // Request ID, generated by the system, is used to track requests and troubleshoot problems\n\"data\": {\n\"task_id\": \"string\", // Task ID, generated by the system\n\"task_status\": \"string\", // Task status, Enum values: submitted, processing, succeed, failed\n\"task_status_msg\": \"string\", // Task status information, displaying the failure reason when the task fails (such as triggering the content risk control of the platform, etc.)\n\"task_info\": {\n\"parent_video\": { //Parameters information when the task is created\n\"id\": \"string\", //Video ID before the extension；globally unique\n\"url\": \"string\", //URL for generating images(To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)\n\"duration\": \"string\" //Original video duration, unit: s (seconds)\n},\n\"external_task_id\": \"string\" // Customer-defined task ID\n},\n\"task_result\": {\n\"videos\": [\n{\n\"id\": \"string\", // Generated video ID; globally unique, will be cleared after 30 days\n\"url\": \"string\", // URL for generating videos (To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)\n\"watermark_url\": \"string\", // Watermarked video download URL, anti-leech format\n\"duration\": \"string\" //Total video duration, unit: s (seconds)\n}\n]\n},\n\"watermark_info\": {\n\"enabled\": boolean\n},\n\"final_unit_deduction\": \"string\", // The deduction units of task\n\"created_at\": 1722769557708, // Task creation time, Unix timestamp, unit: ms\n\"updated_at\": 1722769557708 //Task update time, Unix timestamp, unit: ms\n}\n}\nRequest Header\nContent-Type\nstring\nRequired\nDefault to application/json\nData Exchange Format\nAuthorization\nstring\nRequired\nAuthentication information, refer to API authentication\nPath Parameters\ntask_id\nstring\nOptional\nTask ID for Video Generation. Fill the value directly in the request path. Choose either task_id or external_task_id for querying.\nexternal_task_id\nstring\nOptional\nCustomized Task ID for Video Generation. Fill the value directly in the request path. Choose either task_id or external_task_id for querying.\nQuery Task (List)\nGET\n/v1/videos/video-extend\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url 'https://api-singapore.klingai.com/v1/videos/video-extend?pageNum=1&pageSize=30' \\"
}