Kling AI icon

Kling AI

Consume Kling AI API

Actions12

Overview

This node integrates with the Kling AI API to perform various AI-powered media processing tasks, including image generation, video generation, lip sync video creation, and virtual try-on for clothing. Specifically, the Virtual Try-on - List operation retrieves a paginated list of previously created virtual try-on tasks.

Use cases include:

  • Retrieving a history or catalog of virtual try-on results for review or further processing.
  • Managing virtual try-on tasks in batch workflows.
  • Integrating virtual try-on data into fashion or e-commerce automation pipelines.

Example: You have an automated workflow that triggers after virtual try-on creations and you want to list all virtual try-ons created so far, possibly filtering by page number and size.

Properties

Name Meaning
API Token JWT token for authenticating with the Kling AI API. Must be generated as per Kling AI specifications without the "Bearer" prefix.
Additional Options Optional parameters to control pagination when listing virtual try-ons:
• Page Number (minimum 1)
• Page Size (1 to 500)

Output

The output is a JSON object containing the response from the Kling AI API's virtual try-on listing endpoint. It typically includes an array of virtual try-on task records along with metadata such as total count and pagination info.

The exact structure depends on the API but generally includes fields like:

  • Task IDs
  • Statuses
  • Creation timestamps
  • Possibly URLs or references to the generated virtual try-on images

No binary data output is produced by this operation.

Dependencies

  • Requires a valid JWT API token credential for authentication with the Kling AI API.
  • The node makes HTTPS requests to https://api.klingai.com.
  • No additional environment variables or n8n credentials are required beyond the API token input property.

Troubleshooting

  • Authentication errors (401 Unauthorized):
    Ensure the JWT token is correctly generated with the proper header and payload, does not include the "Bearer" prefix, and has not expired.

  • Empty or no response:
    If no data is returned, verify that there are existing virtual try-on tasks and that pagination parameters are correct.

  • Invalid pagination parameters:
    Page number must be ≥ 1; page size must be between 1 and 500. Invalid values may cause API errors.

  • API errors:
    The node surfaces error messages from the Kling AI API. Review the error details for issues such as rate limits, malformed requests, or server errors.

  • Continue On Fail behavior:
    If enabled, the node will return error details in the output JSON instead of stopping execution.

Links and References

  • Kling AI API Documentation (general reference): https://docs.klingai.com
  • JWT Token Generation Guidelines: Refer to Kling AI API docs for creating JWT tokens with appropriate claims.

Discussion