Kling AI icon

Kling AI

Consume Kling AI API

Actions12

Overview

This node integrates with the Kling AI API to list video generation tasks of various types. It allows users to retrieve paginated lists of videos generated by different video generation methods such as Text to Video, Image to Video, Lip Sync, Video Extension, and Video Effects.

Common scenarios include:

  • Managing and reviewing batches of generated videos.
  • Fetching metadata or status for multiple video generation tasks.
  • Integrating video generation workflows where you need to process or analyze lists of generated videos.

For example, a user might want to list all "Text to Video" generation tasks on page 2 with 50 results per page to monitor progress or gather results for further processing.

Properties

Name Meaning
API Token JWT token for authenticating with the Kling AI API. Must be generated with specific header and payload; do not include "Bearer" prefix.
Video Type The category/type of video generation to list. Options: Text to Video, Image to Video, Lip Sync, Video Extension, Video Effects.
Additional Options Optional parameters to control pagination:
• Page Number: Which page of results to retrieve (minimum 1).
• Page Size: Number of results per page (1 to 500).

Output

The node outputs a JSON object containing the response from the Kling AI API listing endpoint for the selected video type. This typically includes an array of video generation task objects with their metadata such as IDs, statuses, timestamps, and other relevant details depending on the video type.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "videos": [
    {
      "id": "string",
      "status": "string",
      "created_at": "timestamp",
      "type": "text2video",
      ...
    },
    ...
  ],
  "pageNum": 1,
  "pageSize": 30,
  "totalCount": 100
}

Dependencies

  • Requires access to the Kling AI API endpoint at https://api.klingai.com.
  • Requires a valid JWT API token credential for authentication.
  • No additional external dependencies are needed.
  • Network connectivity to the Kling AI API must be available.

Troubleshooting

  • Authentication errors (401 Unauthorized):
    Ensure the provided API Token is a valid JWT formatted according to Kling AI specifications without the "Bearer" prefix. Tokens must have correct header and payload claims (iss, exp, nbf).

  • Empty or no response:
    Verify network connectivity and that the API endpoint is reachable. Also check if the requested page number and size are within valid ranges.

  • Invalid parameter errors:
    Confirm that the Video Type is one of the supported options and that pagination values are positive integers within allowed limits.

  • API rate limits or server errors:
    If the API returns errors related to rate limiting or internal issues, consider retrying after some delay or contacting Kling AI support.

  • Continue On Fail behavior:
    If enabled, the node will return error details in the output JSON instead of stopping execution, allowing workflows to handle errors gracefully.

Links and References

  • Kling AI API Documentation (general reference): https://docs.klingai.com/
  • JWT Token Generation Guidelines: Refer to Kling AI API docs for required JWT header and payload format.

Discussion