메인 콘텐츠로 건너뛰기
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": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }'
import requests

url = "https://api.apimart.ai/v1/videos/generations"

payload = {
    "model": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "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: "viduq3-pro",
  prompt: "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
  duration: 8,
  resolution: "1080p",
  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":        "viduq3-pro",
        "prompt":       "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
        "duration":     8,
        "resolution":   "1080p",
        "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": "viduq3-pro",
          "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
          "duration": 8,
          "resolution": "1080p",
          "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" => "viduq3-pro",
    "prompt" => "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration" => 8,
    "resolution" => "1080p",
    "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: "viduq3-pro",
  prompt: "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
  duration: 8,
  resolution: "1080p",
  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": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "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"": ""viduq3-pro"",
            ""prompt"": ""고양이가 피아노를 치고 있다, 카메라가 천천히 줌인"",
            ""duration"": 8,
            ""resolution"": ""1080p"",
            ""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": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }'
import requests

url = "https://api.apimart.ai/v1/videos/generations"

payload = {
    "model": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "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: "viduq3-pro",
  prompt: "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
  duration: 8,
  resolution: "1080p",
  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":        "viduq3-pro",
        "prompt":       "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
        "duration":     8,
        "resolution":   "1080p",
        "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": "viduq3-pro",
          "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
          "duration": 8,
          "resolution": "1080p",
          "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" => "viduq3-pro",
    "prompt" => "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration" => 8,
    "resolution" => "1080p",
    "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: "viduq3-pro",
  prompt: "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
  duration: 8,
  resolution: "1080p",
  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": "viduq3-pro",
    "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
    "duration": 8,
    "resolution": "1080p",
    "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"": ""viduq3-pro"",
            ""prompt"": ""고양이가 피아노를 치고 있다, 카메라가 천천히 줌인"",
            ""duration"": 8,
            ""resolution"": ""1080p"",
            ""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"
  }
}

인증

Authorization
string
필수
모든 API 엔드포인트는 Bearer Token 인증이 필요합니다API 키 받기:API 키 관리 페이지에서 API 키를 받으세요요청 헤더에 추가:
Authorization: Bearer YOUR_API_KEY

요청 매개변수

model
string
필수
비디오 생성 모델 이름지원 모델:
  • viduq3-pro - Vidu Q3 Pro
  • viduq3-turbo - Vidu Q3 Turbo
prompt
string
필수
텍스트 프롬프트, 최대 2000자텍스트-비디오에서는 필수. 이미지-비디오 및 첫-끝 프레임 모드에서는 선택.예시: "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인"
duration
integer
기본값:"5"
비디오 길이 (초)범위: 1에서 16기본값: 5
resolution
string
기본값:"720p"
비디오 해상도옵션:
  • 540p - 표준 화질
  • 720p - HD (기본값)
  • 1080p - Full HD
기본값: 720p
aspect_ratio
string
비디오 화면 비율 (텍스트-비디오 모드에서만 사용 가능)옵션:
  • 16:9 - 가로
  • 9:16 - 세로
  • 4:3 - 전통형
  • 3:4 - 세로 전통형
  • 1:1 - 정사각형
이 매개변수는 텍스트-비디오 모드 (image_urls를 제공하지 않는 경우)에서만 사용할 수 있습니다.
image_urls
array<url>
이미지-비디오 생성을 위한 이미지 URL 배열시스템은 이미지 수에 따라 생성 모드를 자동으로 결정합니다:
  • 0장 (미제공): 텍스트-비디오 모드
  • 1장: 이미지-비디오 모드 (이미지를 시작 프레임으로 사용)
  • 2장: 첫-끝 프레임 모드 (첫 번째 이미지 = 첫 프레임, 두 번째 이미지 = 끝 프레임)
예시: ["https://example.com/photo.jpg"]
  • 최대 2장까지 지원
  • 첫-끝 프레임 모드에서는 정확히 2장의 이미지가 필요합니다
  • image_urls를 제공하면 (1장이든 2장이든), aspect_ratio 매개변수를 동시에 사용할 수 없습니다. 비디오 화면 비율은 이미지에서 자동으로 결정됩니다
audio
boolean
기본값:"true"
오디오 생성 여부 (대사, 효과음)기본값: true무음 비디오가 필요하면 false로 설정하세요.
seed
integer
생성 콘텐츠의 무작위성을 제어하기 위한 시드 정수범위: -1 ~ 2^32-1 사이의 정수
  • 동일한 요청에서 서로 다른 seed 값(미지정 또는 -1은 무작위 숫자가 사용됨)을 전달하면 다른 결과가 생성됩니다
  • 동일한 요청에서 같은 seed 값을 전달하면 유사한 결과가 생성되지만 완전한 일치는 보장되지 않습니다

자동 라우팅

시스템은 image_urls의 이미지 수에 따라 생성 모드를 자동으로 결정합니다:
이미지 수모드설명
0장 (미제공)텍스트-비디오텍스트 설명만으로 생성
1장이미지-비디오이미지를 시작 프레임으로 사용
2장첫-끝 프레임첫 번째 이미지 = 첫 프레임, 두 번째 이미지 = 끝 프레임

매개변수 지원 매트릭스

매개변수텍스트-비디오이미지-비디오첫-끝 프레임
model✅ 필수✅ 필수✅ 필수
prompt✅ 필수선택선택
image_urls-✅ 1장✅ 2장
duration✅ 1-16초✅ 1-16초✅ 1-16초
resolution
aspect_ratio--
audio
seed

응답

code
integer
응답 상태 코드, 성공 시 200
data
array
응답 데이터 배열

사용 시나리오

시나리오 1: 텍스트-비디오

{
  "model": "viduq3-pro",
  "prompt": "고양이가 피아노를 치고 있다, 카메라가 천천히 줌인",
  "duration": 8,
  "resolution": "1080p",
  "aspect_ratio": "16:9"
}

시나리오 2: 이미지-비디오 (단일 이미지)

{
  "model": "viduq3-pro",
  "prompt": "인물이 천천히 돌아서 미소짓는다",
  "image_urls": ["https://example.com/photo.jpg"],
  "duration": 5,
  "resolution": "720p"
}

시나리오 3: 첫-끝 프레임 비디오

{
  "model": "viduq3-pro",
  "prompt": "인물이 서 있다가 천천히 앉는다",
  "image_urls": [
    "https://example.com/first.jpg",
    "https://example.com/last.jpg"
  ],
  "duration": 8
}

시나리오 4: 오디오 끄기 (무음 비디오)

{
  "model": "viduq3-pro",
  "prompt": "일몰 해변 타임랩스 촬영",
  "duration": 10,
  "resolution": "1080p",
  "audio": false
}
작업 결과 조회비디오 생성은 비동기 작업으로, 제출 시 task_id가 반환됩니다. 작업 상태 가져오기 엔드포인트를 사용하여 생성 진행 상황과 결과를 조회할 수 있습니다.