Kling AI icon

Kling AI

Consume Kling AI API

Actions12

Overview

This node integrates with the Kling AI API to manage image generation tasks. Specifically, the Image - Get operation retrieves details about a previously submitted image generation task using its unique Task ID. This is useful for checking the status or results of an image generation request after it has been created.

Common scenarios include:

  • Polling for completion and retrieving generated images.
  • Fetching metadata or progress information about an image generation task.
  • Integrating Kling AI-generated images into automated workflows once they are ready.

Example: After submitting an image generation request, use this node operation to get the current status and download URLs of the generated images by providing the Task ID.

Properties

Name Meaning
API Token JWT token for authenticating with the Kling AI API. Must be generated with specified header and payload. Do not include "Bearer" prefix.
Task ID The unique identifier of the image generation task whose details you want to retrieve.

Output

The output is a JSON object containing the response from the Kling AI API for the requested image generation task. It typically includes:

  • Status of the image generation (e.g., pending, completed, failed).
  • Metadata about the task such as creation time, model used, prompt, etc.
  • URLs or Base64 data of the generated images if the task is complete.
  • Any error messages or additional info related to the task.

No binary data is directly output by this operation; all relevant data is provided in JSON format.

Dependencies

  • Requires access to the Kling AI API endpoint at https://api.klingai.com.
  • An API Token (JWT) must be provided for authentication.
  • No additional n8n credentials or environment variables are required beyond the API Token input property.

Troubleshooting

  • Authentication errors: If you receive a 401 Unauthorized error, verify that your JWT token is correctly formatted without the "Bearer" prefix and that it has not expired.
  • Missing Task ID: Ensure the Task ID is correctly provided and corresponds to an existing image generation task.
  • API errors: Other API errors will return messages from Kling AI. Check the message for details and ensure your request parameters are valid.
  • No response data: If no data is returned, confirm network connectivity and that the API endpoint is reachable.

If the node is set to continue on failure, errors will be included in the output JSON under an error field instead of stopping execution.

Links and References

  • Kling AI API Documentation (hypothetical link, replace with actual if available)
  • JWT Token Generation Guide (refer to Kling AI API docs for specifics on header and payload structure)

Discussion