typetext
{
"duration": 10,
"mode": "standard",
"negative_prompt": "",
"prompt": "slow motion, the slow motionpirates struggle to keep the slow motion boat operating during a slow motion swell. Slow motion. Vibrant.",
"start_image": "https://replicate.delivery/pbxt/NtZKJvCQcUTBvgffXwHkXaLyKHfVKnm4IIluPhjo7mmuo7ai/replicate-prediction-jdj4f4t9exrma0csxc1tw2y0dw%20%281%29.jpeg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8cC**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run kwaivgi/kling-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
duration: 10,
mode: "standard",
negative_prompt: "",
prompt: "slow motion, the slow motionpirates struggle to keep the slow motion boat operating during a slow motion swell. Slow motion. Vibrant.",
start_image: "https://replicate.delivery/pbxt/NtZKJvCQcUTBvgffXwHkXaLyKHfVKnm4IIluPhjo7mmuo7ai/replicate-prediction-jdj4f4t9exrma0csxc1tw2y0dw%20%281%29.jpeg"
};
const output = await replicate.run("kwaivgi/kling-v2.1", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8cC**********************************
This is your API token. Keep it to yourself.
import replicate
Run kwaivgi/kling-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"kwaivgi/kling-v2.1",
input={
"duration": 10,
"mode": "standard",
"negative_prompt": "",
"prompt": "slow motion, the slow motionpirates struggle to keep the slow motion boat operating during a slow motion swell. Slow motion. Vibrant.",
"start_image": "https://replicate.delivery/pbxt/NtZKJvCQcUTBvgffXwHkXaLyKHfVKnm4IIluPhjo7mmuo7ai/replicate-prediction-jdj4f4t9exrma0csxc1tw2y0dw%20%281%29.jpeg"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8cC**********************************
This is your API token. Keep it to yourself.
Run kwaivgi/kling-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"duration": 10,
"mode": "standard",
"negative_prompt": "",
"prompt": "slow motion, the slow motionpirates struggle to keep the slow motion boat operating during a slow motion swell. Slow motion. Vibrant.",
"start_image": "https://replicate.delivery/pbxt/NtZKJvCQcUTBvgffXwHkXaLyKHfVKnm4IIluPhjo7mmuo7ai/replicate-prediction-jdj4f4t9exrma0csxc1tw2y0dw%20%281%29.jpeg"
}
}' \
https://api.replicate.com/v1/models/kwaivgi/kling-v2.1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "49sx8xaefsrm80csxpq92exjqc",
"model": "kwaivgi/kling-v2.1",
"version": "hidden",
"input": {
"duration": 10,
"mode": "standard",
"negative_prompt": "",
"prompt": "slow motion, the slow motionpirates struggle to keep the slow motion boat operating during a slow motion swell. Slow motion. Vibrant.",
"start_image": "https://replicate.delivery/pbxt/NtZKJvCQcUTBvgffXwHkXaLyKHfVKnm4IIluPhjo7mmuo7ai/replicate-prediction-jdj4f4t9exrma0csxc1tw2y0dw%20%281%29.jpeg"
},
"logs": "Using model: kling-v2-1 in std mode\nGenerating video...\nGenerated video in 123.3sec\nGenerated video ID: 807826016793141286\nDownloading 16528991 bytes\nDownloaded 15.76MB in 1.47sec",
"output": "https://replicate.delivery/xezq/QQFn0zSIYS6lKJaLMwVgKieHsDR1yIrExK8oHbdFMcmeRsfqA/tmpbrr60kfn.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-16T15:40:47.614Z",
"started_at": "2025-10-16T15:40:47.632616Z",
"completed_at": "2025-10-16T15:42:53.070473Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/49sx8xaefsrm80csxpq92exjqc/cancel",
"get": "https://api.replicate.com/v1/predictions/49sx8xaefsrm80csxpq92exjqc",
"stream": "https://stream.replicate.com/v1/files/bcwr-3xsizaq5g4sa4lv2yf73ctecfcytrl72lugvmtwofj33q7tefuna",
"web": "https://replicate.com/p/49sx8xaefsrm80csxpq92exjqc"
},
"metrics": {
"predict_time": 125.437857952,
"total_time": 125.456473
}
}