{
  "Create Task": "Create Task\nPOST\n/v1/videos/avatar/image2video\ncURL\nCopy\nCollapse\ncurl --request POST \\\n--url https://api-singapore.klingai.com/v1/videos/avatar/image2video \\\n--header 'Authorization: Bearer <token>' \\\n--header 'Content-Type: application/json' \\\n--data '{\n\"image\": \"https://p1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/pink_boy.png\",\n\"sound_file\": \"https://p1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/go-to-world.mp3\",\n\"prompt\": \"While talking, excitedly shaking head, finally reaching out and making a fist, deciding to set off, hopping happily\",\n\"mode\": \"std\",\n\"external_task_id\": \"\",\n\"callback_url\": \"\"\n}'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; Specific definitions can be found in \"Error Code\"\n\"message\": \"string\", // Error information\n\"request_id\": \"string\", // Request ID, generated by the system\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}\nRequest Header\nContent-Type\nstring\nRequired\nDefault to application/json\nData Exchange Format\nAuthorization\nstring\nRequired\nAuthentication information, refer to API authentication\nRequest Body\nimage\nstring\nRequired\nAvatar Reference Image\nSupport inputting image Base64 encoding or image URL (ensure accessibility).\nBase64 Encoding Note:\nPlease note, if you use the Base64 method, make sure all image data parameters you pass are in Base64 encoding format. When using Base64, do NOT add any prefix like data:image/png;base64,. Only provide the Base64-encoded string.\nCorrect:\niVBORw0KGgoAAAANSUhEUgAAAAUA...\nIncorrect:\ndata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...\nSupported image formats: .jpg / .jpeg / .png\nImage file size ≤ 10MB, dimensions ≥ 300px, aspect ratio between 1:2.5 ~ 2.5:1\naudio_id\nstring\nOptional\nAudio ID Generated via TTS API\nOnly supports audio generated within the last 30 days, duration between 2-300 seconds\nEither audio_id or sound_file must be provided (mutually exclusive)\nsound_file\nstring\nOptional\nSound File\nSupports Base64-encoded audio or accessible audio URL\nAccepted formats: .mp3/.wav/.m4a/.aac, max 5MB, format mismatch or file too large will return error codes and other information\nDuration must be between 2-300 seconds\nEither audio_id or sound_file must be provided (mutually exclusive)\nSystem will verify audio content and return error codes if there are problems\nprompt\nstring\nOptional\nPositive text prompt\nCan be used to define avatar actions, emotions, and camera movements\nCannot exceed 2500 characters\nmode\nstring\nOptional\nDefault to std\nVideo generation mode\nEnum values：\nstd\npro\nstd: Standard Mode, cost-effective\npro: Professional Mode, higher quality video output",
  "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}\nRequest Header\nContent-Type\nstring\nRequired\nDefault to application/json\nData Exchange Format\nAuthorization\nstring\nRequired\nAuthentication information, refer to API authentication\nRequest Body\nimage\nstring\nRequired\nAvatar Reference Image\nSupport inputting image Base64 encoding or image URL (ensure accessibility).\nBase64 Encoding Note:\nPlease note, if you use the Base64 method, make sure all image data parameters you pass are in Base64 encoding format. When using Base64, do NOT add any prefix like data:image/png;base64,. Only provide the Base64-encoded string.\nCorrect:\niVBORw0KGgoAAAANSUhEUgAAAAUA...\nIncorrect:\ndata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...\nSupported image formats: .jpg / .jpeg / .png\nImage file size ≤ 10MB, dimensions ≥ 300px, aspect ratio between 1:2.5 ~ 2.5:1\naudio_id\nstring\nOptional\nAudio ID Generated via TTS API\nOnly supports audio generated within the last 30 days, duration between 2-300 seconds\nEither audio_id or sound_file must be provided (mutually exclusive)\nsound_file\nstring\nOptional\nSound File\nSupports Base64-encoded audio or accessible audio URL\nAccepted formats: .mp3/.wav/.m4a/.aac, max 5MB, format mismatch or file too large will return error codes and other information\nDuration must be between 2-300 seconds\nEither audio_id or sound_file must be provided (mutually exclusive)\nSystem will verify audio content and return error codes if there are problems\nprompt\nstring\nOptional\nPositive text prompt\nCan be used to define avatar actions, emotions, and camera movements\nCannot exceed 2500 characters\nmode\nstring\nOptional\nDefault to std\nVideo generation mode\nEnum values：\nstd\npro\nstd: Standard Mode, cost-effective\npro: Professional Mode, higher quality video output\nDifferent model versions and video modes have different support ranges. For details, see Capability Map\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 result of this task. If configured, the server will actively notify when the task status changes\nFor the specific message schema, see Callback Protocol\nexternal_task_id\nstring\nOptional\nCustomized Task ID\nWill not overwrite system-generated task ID, but can be used for task queries\nMust be unique within a single user account\nQuery Task (Single)\nGET\n/v1/videos/avatar/image2video/{id}\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url https://api-singapore.klingai.com/v1/videos/avatar/image2video/{task_id} \\",
  "Callback Protocol": "For the specific message schema, see Callback Protocol\nexternal_task_id\nstring\nOptional\nCustomized Task ID\nWill not overwrite system-generated task ID, but can be used for task queries\nMust be unique within a single user account\nQuery Task (Single)\nGET\n/v1/videos/avatar/image2video/{id}\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url https://api-singapore.klingai.com/v1/videos/avatar/image2video/{task_id} \\\n--header 'Authorization: Bearer <token>'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; Specific definitions can be found in \"Error Code\"\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\": { // Task creation parameters\n\"external_task_id\": \"string\" // Customer-defined task ID\n},\n\"task_result\": {\n\"videos\": [\n{\n\"id\": \"string\", // Generated video ID; globally unique\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 avatar, fill the value directly in the request path\nexternal_task_id\nstring\nOptional\nCustomized Task ID for avatar. 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/avatar/image2video\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url 'https://api-singapore.klingai.com/v1/videos/avatar/image2video?pageNum=1&pageSize=30' \\\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, to track requests and troubleshoot problems\n\"data\": [\n{\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\": { // Task creation parameters\n\"external_task_id\": \"string\" // Customer-defined task ID"
}