Graphrt

Kling AI

Text, image and omni video with Kling 4.0/3.0/2.x as polled tasks with downloads, task queries and resource packages (paid per second, callbacks node only)

Beta v0.1.0 Node.js 10 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the official Kling AI API (global host https://api-singapore.klingai.com). It generates videos with Kling 4.0, 4.0 Flash, 3.0, 3.0 Turbo, O1 and 2.x models from text, images or references, waits for each task, and saves the result to disk. It can also query tasks (to poll across workflow runs) and read your resource packages.

What it can do

  • text_to_video: prompt to video, resolution, aspect ratio, duration (Kling 4.0 up to 30 s), native audio and multi-shot where the model supports them
  • image_to_video: first, middle and last frame images (contents) to video
  • omni_video: prompt plus reference images, videos or elements (aspect ratio may be adaptive)
  • text_to_video_with_callback, image_to_video_with_callback, omni_video_with_callback (node only): the same, plus a callback_url that Kling notifies on every status change
  • get_tasks: status, outputs, usage and billing of up to 50 tasks by id (or by your external_task_id), saves the outputs of finished tasks
  • list_tasks: tasks in a time window with status / product type filters (cursor pagination)
  • get_account_costs: resource packages and their remaining quantity
  • api_request: any other endpoint (GET only for agents), e.g. image generation via a workflow node

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Text to video kling.text_to_video
  • Image to video kling.image_to_video
  • Omni video kling.omni_video
  • Text to video (callback) kling.text_to_video_with_callback
  • Image to video (callback) kling.image_to_video_with_callback
  • Omni video (callback) kling.omni_video_with_callback
  • Get tasks kling.get_tasks
  • List tasks kling.list_tasks
  • Resource packages kling.get_account_costs
  • Kling AI API request kling.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • KLING_API_KEY Required
    API key from the Kling AI developer console
  • KLING_OUTPUT_DIR Optional
    Absolute directory for generated files. Unset: nothing is saved and saved_files is [] (Kling keeps results for 30 days)

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Kling AI.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install kling
workflow.yaml
- id: clip
  type: kling.text_to_video
  model: kling-4.0
  prompt: "A man in a white shirt walks along a beach at sunset, cinematic, the camera follows from behind"
  duration: 10
  resolution: 1080p
  aspect_ratio: "16:9"
  external_task_id: "{{#start.order_id#}}"
Plugins in the docs