> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vidu Q3(mix/standard) 참조 이미지-투-비디오

>  - 비동기 처리 모드, 후속 조회를 위한 작업 ID 반환
- 1-7장의 참조 이미지 + 텍스트 프롬프트를 업로드하여 참조 주체를 포함한 짧은 비디오 생성
- 540p / 720p / 1080p 해상도 지원
- 길이 범위 1-16초, 캐릭터 일관성 및 스타일 연속에 적합 

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "viduq3",
      "prompt": "호숫가에서 산타클로스와 곰이 포옹하고 있다",
      "image_urls": [
        "https://example.com/santa.png",
        "https://example.com/bear.png"
      ],
      "duration": 8,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    }'
  ```

  ```python Python theme={null}
  import requests

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

  payload = {
      "model": "viduq3",
      "prompt": "호숫가에서 산타클로스와 곰이 포옹하고 있다",
      "image_urls": [
          "https://example.com/santa.png",
          "https://example.com/bear.png"
      ],
      "duration": 8,
      "resolution": "720p",
      "aspect_ratio": "16:9"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "viduq3",
    prompt: "호숫가에서 산타클로스와 곰이 포옹하고 있다",
    image_urls: [
      "https://example.com/santa.png",
      "https://example.com/bear.png"
    ],
    duration: 8,
    resolution: "720p",
    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));
  ```

  ```go Go theme={null}
  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",
          "prompt":       "호숫가에서 산타클로스와 곰이 포옹하고 있다",
          "image_urls":   []string{"https://example.com/santa.png", "https://example.com/bear.png"},
          "duration":     8,
          "resolution":   "720p",
          "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))
  }
  ```

  ```java Java theme={null}
  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",
            "prompt": "호숫가에서 산타클로스와 곰이 포옹하고 있다",
            "image_urls": [
              "https://example.com/santa.png",
              "https://example.com/bear.png"
            ],
            "duration": 8,
            "resolution": "720p",
            "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 PHP theme={null}
  <?php

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

  $payload = [
      "model" => "viduq3",
      "prompt" => "호숫가에서 산타클로스와 곰이 포옹하고 있다",
      "image_urls" => [
          "https://example.com/santa.png",
          "https://example.com/bear.png"
      ],
      "duration" => 8,
      "resolution" => "720p",
      "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;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

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

  payload = {
    model: "viduq3",
    prompt: "호숫가에서 산타클로스와 곰이 포옹하고 있다",
    image_urls: [
      "https://example.com/santa.png",
      "https://example.com/bear.png"
    ],
    duration: 8,
    resolution: "720p",
    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
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!

  let payload: [String: Any] = [
      "model": "viduq3",
      "prompt": "호숫가에서 산타클로스와 곰이 포옹하고 있다",
      "image_urls": [
          "https://example.com/santa.png",
          "https://example.com/bear.png"
      ],
      "duration": 8,
      "resolution": "720p",
      "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()
  ```

  ```csharp C# theme={null}
  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"",
              ""prompt"": ""호숫가에서 산타클로스와 곰이 포옹하고 있다"",
              ""image_urls"": [
                  ""https://example.com/santa.png"",
                  ""https://example.com/bear.png""
              ],
              ""duration"": 8,
              ""resolution"": ""720p"",
              ""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);
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_xxxxxxxxxx"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "잘못된 요청 매개변수입니다",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "인증에 실패했습니다. API 키를 확인해주세요",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "잔액이 부족합니다. 충전 후 다시 시도해주세요",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "요청이 너무 많습니다. 잠시 후 다시 시도해주세요",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "서버 내부 오류입니다. 잠시 후 다시 시도해주세요",
      "type": "server_error"
    }
  }
  ```
</ResponseExample>

## 인증

<ParamField header="Authorization" type="string" required>
  모든 API 엔드포인트는 Bearer Token 인증이 필요합니다

  API 키 받기:

  [API 키 관리 페이지](https://apimart.ai/keys)에서 API 키를 받으세요

  요청 헤더에 추가:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## 요청 매개변수

<ParamField body="model" type="string" required>
  비디오 생성 모델 이름

  지원 모델:

  * `viduq3-mix` - 종합 화질왕, 스마트 전환 더 강력, 1초 짧은 비디오 지원
  * `viduq3` - 기본 추천, 카메라 전환이 더 스마트

  <Note>
    **선택 방법**: 일상적인 사용에는 `viduq3`, 고화질이나 1-2초 모션 이펙트에는 `viduq3-mix`를 사용하세요.
  </Note>
</ParamField>

<ParamField body="prompt" type="string" required>
  텍스트 프롬프트, 최대 **5000자**

  동작과 카메라 움직임을 설명하고, 외모는 설명하지 마세요 (외모는 참조 이미지에서 결정됩니다).

  예시: `"호숫가에서 산타클로스와 곰이 포옹하고 있다"`
</ParamField>

<ParamField body="image_urls" type="array<url>" required>
  참조 이미지 URL 배열, **1-7장**

  공개 접근 가능한 이미지 URL (http\:// 또는 https\://) 지원

  예시: `["https://example.com/santa.png", "https://example.com/bear.png"]`

  <Warning>
    * 수량: **1-7장**
    * 지원 형식: PNG, JPEG, JPG, WebP
    * 최소 크기: 128×128
    * 화면 비율: 1:4 \~ 4:1 범위
    * 개당 크기: ≤ 50MB
    * 공개 접근 가능한 URL이어야 합니다
  </Warning>
</ParamField>

<ParamField body="duration" type="integer" default="5">
  비디오 길이 (초)

  * `viduq3-mix`: `1`에서 `16`
  * `viduq3`: `3`에서 `16`

  기본값: `5`

  <Warning>
    `viduq3`는 최소 3초, `viduq3-mix`는 최소 1초를 지원합니다. 선택한 모델에 따라 유효한 길이를 전달해주세요.
  </Warning>
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  비디오 해상도

  * `viduq3-mix`: `720p` (기본값) / `1080p`
  * `viduq3`: `540p` / `720p` (기본값) / `1080p`

  <Warning>
    `viduq3-mix`는 `540p`를 지원하지 않습니다. `720p` 또는 `1080p`를 사용해주세요.
  </Warning>
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  비디오 화면 비율

  옵션:

  * `16:9` - 가로 (기본값)
  * `9:16` - 세로
  * `4:3` - 전통형
  * `3:4` - 세로 전통형
  * `1:1` - 정사각형
</ParamField>

<ParamField body="seed" type="integer">
  생성 랜덤성을 제어하는 랜덤 시드

  미지정 시 랜덤으로 생성됩니다.

  <Note>
    동일한 매개변수에서 동일한 seed 값을 사용하면 유사한 결과가 생성되지만, 완전히 동일하다는 보장은 없습니다.
  </Note>
</ParamField>

## 모델 비교

| 특징       | `viduq3`            | `viduq3-mix`     |
| -------- | ------------------- | ---------------- |
| 추천 시나리오  | 일상 사용, 멀티 앵글 카메라 전환 | 고화질, 1-2초 모션 이펙트 |
| 길이 범위    | 3-16초               | 1-16초            |
| 해상도      | 540p / 720p / 1080p | 720p / 1080p     |
| 참조 이미지 수 | 1-7장                | 1-7장             |

## 응답

<ResponseField name="code" type="integer">
  응답 상태 코드, 성공 시 200
</ResponseField>

<ResponseField name="data" type="array">
  응답 데이터 배열

  <Expandable title="배열 요소">
    <ResponseField name="status" type="string">
      작업 상태, 초기 제출 시 `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      작업 고유 식별자, 작업 상태 및 결과 조회에 사용
    </ResponseField>
  </Expandable>
</ResponseField>

## 사용 시나리오

### 시나리오 1: viduq3 기본 참조 이미지-투-비디오

```json theme={null}
{
  "model": "viduq3",
  "prompt": "호숫가에서 산타클로스와 곰이 포옹하고 있다",
  "image_urls": [
    "https://example.com/santa.png",
    "https://example.com/bear.png"
  ]
}
```

### 시나리오 2: viduq3-mix 고화질 참조 이미지-투-비디오

```json theme={null}
{
  "model": "viduq3-mix",
  "prompt": "참조 이미지 속 고양이가 사이버펑크 네온 거리를 걷는다",
  "image_urls": [
    "https://example.com/cat-1.png",
    "https://example.com/cat-2.png",
    "https://example.com/cat-3.png"
  ],
  "duration": 8,
  "resolution": "1080p",
  "aspect_ratio": "16:9",
  "seed": 42
}
```

<Note>
  **작업 결과 조회**

  비디오 생성은 비동기 작업으로, 제출 시 `task_id`가 반환됩니다. [작업 상태 가져오기](/ko/api-reference/tasks/status) 엔드포인트를 사용하여 생성 진행 상황과 결과를 조회할 수 있습니다.
</Note>
