Input
POST https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask HTTP/1.1

Content-Type: application/json
Cache-Control: no-cache

{
    "prompt": "An enchanted forest with glowing mushrooms, fireflies, and a sparkling river flowing through the trees.",
    "negative_prompt": "nude, porn, abusive"
}
import urllib.request, json

try:
    url = "https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask"

    hdr ={
    # Request headers
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    }

    # Request body
    data =  
    data = json.dumps(data)
    req = urllib.request.Request(url, headers=hdr, data = bytes(data.encode("utf-8")))

    req.get_method = lambda: 'POST'
    response = urllib.request.urlopen(req)
    print(response.getcode())
    print(response.read())
    except Exception as e:
    print(e)
// Request body
const body = {
    "prompt": "An enchanted forest with glowing mushrooms, fireflies, and a sparkling river flowing through the trees.",
    "negative_prompt": "nude, porn, abusive"
};

fetch('https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask', {
        method: 'POST',
        body: JSON.stringify(body),
        // Request headers
        headers: {
            'Content-Type': 'application/json',
            'Cache-Control': 'no-cache',}
    })
    .then(response => {
        console.log(response.status);
        console.log(response.text());
    })
    .catch(err => console.error(err));
curl -v -X POST "https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask" -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data-raw "{
    \"prompt\": \"An enchanted forest with glowing mushrooms, fireflies, and a sparkling river flowing through the trees.\",
    \"negative_prompt\": \"nude, porn, abusive\"
}"
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.io.UnsupportedEncodingException;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.FileInputStream;

public class HelloWorld {

  public static void main(String[] args) {
    try {
        String urlString = "https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask";
        URL url = new URL(urlString);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();

        //Request headers
    connection.setRequestProperty("Content-Type", "application/json");
    
    connection.setRequestProperty("Cache-Control", "no-cache");
    
        connection.setRequestMethod("POST");

        // Request body
        connection.setDoOutput(true);
        connection
            .getOutputStream()
            .write(
             "{ \"prompt\": \"An enchanted forest with glowing mushrooms, fireflies, and a sparkling river flowing through the trees.\", \"negative_prompt\": \"nude, porn, abusive\" }".getBytes()
             );
    
        int status = connection.getResponseCode();
        System.out.println(status);

        BufferedReader in = new BufferedReader(
            new InputStreamReader(connection.getInputStream())
        );
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        System.out.println(content);

        connection.disconnect();
    } catch (Exception ex) {
      System.out.print("exception:" + ex.getMessage());
    }
  }
}
$url = "https://gateway.appypie.com/kling-ai-video/v1/generateVideoTask";
$curl = curl_init($url);

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

# Request headers
$headers = array(
    'Content-Type: application/json',
    'Cache-Control: no-cache',);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

# Request body
$request_body = '{
    "prompt": "An enchanted forest with glowing mushrooms, fireflies, and a sparkling river flowing through the trees.",
    "negative_prompt": "nude, porn, abusive"
}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_body);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
Output

Kling AI Video Generator: Turn Your Text into Engaging Videos

meta

The Kling AI Video Generator is an advanced tool designed to transform simple text prompts into stunning, high-quality videos, making it a game-changer for content creators, marketers, and developers. This innovative tool takes the hassle out of video production, allowing users to effortlessly create captivating visual content that resonates with audiences. With its ability to convert ideas into immersive videos, the Kling AI Video Generator has become an indispensable asset for social media campaigns, product promotions, and digital storytelling. Whether you're looking to create visually striking short-form videos, dynamic marketing materials, or engaging storytelling visuals, this tool empowers you to stand out in an increasingly visual digital landscape.

Powered by advanced AI technology, the Kling AI Video Generator delivers professional-grade videos in minutes, streamlining content creation for a variety of needs. From product showcases to interactive learning materials, this versatile tool ensures brands, educators, and businesses can leverage the potential of text-to-video technology with ease. Its seamless integration with websites and apps allows for customized content generation tailored to specific requirements. By utilizing the Kling AI Video Generator API, you can elevate your content strategy, boost engagement, and create unforgettable video experiences that leave a lasting impression on your audience.

