curl --request POST \
--url https://api.looprouter.com/motion-control/{model} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"type": "image",
"url": "https://example.com/char.png"
},
{
"type": "video",
"url": "https://example.com/drive.mp4"
},
{
"type": "prompt",
"text": "the character dances energetically"
}
],
"settings": {
"character_orientation": "video",
"audio": "original",
"resolution": "720p"
}
}
'import requests
url = "https://api.looprouter.com/motion-control/{model}"
payload = {
"contents": [
{
"type": "image",
"url": "https://example.com/char.png"
},
{
"type": "video",
"url": "https://example.com/drive.mp4"
},
{
"type": "prompt",
"text": "the character dances energetically"
}
],
"settings": {
"character_orientation": "video",
"audio": "original",
"resolution": "720p"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{type: 'image', url: 'https://example.com/char.png'},
{type: 'video', url: 'https://example.com/drive.mp4'},
{type: 'prompt', text: 'the character dances energetically'}
],
settings: {character_orientation: 'video', audio: 'original', resolution: '720p'}
})
};
fetch('https://api.looprouter.com/motion-control/{model}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.looprouter.com/motion-control/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'type' => 'image',
'url' => 'https://example.com/char.png'
],
[
'type' => 'video',
'url' => 'https://example.com/drive.mp4'
],
[
'type' => 'prompt',
'text' => 'the character dances energetically'
]
],
'settings' => [
'character_orientation' => 'video',
'audio' => 'original',
'resolution' => '720p'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.looprouter.com/motion-control/{model}"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.looprouter.com/motion-control/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/motion-control/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"request_id": "<string>",
"data": {
"id": "<string>",
"status": "submitted",
"create_time": 123,
"update_time": 123,
"external_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}动作控制(可灵 3.0)
提交可灵 3.0 动作控制任务:用一段参考视频驱动图片 / 主体做出对应动作。计费模型固定 kling-3.0-motion-control(路径里的 model 仅作占位,可写 kling-3.0)。输出时长由参考 视频决定(≤30 秒),提交时按最大计费时长(30 秒)预扣、完成后按实际时长多退少补。 成片轮询 GET /tasks 获取(动作控制属视频任务,不走数字人专属查询)。
请求体支持两种形态:官方 contents[] + settings(推荐),或扁平结构(image_url / video_url / mode / character_orientation / keep_original_sound,兼容别名)。两者并存 时以 contents / settings 优先。路径可加 /v1 前缀;扁平结构还可走 POST /videos/motion-control(无路径 model)。
curl --request POST \
--url https://api.looprouter.com/motion-control/{model} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"type": "image",
"url": "https://example.com/char.png"
},
{
"type": "video",
"url": "https://example.com/drive.mp4"
},
{
"type": "prompt",
"text": "the character dances energetically"
}
],
"settings": {
"character_orientation": "video",
"audio": "original",
"resolution": "720p"
}
}
'import requests
url = "https://api.looprouter.com/motion-control/{model}"
payload = {
"contents": [
{
"type": "image",
"url": "https://example.com/char.png"
},
{
"type": "video",
"url": "https://example.com/drive.mp4"
},
{
"type": "prompt",
"text": "the character dances energetically"
}
],
"settings": {
"character_orientation": "video",
"audio": "original",
"resolution": "720p"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{type: 'image', url: 'https://example.com/char.png'},
{type: 'video', url: 'https://example.com/drive.mp4'},
{type: 'prompt', text: 'the character dances energetically'}
],
settings: {character_orientation: 'video', audio: 'original', resolution: '720p'}
})
};
fetch('https://api.looprouter.com/motion-control/{model}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.looprouter.com/motion-control/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'type' => 'image',
'url' => 'https://example.com/char.png'
],
[
'type' => 'video',
'url' => 'https://example.com/drive.mp4'
],
[
'type' => 'prompt',
'text' => 'the character dances energetically'
]
],
'settings' => [
'character_orientation' => 'video',
'audio' => 'original',
'resolution' => '720p'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.looprouter.com/motion-control/{model}"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.looprouter.com/motion-control/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/motion-control/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/char.png\"\n },\n {\n \"type\": \"video\",\n \"url\": \"https://example.com/drive.mp4\"\n },\n {\n \"type\": \"prompt\",\n \"text\": \"the character dances energetically\"\n }\n ],\n \"settings\": {\n \"character_orientation\": \"video\",\n \"audio\": \"original\",\n \"resolution\": \"720p\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"request_id": "<string>",
"data": {
"id": "<string>",
"status": "submitted",
"create_time": 123,
"update_time": 123,
"external_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}授权
LoopRouter API Key(sk- 开头),在控制台「令牌」页创建
路径参数
占位模型名,计费固定 kling-3.0-motion-control
kling-3.0, kling-3.0-motion-control 请求体
动作控制请求,支持两种形态。官方形态:contents[] + settings。扁平兼容形态:顶层 image_url / video_url / mode / character_orientation / keep_original_sound / element_list。 两者并存时以 contents / settings 优先。
官方形态素材数组(image / video / prompt / element)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
动作 / 场景描述(扁平形态)
被驱动的图片 / 主体图地址(扁平形态)
驱动动作的参考视频地址(扁平形态)
可选,引用已创建的自定义主体(扁平形态)
Show child attributes
Show child attributes
是否保留参考视频原声(扁平形态)
yes, no 主体朝向基准(扁平形态)
image, video 生成模式,映射分辨率档位(std→720p,pro→1080p)(扁平形态)
std, pro Show child attributes
Show child attributes