Page cover

KLING 2

Base-Path:

https://api.hyprlab.io/v1

Video Path:

https://api.hyprlab.io/v1/video/generations
chevron-right 📌 Request Body Documentationhashtag

prompt (string, required)

  • Description: The main text input that guides the video generation.

  • Validation:

    • Must be a non-empty string.

duration (integer, optional)

  • Description: Specifies the length of the video in seconds.

  • Validation:

    • Must be either 5 or 10.

    • Defaults to 5 if not provided.

cfg_scale (number, optional)

  • Description: Controls flexibility in video generation; a lower value increases flexibility, while a higher value improves adherence to the prompt.

  • Validation:

    • Must be a number between 0 and 1.

    • Defaults to 0.5.

start_image (string, optional)

  • Description: The first frame of the video.

  • Validation:

    • Must be a string (URL, Data URI, or base64 string).

aspect_ratio (string, optional)

  • Description: Defines the aspect ratio of the video. Ignored if start_image is provided.

  • Validation:

    • Must be one of: "16:9", "1:1", or "9:16".

    • Defaults to "16:9" if not provided.

negative_prompt (string, optional)

  • Description: Specifies what should not appear in the video.

  • Validation:

    • Must be a string.


Post Request:

circle-info

When you send a POST request to create a new Video Generation, the API will return a response containing a Polling URL that can be used to check the processing status and retrieve the results.

curl https://api.hyprlab.io/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $HYPRLAB_API_KEY" \
  -d '{
    "model": "kling-v2",
    "prompt": "A cute cat playing outside.",
    "start_image": "https://site.com/path/of/image.png",
    "duration": 5,
    "cfg_scale": 0.5,
    "aspect_ratio": "16:9",
    "negative_prompt": "..to not include specific elements.",
  }'

Polling for Status:

circle-info

To check the status and retrieve the result, send a GET request to the polling URL provided in the response.

circle-info

NOTE: Video Generation took 3-4 Minutes before it finish.

Pricing Details

Model Name:
  • kling-v2

Discount:
  • 30% off

Price:
  • 5 Seconds: $1 / Video

  • 10 Seconds: $2 / Video

Last updated