Pricing

This Video generation model is priced by monthly plan.

Basic$19/month

  • 200 API calls/month
  • Personalized API key
  • API Documentation
  • Personalized support
  • Cancel anytime

Standard$49/month

  • 400 API calls/month
  • $0.3 per API calls after exceeding the monthly limit.
  • Personalized API key
  • API Documentation
  • Personalized support
  • Cancel anytime

Pro$99/month

  • 750 API calls/month
  • $0.2 per API calls after exceeding the monthly limit.
  • Personalized API key
  • API Documentation
  • Personalized support
  • Cancel anytime

How to Generate Videos Using the Kling AI (T2V) API

generate_01

Get Access to the Kling AI API

To get started, sign up on the Appy Pie API to access the API. Once registered, you will receive an API key for authentication. This key is essential for unlocking features such as text-to-video generation and creating immersive, high-quality video content tailored to your requirements.

generate_02

Set Up Environment and Configure Parameters

Select your preferred programming language, such as Python or JavaScript, and configure your development environment to handle HTTP requests. Install any necessary libraries or tools for API integration. Customize the API parameters by defining your text prompt, and other settings to achieve your desired video output.

generate_04

Send Your API Request

Using the chosen programming language, create an HTTP request to the Kling AI API endpoint. Include the API key, your text prompt, and the customized parameters from the previous step. This request will be sent to the API for processing, generating video content based on your input.

generate_03

Handle the Response

Once the API processes your request, it will return a response containing the generated video or a URL to access it. Download and save the video for your project. You can embed the video in digital platforms, share it on social media, or use it in campaigns and presentations to captivate your audience.

Use Cases of Kling AI Text to Video API

cases_1

Enhancing Social Media Engagement

The Kling AI Text-to-Video API allows brands to create eye-catching, high-quality videos from simple text prompts. Perfect for reels, stories, and posts, this tool helps businesses captivate audiences, increase likes and shares, and boost overall engagement on social media platforms, ensuring your content stands out in a crowded digital landscape.

cases_2

Creating Compelling Digital Storytelling

With the Kling AI T2V API, writers and creators can bring narratives to life through immersive video content. Ideal for blogs, articles, or multimedia projects, this API transforms text-based stories into visually engaging formats, adding depth to storytelling and enhancing audience interaction with captivating visuals.

cases_3

Transforming E-commerce Product Showcases

The Kling AI Text-to-Video API revolutionizes product marketing by generating dynamic videos that highlight key features and benefits. Perfect for e-commerce platforms, this tool enables businesses to create engaging product showcases that enhance customer experience and drive higher conversions by providing a more interactive shopping experience.

cases_4

Elevating Educational Content

Educators and trainers can use the Kling AI T2V API to transform instructional text into engaging video lessons. Ideal for online courses, tutorials, and corporate training, this tool simplifies complex concepts through visual storytelling, making learning interactive, impactful, and more accessible to visual learners.

cases_5

Boosting Website and App Interactivity

The Kling AI T2V API enhances digital platforms by adding dynamic video elements to websites and apps. Perfect for landing pages, onboarding flows, or interactive features, this API ensures a seamless user experience that keeps visitors engaged and encourages longer interaction times.

cases_6

Amplifying Event Promotions

With the Kling AI T2V API, brands can create visually stunning videos to promote events and generate excitement. From highlighting event details to building anticipation, this tool helps businesses craft memorable marketing campaigns, ensuring increased attendance and lasting impressions among their target audience.

Top Trending Generative AI APIs

 

Maximize the potential of your projects with our Generative AI APIs. From video generation & image creation to text generation, animation, 3D modeling, prompt generation, image restoration, and code generation, our advanced APIs cover all aspects of generative AI to meet your needs.