Omni 多模态生成(可灵 3.0)
curl --request POST \
--url https://api.looprouter.com/omni-video/{model} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "让参考图中的角色在城市夜景中行走,参考该视频的运镜",
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
"audio": "original"
},
"options": {
"external_task_id": "my-biz-001"
},
"contents": [
{
"type": "refer_image",
"url": "https://example.com/character.jpg"
},
{
"type": "feature_video",
"url": "https://example.com/motion.mp4"
}
]
}
'import requests
url = "https://api.looprouter.com/omni-video/{model}"
payload = {
"prompt": "让参考图中的角色在城市夜景中行走,参考该视频的运镜",
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
"audio": "original"
},
"options": { "external_task_id": "my-biz-001" },
"contents": [
{
"type": "refer_image",
"url": "https://example.com/character.jpg"
},
{
"type": "feature_video",
"url": "https://example.com/motion.mp4"
}
]
}
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({
prompt: '让参考图中的角色在城市夜景中行走,参考该视频的运镜',
settings: {resolution: '1080p', aspect_ratio: '16:9', duration: 5, audio: 'original'},
options: {external_task_id: 'my-biz-001'},
contents: [
{type: 'refer_image', url: 'https://example.com/character.jpg'},
{type: 'feature_video', url: 'https://example.com/motion.mp4'}
]
})
};
fetch('https://api.looprouter.com/omni-video/{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/omni-video/{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([
'prompt' => '让参考图中的角色在城市夜景中行走,参考该视频的运镜',
'settings' => [
'resolution' => '1080p',
'aspect_ratio' => '16:9',
'duration' => 5,
'audio' => 'original'
],
'options' => [
'external_task_id' => 'my-biz-001'
],
'contents' => [
[
'type' => 'refer_image',
'url' => 'https://example.com/character.jpg'
],
[
'type' => 'feature_video',
'url' => 'https://example.com/motion.mp4'
]
]
]),
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/omni-video/{model}"
payload := strings.NewReader("{\n \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\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/omni-video/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/omni-video/{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 \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\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"
}
}可灵系列
Omni 多模态生成(可灵 3.0)
提交可灵 3.0 Omni 多模态任务。contents 可组合 refer_image / feature_video / base_video / element;网关按顺序把素材绑定进提示词。模型名固定 kling-3.0-omni。
POST
/
omni-video
/
{model}
Omni 多模态生成(可灵 3.0)
curl --request POST \
--url https://api.looprouter.com/omni-video/{model} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "让参考图中的角色在城市夜景中行走,参考该视频的运镜",
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
"audio": "original"
},
"options": {
"external_task_id": "my-biz-001"
},
"contents": [
{
"type": "refer_image",
"url": "https://example.com/character.jpg"
},
{
"type": "feature_video",
"url": "https://example.com/motion.mp4"
}
]
}
'import requests
url = "https://api.looprouter.com/omni-video/{model}"
payload = {
"prompt": "让参考图中的角色在城市夜景中行走,参考该视频的运镜",
"settings": {
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
"audio": "original"
},
"options": { "external_task_id": "my-biz-001" },
"contents": [
{
"type": "refer_image",
"url": "https://example.com/character.jpg"
},
{
"type": "feature_video",
"url": "https://example.com/motion.mp4"
}
]
}
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({
prompt: '让参考图中的角色在城市夜景中行走,参考该视频的运镜',
settings: {resolution: '1080p', aspect_ratio: '16:9', duration: 5, audio: 'original'},
options: {external_task_id: 'my-biz-001'},
contents: [
{type: 'refer_image', url: 'https://example.com/character.jpg'},
{type: 'feature_video', url: 'https://example.com/motion.mp4'}
]
})
};
fetch('https://api.looprouter.com/omni-video/{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/omni-video/{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([
'prompt' => '让参考图中的角色在城市夜景中行走,参考该视频的运镜',
'settings' => [
'resolution' => '1080p',
'aspect_ratio' => '16:9',
'duration' => 5,
'audio' => 'original'
],
'options' => [
'external_task_id' => 'my-biz-001'
],
'contents' => [
[
'type' => 'refer_image',
'url' => 'https://example.com/character.jpg'
],
[
'type' => 'feature_video',
'url' => 'https://example.com/motion.mp4'
]
]
]),
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/omni-video/{model}"
payload := strings.NewReader("{\n \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\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/omni-video/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/omni-video/{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 \"prompt\": \"让参考图中的角色在城市夜景中行走,参考该视频的运镜\",\n \"settings\": {\n \"resolution\": \"1080p\",\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"audio\": \"original\"\n },\n \"options\": {\n \"external_task_id\": \"my-biz-001\"\n },\n \"contents\": [\n {\n \"type\": \"refer_image\",\n \"url\": \"https://example.com/character.jpg\"\n },\n {\n \"type\": \"feature_video\",\n \"url\": \"https://example.com/motion.mp4\"\n }\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- 开头),在控制台「令牌」页创建
路径参数
可灵 3.0 Omni 模型名
可用选项:
kling-3.0-omni 请求体
application/json