Kling 4.0 Reference to Video
統合
kling/v4/reference-to-video
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/kling/v4/reference-to-video?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/kling/v4/reference-to-video?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/kling/v4/reference-to-video", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/ja/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "kling/v4/reference-to-video",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
Doitong APIを通じてKling 4.0 Reference to Videoモデル(kling/v4/reference-to-video)を呼び出します。エージェント向けドキュメント: https://doitong.com/ja/developers/models/kling/v4/reference-to-video.md
POST https://api.doitong.com/v1/run/kling/v4/reference-to-video?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
レスポンスのステータスが"queued"または"running"の場合、"succeeded"になるまでGET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20をポーリングしてください。ファイルはoutputs[].urlにあります。同じボディでPOST https://api.doitong.com/v1/quote/kling/v4/reference-to-videoを実行すると、実行前の正確な価格が返されます。
例と同様のファイル: $1.175 1,175 APIクレジット 実行前にファイルを計測します このページで実行
新しいAPIキーです。 これは今だけ表示され、コードと下記のAPIキー欄にすでに入力されています。秘密にしてください。ブラウザで実行されるコードに決して含めないでください。
Doitongで作成
DoitongコミュニティがKling 4.0で作成した公開作品です。ワンクリックでプロンプトを再利用できます。
動画
Ultra-realistic cinematic video of a young adult woman walking naturally toward the camera while speaking, with realistic facial expressions and synchronized lip movements, as if she is promoting something to the viewer. She maintains eye contact with the camera, smiles slightly, and uses subtle...
動画
Slow, subtle push-in on the woman's face. The light from the laptop flickers softly across her eyes and cheeks, as if the blurry image on the screen is changing. Her eyes move slightly as she studies the screen, and she takes one slow, tense breath. Behind her, shadows of the snowstorm move...
動画
The enormous ancient dragon descends slowly toward the snowy cliff and lands at the cave mouth. Its huge dark leathery wings beat twice with slow, heavy strokes, sending snow swirling off the cliff in big clouds. Then it folds its wings and settles on the rock, the giant elk still held in its...
動画
**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...
動画
Authentic 1990s wide-angle film footage. The left man slowly pulls one wooden block from the Jenga tower. As the block comes out, the tower naturally loses balance and realistically collapses onto the table. Frustrated, he angrily sweeps all the fallen wooden blocks off the table with both hands....
動画
Thermal-camera view of a snowy mountain cliff at night in false-color, deep blue and violet cold rock, a huge orange-white heat shape hidden inside a rock crevice, two small bright amber spots glowing like eyes, faint noise grain. Cinematic videorealistic, ultra detailed, 16:9, volumetric light,...
動画
**Duration: 4 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...
動画
**Duration: 4 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...
動画
**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...
動画
Уютная база отдыха с деревянными домиками-шале среди сосен. Майя и Клиентка заходят в теплое кафе с панорамными окнами. Внутри деревянный интерьер, мягкие диваны и живые цветы. Они садятся за столик, перед ними стоят дымящиеся чашки чая. Мягкий свет ламп создает уют. Средний план, уровень глаз. (...
動画
**Duration: 4 seconds. Aspect ratio: 16:9.** Animate the provided image into a bright, magical, high-energy YouTube intro for a children's entertainment channel. **0–1 second:** The three girls come to life naturally, smiling and blinking. The girl on the left gently swings forward, the girl in...
動画
**Duration: 4 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...
動画
Создай короткий вертикальный юмористический мультфильм для Reels в формате 9:16. Сцена 1: Михаил Шуфутинский стоит в кадре с небольшим настольным календарём или блокнотом. На календаре крупно и хорошо читаемо написано: «2 сентября». Он смотрит на календарь и начинает петь узнаваемую фразу из...
動画
Оживи старую чёрно-белую свадебную фотографию. Молодожёны стоят рядом друг с другом. Жених нежно и с любовью смотрит на невесту, слегка улыбается и бережно касается её руки. Невеста мягко улыбается, немного поворачивает голову к жениху и смотрит на него с теплотой. Их движения естественные,...
動画
The same cute animated toddler is sitting on the soft green grass, crying with big tears after gently falling. Suddenly, his loving mother runs toward him, kneels down and gently picks him up into her arms. She hugs him tightly and comforts him, softly stroking his back. The toddler takes a deep...
動画
С днём рождения, бабушка Люба Хронометраж: ~6 минут Жанр: биографический фильм‑посвящение Музыка: мягкое фортепиано; в сценах про детство и утраты — сдержанная, щемящая мелодия; в сценах про дорогу и работу — ровный, сдержанный ритм; в сценах про кузницу — тёплый, «рукотворный» тембр; в сценах с...
リクエストを作成
コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。
/run/kling/v4/reference-to-video?wait=20
見積もり → $1.175
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/kling/v4/reference-to-video?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/kling/v4/reference-to-video?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/kling/v4/reference-to-video", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "kling/v4/reference-to-video",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
Kling 4.0 Reference to Videoについて
テキストの`prompt`に加え、参照画像、参照動画、キャラクターまたはオブジェクトの要素から動画を作成します。これらはプロンプト内で@Image1、@Video1、@Element1として参照します。長さは3~30秒(デフォルトは5)で、出力は720pまたは1080p、アスペクト比はauto、16:9、9:16、1:1、21:9に対応します。ショットごとのプロンプトには`multi_prompt`を使用します。この場合、合計の長さは各ショットの長さの合計になります。上限は画像10枚、各3~30sの動画5本、要素7個で、そのうち最大3個に音声を付けられます。
パラメータ
正式名称またはネイティブ名のいずれか一方を送信してください。両方は送信しないでください。 正式名称
prompt任意
multi_prompt任意
multi_prompt[].prompt必須
multi_prompt[].duration任意
duration任意
start_image_url任意
image
image_urls任意
images
video_urls任意
videos
elements任意
elements[].frontal_image_url任意
elements[].reference_image_urls任意
elements[].video_url任意
elements[].voice_id任意
resolution任意
aspect_ratio任意
ファイルパラメータには、公開されたhttps:// URL、10 MBまでのdata: URI、またはアップロードしたファイルのfile_urlを指定します。 ファイル
出力
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "kling/v4/reference-to-video",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 1175,
"usd": "1.175",
"charged": 1175,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"video": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_name": "0-output.mp4",
"file_size": 1843200
}
},
"outputs": [
{
"type": "video",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
"content_type": "video/mp4",
"file_size": 1843200,
"width": 1280,
"height": 720,
"duration": 5,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
出力フィールド
- video
- object {url, content_type, file_name, file_size}モデルが生成した動画。
その他のKling 4.0バリアント
その他のモデル: 参照画像から動画
AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/kling/v4/reference-to-video.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt