Kling AI icon

Kling AI

Consume Kling AI API

Actions12

Overview

This node interacts with the Kling AI API to retrieve details about video generation tasks. Specifically, for the Video resource and Get operation, it fetches the status and results of a previously submitted video generation task. This is useful when you want to check the progress or obtain the output of videos generated by various Kling AI video generation methods such as Text to Video, Image to Video, Lip Sync, Video Extension, or Video Effects.

Typical use cases include:

  • Polling the API to get the status of a video generation job.
  • Retrieving the final video URL or metadata once the generation is complete.
  • Tracking tasks using either the internal Task ID or a custom External Task ID.

Example: After submitting a text-to-video generation request, you can use this node to query the task status and get the resulting video link once ready.

Properties

Name Meaning
API Token JWT token for authenticating with the Kling AI API. Must be generated with specific header and payload claims (issuer, expiration, not-before). Do not include "Bearer" prefix.
Video Type The type of video generation task to query. Options: Text to Video, Image to Video, Lip Sync, Video Extension, Video Effects.
Task ID The unique identifier of the video generation task assigned by Kling AI. Either this or External Task ID must be provided.
External Task ID A custom identifier for the task if one was specified during task creation. Used alternatively to Task ID for querying task status.

Output

The node outputs JSON data representing the response from the Kling AI API for the requested video generation task. This typically includes:

  • Task status (e.g., pending, processing, completed, failed).
  • Metadata about the video generation (model used, parameters).
  • URLs or references to the generated video files or assets.
  • Any error messages or additional information related to the task.

If the node supports binary data output (not explicitly shown here), it would represent the actual video content or related media files. However, in this case, the output is purely JSON describing the task and its results.

Dependencies

  • Requires an active internet connection to reach https://api.klingai.com.
  • Needs a valid JWT API token credential for authentication with the Kling AI API.
  • No other external dependencies are required.
  • No special environment variables or n8n credentials beyond the API token input property.

Troubleshooting

  • Authentication errors: If the node returns an authentication failure, verify that the JWT token is correctly generated according to Kling AI specifications and does not include the "Bearer" prefix.
  • Missing Task ID or External Task ID: The node requires at least one of these IDs to query a video task. Omitting both will cause an error.
  • API errors: The node surfaces API error messages returned by Kling AI. Check the message for details such as invalid parameters or rate limits.
  • No response data: If no data is returned, ensure the task ID is correct and the task exists.
  • Continue on Fail: If enabled, the node will output error details in JSON instead of stopping execution, which helps in workflows requiring fault tolerance.

Links and References

Discussion