The Kling 3.0 series models API is now fully available
Learn More

Callback Protocol


As for the Async task(image generation / video generation / virtual try-on),if you actively set the callback_url when you Create Task, the server will actively notify you when the task status changes, and the protocol is as follows:

{
  "task_id": "string",               // Task ID, generated by the system
  "task_status": "string",           // Task status, Enum values: submitted, processing, succeed, failed
  "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.)
  "created_at": 1722769557708,       // Task creation time, Unix timestamp, unit ms
  "updated_at": 1722769557708,       // Task update time, Unix timestamp, unit ms
  "final_unit_deduction": "string",   // The deduction units of task
  "task_info": {                     // Task creation parameters. Detailed information provided by the user during task creation.
    "parent_video": {
      "id": "string",                // Generated video ID; globally unique
      "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.)
      "duration": "string"           // Total duration of the video before continuation, in s
    },
    "external_task_id": "string"     // Customer-defined task ID
  },
  "task_result": {
    "images": [                      // The result of image-related tasks
      {
        "index": int,                // Image Number
        "url": "string"              // URL for generating images, such as: https://h1.inkwai.com/bs2/upload-ylab-stunt/xxx.png (To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)
      }
    ],
    "videos": [                      // The result of video-related tasks
      {
        "id": "string",              // Generated video ID; globally unique
        "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.)
        "duration": "string"         // Total video duration, unit: s (seconds)
      }
    ]
  }
}