{
  "Create Task": "Create Task\nPOST\n/v1/images/omni-image\ncURL\nCopy\nCollapse\ncurl --request POST \\\n--url https://api-singapore.klingai.com/v1/images/omni-image \\\n--header 'Authorization: Bearer <token>' \\\n--header 'Content-Type: application/json' \\\n--data '{\n\"model_name\": \"kling-image-o1\",\n\"prompt\": \"Merge all the people in the images into the <<<object_1>>> image\",\n\"element_list\": [\n{\n\"element_id\": 829836802793406551\n}\n],\n\"image_list\": [\n{\n\"image\": \"https://v1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/multi-4.png\"\n},\n{\n\"image\": \"https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/video_effects/1.png\"\n},\n{\n\"image\": \"https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/video_effects/4.png\"\n}\n],\n\"resolution\": \"2k\",\n\"n\": 1,\n\"aspect_ratio\": \"3:2\"\n}'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error code; Specific definitions can be found in Error codes\n\"message\": \"string\", // Error message\n\"request_id\": \"string\", // Request ID, system-generated, used for tracking requests and troubleshooting\n\"data\": {\n\"task_id\": \"string\", // Task ID, system-generated\n\"task_info\": { //Task creation parameters\n\"external_task_id\": \"string\" //User-defined task ID\n},\n\"task_status\": \"string\", // Task status, Enum values: submitted, processing, succeed, failed\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\nmodel_name\nstring\nOptional\nDefault to kling-image-o1\nModel Name\nEnum values：\nkling-image-o1\nkling-v3-omni\nprompt\nstring\nRequired\nText prompt words, which can include positive and negative descriptions\nThe prompt words can be templated to meet different image generation needs\nMust not exceed 2,500 characters\nSpecify an image in the format of <<<>>>, such as <<<image_1>>>\nThe scope of abilities can be found in the user manual: KLING Omni Model User Guide\nimage_list\narray\nOptional\nReference Image List\nLoad with key:value format as follows:\n\"image_list\":[\n{ \"image\":\"image_url\" }\n]\nSupports inputting image Base64 encoding or image URL (ensure accessibility)\nSupported image formats: .jpg / .jpeg / .png\nImage file size must not exceed 10MB. Image dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1\nThe sum of reference elements and reference images must not exceed 10\nThe value of image_url parameter must not be empty",
  "Parameters": "\"task_info\": { //Task creation parameters\n\"external_task_id\": \"string\" //User-defined task ID\n},\n\"task_status\": \"string\", // Task status, Enum values: submitted, processing, succeed, failed\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\nmodel_name\nstring\nOptional\nDefault to kling-image-o1\nModel Name\nEnum values：\nkling-image-o1\nkling-v3-omni\nprompt\nstring\nRequired\nText prompt words, which can include positive and negative descriptions\nThe prompt words can be templated to meet different image generation needs\nMust not exceed 2,500 characters\nSpecify an image in the format of <<<>>>, such as <<<image_1>>>\nThe scope of abilities can be found in the user manual: KLING Omni Model User Guide\nimage_list\narray\nOptional\nReference Image List\nLoad with key:value format as follows:\n\"image_list\":[\n{ \"image\":\"image_url\" }\n]\nSupports inputting image Base64 encoding or image URL (ensure accessibility)\nSupported image formats: .jpg / .jpeg / .png\nImage file size must not exceed 10MB. Image dimensions must be at least 300px. Aspect ratio must be between 1:2.5 and 2.5:1\nThe sum of reference elements and reference images must not exceed 10\nThe value of image_url parameter must not be empty\n▾\nHide child attributes\nimage\nstring\nRequired\nImage URL or Base64 string\nelement_list\narray\nOptional\nReference Element List based on element ID configuration\nLoad with key:value format as follows:\n\"element_list\":[\n{ \"element_id\": 829836802793406551 }\n]\nThe sum of reference elements and reference images must not exceed 10\nThe support range for different model versionsvaries. For details, see Capability Map\n▾\nHide child attributes\nelement_id\nlong\nRequired\nElement ID from element library\nresolution\nstring\nOptional\nDefault to 1k\nImage generation resolution\nEnum values：\n1k\n2k\n4k\n1k: 1K standard definition\n2k: 2K high-res\n4k: 4K high-res\nThe support range for different model versionsvaries. For details, see Capability Map\nresult_type\nstring\nOptional\nDefault to single\nControl whether to generate a single image or a series of images\nEnum values：\nsingle",
  "Callback Protocol": "For the 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\nInvocation examples\nImage generation with element\ncurl --location 'https://xxx/v1/images/generations' \\\n--header 'Authorization: Bearer xxx' \\\n--header 'Content-Type: application/json' \\\n--data '{\n\"model_name\": \"kling-v3-omni\",\n\"prompt\": \"Generate a recommended cover for each subject <<element_1>> based on the style of the reference image <<image_1>>\",\n\"element_list\": [\n{\n\"element_id\": \"160\"\n},\n{\n\"element_id\": \"161\"\n}\n],\n\"image_list\": [\n{\n\"image\": \"xxx\"\n},\n{\n\"image\": \"xxx\"\n}\n],\n\"resolution\": \"2k\",\n\"result_type\": \"series\",\n\"series_amount\": 2,\n\"aspect_ratio\": \"auto\",\n\"external_task_id\": \"\",\n\"callback_url\": \"\"\n}'\nQuery Task (Single)\nGET\n/v1/images/omni-image/{id}\ncURL\nCopy\nCollapse\ncurl --request GET \\\n--url https://api-singapore.klingai.com/v1/images/omni-image/{id} \\\n--header 'Authorization: Bearer <token>' \\\n--header 'Content-Type: application/json'\n200\nCopy\nCollapse\n{\n\"code\": 0, // Error codes; specific definitions see Error codes\n\"message\": \"string\", // Error information\n\"request_id\": \"string\", // Request ID, generated by the system, for tracking and troubleshooting\n\"data\": {\n\"task_id\": \"string\", // Task ID, generated by the system\n\"task_status\": \"string\", // Task status: submitted, processing, succeed, failed\n\"task_status_msg\": \"string\", // Task status message, failure reason when task fails\n\"task_info\": { //Task creation parameters\n\"external_task_id\": \"string\" //Customer-defined task ID\n},\n\"task_result\": {\n\"result_type\": \"single\",\n\"images\": [\n{\n\"index\": 0, // Image number\n\"url\": \"string\", // URL for generated image, anti-hotlinking format (Generated images/videos will be cleared after 30 days. Please save promptly.)\n\"watermark_url\": \"string\" // Watermarked image download URL, anti-hotlinking format\n}\n],\n\"series_images\": [\n{\n\"index\": 0, // Series-image sequence number\n\"url\": \"string\", // URL for generated image, anti-hotlinking format\n\"watermark_url\": \"string\" // Watermarked image download URL\n}\n]\n},\n\"watermark_info\": { \"enabled\": boolean },\n\"final_unit_deduction\": \"string\", // Final unit deduction for the 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"
}