curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": []string{"https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"},
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "kling-v3-omni",
"prompt" => "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls" => ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode" => "std",
"duration" => 5,
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""kling-v3-omni"",
""prompt"": ""<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다"",
""image_urls"": [""https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp""],
""mode"": ""std"",
""duration"": 5,
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_xxxxxxxxxx"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수입니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인해주세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액이 부족합니다. 충전 후 다시 시도해주세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도해주세요",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "서버 내부 오류입니다. 잠시 후 다시 시도해주세요",
"type": "server_error"
}
}
Kling v3 Omni
Kling v3 Omni 비디오 생성
- 비동기 처리 모드, 후속 조회를 위한 작업 ID 반환
- 통합 텍스트-비디오/이미지-비디오 인터페이스, 이미지 참조 구문 지원
- 표준 모드(720P), 프로페셔널 모드(1080P), 4K 모드 지원
- image_N 이미지 참조 구문으로 프롬프트에서 이미지 참조
- 오디오가 포함된 비디오 생성 지원 (video_list와 배타적)
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": []string{"https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"},
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "kling-v3-omni",
"prompt" => "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls" => ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode" => "std",
"duration" => 5,
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""kling-v3-omni"",
""prompt"": ""<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다"",
""image_urls"": [""https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp""],
""mode"": ""std"",
""duration"": 5,
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_xxxxxxxxxx"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수입니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인해주세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액이 부족합니다. 충전 후 다시 시도해주세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도해주세요",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "서버 내부 오류입니다. 잠시 후 다시 시도해주세요",
"type": "server_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": []string{"https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"},
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "kling-v3-omni",
"prompt" => "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls" => ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode" => "std",
"duration" => 5,
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "kling-v3-omni",
prompt: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
image_urls: ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
mode: "std",
duration: 5,
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""kling-v3-omni"",
""prompt"": ""<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다"",
""image_urls"": [""https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp""],
""mode"": ""std"",
""duration"": 5,
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_xxxxxxxxxx"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수입니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인해주세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액이 부족합니다. 충전 후 다시 시도해주세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도해주세요",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "서버 내부 오류입니다. 잠시 후 다시 시도해주세요",
"type": "server_error"
}
}
인증
string
필수
모든 API 엔드포인트는 Bearer Token 인증이 필요합니다API 키 받기:API 키 관리 페이지에서 API 키를 받으세요요청 헤더에 추가:
Authorization: Bearer YOUR_API_KEY
요청 매개변수
string
필수
비디오 생성 모델 이름지원 모델:
kling-v3-omni- Kling v3 Omni (통합 인터페이스)
string
필수
긍정 텍스트 프롬프트
<<<image_N>>> 구문으로 image_urls의 이미지를 참조할 수 있습니다. N은 1부터 시작합니다.예시: "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다"이미지가 제공되었지만 프롬프트에
<<<image_N>>> 참조가 없는 경우, 시스템이 자동으로 프롬프트 앞에 <<<image_1>>>을 추가합니다.string
원하지 않는 콘텐츠를 제외하기 위한 네거티브 프롬프트입니다. 최대 길이는 2500자입니다.
string
기본값:"std"
생성 모드옵션:
std- 표준 모드 (720P)pro- 프로페셔널 모드 (1080P)4k- 4K 초고화질 모드
stdinteger
기본값:"5"
기본값:
5
비디오 길이 (초)값 범위: 3-15 (최소 3초, 최대 15초)⚠️ 주의: 순수한 숫자(예: 6)를 입력해야 합니다. 따옴표를 추가하면 오류가 발생합니다string
기본값:"16:9"
비디오 화면 비율옵션:
16:9- 가로9:16- 세로1:1- 정사각형
16:9array<url>
이미지 참조를 위한 이미지 URL 배열프롬프트에서
<<<image_N>>> 구문으로 해당 위치의 이미지를 참조합니다 (N은 1부터 시작)예시: ["https://example.com/photo.jpg"]- 이미지 URL은 공개적으로 접근 가능해야 하며 핫링크 보호가 없어야 합니다
- 이미지-비디오 모드에서는
aspect_ratio가 실제 이미지 비율로 대체될 수 있습니다
array<object>
역할 기반 이미지 배열이며, 이미지-비디오에서 권장됩니다.각 항목 형식:
{ "url": "...", "role": "..." }first_frame: 첫 프레임last_frame: 끝 프레임reference: 참조 이미지
image_urls 와 image_with_roles 는 둘 중 하나만 사용하세요. 동시에 전달하지 마세요.array
참조 비디오 목록(URL 방식), 최대 1개까지 지원합니다.
refer_type으로 유형을 구분합니다:base: 편집 대상 비디오(기본값)feature: 특징 참조 비디오
keep_original_sound로 원본 오디오 유지 여부를 설정합니다:no: 유지하지 않음(기본값)yes: 원본 오디오 유지
"video_list":[
{ "video_url": "video_url", "refer_type": "base", "keep_original_sound": "no" }
]
video_url은 비워둘 수 없으며, 비디오 URL은 접근 가능해야 합니다refer_type=base인 경우:- 비디오 시작/끝 프레임을 정의할 수 없습니다
- 참조 비디오는 3-10초여야 합니다
- 생성 비디오 길이는 업로드한 비디오를 따릅니다
refer_type=feature이고video_url이 비어 있지 않은 경우:image_urls에는 첫 프레임 이미지만 업로드할 수 있습니다
- 비디오 요구사항: MP4/MOV만 지원; 길이 3초 이상; 해상도 720px-2160px; 프레임레이트 24-60fps(출력은 24fps); 크기 200MB 이하
boolean
기본값:"false"
멀티 샷 분할 모드 활성화 여부.
string
분할 방식:
customize(사용자 정의) / intelligence(지능형).multi_shot=true일 때 필수입니다.array<object>
분할 리스트. 각 항목은
{ index, prompt, duration } 입니다.- 최소 1개, 최대 6개 분할
- 각 분할의
duration은 정수이며 1 이상이어야 함 - 모든 분할
duration합계는 상위duration과 같아야 함 index는 1부터 시작해 연속 증가해야 함multi_shot=true이고shot_type=customize일 때 필수
[
{ "index": 1, "prompt": "a happy dog in running@element_cat", "duration": 3 },
{ "index": 2, "prompt": "a happy dog play with a cat@element_dog", "duration": 3 }
]
array<object>
참조 주체 목록. 최대 3개 주체까지 지원합니다. 다음을 지원:설명:
name,description,element_input_urls로 즉시 생성
[
{
"name": "element_dog",
"description": "a golden retriever, fluffy fur, friendly expression",
"element_input_urls": [
"https://example.com/image1.png",
"https://example.com/image2.png"
]
},
{
"name": "element_cat",
"description": "an orange tabby cat, round face, bright eyes",
"element_input_urls": [
"https://example.com/image1.png",
"https://example.com/image2.png"
]
}
]
- 즉시 생성 시
name,description,element_input_urls필수 element_input_urls: 주체당 2~4장(1장은 정면, 나머지는 참조)prompt에서@name으로 참조 (예:"@element_dog 와 @element_cat 이 잔디에서 쫓고 놉니다")
boolean
워터마크 추가 여부
boolean
기본값:"false"
오디오가 포함된 비디오를 생성할지 여부
이 매개변수는
video_list와 서로 배타적입니다.video_list에 값이 있는 경우 audio 매개변수는 필요하지 않습니다.매개변수 상호 제약 및 경계
image_urls와image_with_roles는 둘 중 하나만 사용mode=4k는kling-v3-omni에서 사용 가능- 끝 프레임만 단독 입력(첫 프레임 없음)은 유효하지 않음
- 첫/끝 프레임과 비디오 편집은 상호 배타적:
video_list.refer_type=base(또는 미지정)일 때 첫/끝 프레임 사용 불가 video_list가 있으면audio는 무시됩니다video_list는 최대 1개multi_prompt는 최대 6개 분할,index는 1부터 연속 증가
이미지 참조 구문
Omni 모델은<<<image_N>>> 구문을 사용하여 프롬프트에서 이미지를 참조하며, 통합된 텍스트-비디오/이미지-비디오 경험을 제공합니다:
| 구문 | 설명 |
|---|---|
<<<image_1>>> | image_urls 배열의 1번째 이미지 참조 |
<<<image_2>>> | image_urls 배열의 2번째 이미지 참조 |
자동 참조:
image_urls가 제공되었지만 프롬프트에 <<<image_N>>> 참조가 없는 경우, 시스템이 자동으로 프롬프트 앞에 <<<image_1>>>을 추가합니다.응답
integer
응답 상태 코드, 성공 시 200
사용 시나리오
시나리오 1: 텍스트-비디오 (표준 모드)
{
"model": "kling-v3-omni",
"prompt": "a golden retriever running on the beach, sunset, cinematic",
"mode": "std",
"duration": 5,
"aspect_ratio": "16:9"
}
시나리오 2: 이미지 참조 (단일 이미지)
{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 인물이 카메라를 향해 손을 흔든다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "pro",
"duration": 5
}
시나리오 3: 다중 이미지 참조
{
"model": "kling-v3-omni",
"prompt": "<<<image_1>>>의 캐릭터가 <<<image_2>>>의 장면을 향해 걸어간다",
"image_urls": [
"https://example.com/character.jpg",
"https://example.com/scene.jpg"
],
"mode": "pro",
"duration": 5
}
시나리오 4: 이미지 제공 시 명시적 참조 없음 (자동 추가)
{
"model": "kling-v3-omni",
"prompt": "인물이 천천히 고개를 돌려 미소 짓는다",
"image_urls": ["https://upload.apimart.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
"mode": "std",
"duration": 5
}
시스템이 자동으로 프롬프트 앞에<<<image_1>>>을 추가하여,"<<<image_1>>>인물이 천천히 고개를 돌려 미소 짓는다"와 동일하게 됩니다.
시나리오 5: 오디오가 포함된 비디오 생성
{
"model": "kling-v3-omni",
"prompt": "나뭇가지에서 노래하는 노란 카나리아",
"audio": true,
"mode": "std",
"duration": 5
}
주의:audio와video_list는 서로 배타적입니다.video_list에 값이 있는 경우audio매개변수는 필요하지 않습니다.
작업 결과 조회비디오 생성은 비동기 작업으로, 제출 시
task_id가 반환됩니다. 작업 상태 가져오기 엔드포인트를 사용하여 생성 진행 상황과 결과를 조회할 수 있습니다.⌘I