> ## 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.

# wan2.5-preview 비디오 생성

>  - 만상 2.5 프리뷰 비디오 생성 모델
- 텍스트-비디오 (Text-to-Video) 및 이미지-비디오 (Image-to-Video) 지원
- 480p/720p/1080p 해상도, 5 또는 10초 길이 지원
- 프롬프트 자동 확장, 자동 오디오, 사용자 지정 오디오 지원 

<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": "wan2.5-preview",
      "prompt": "석양 아래 해변 도로, 영화같은 촬영",
      "size": "16:9",
      "resolution": "720p",
      "duration": 5
    }'
  ```

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

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

  payload = {
      "model": "wan2.5-preview",
      "prompt": "석양 아래 해변 도로, 영화같은 촬영",
      "size": "16:9",
      "resolution": "720p",
      "duration": 5
  }

  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: "wan2.5-preview",
    prompt: "석양 아래 해변 도로, 영화같은 촬영",
    size: "16:9",
    resolution: "720p",
    duration: 5
  };

  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":      "wan2.5-preview",
          "prompt":     "석양 아래 해변 도로, 영화같은 촬영",
          "size":       "16:9",
          "resolution": "720p",
          "duration":   5,
      }

      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": "wan2.5-preview",
            "prompt": "석양 아래 해변 도로, 영화같은 촬영",
            "size": "16:9",
            "resolution": "720p",
            "duration": 5
          }
          """;

          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" => "wan2.5-preview",
      "prompt" => "석양 아래 해변 도로, 영화같은 촬영",
      "size" => "16:9",
      "resolution" => "720p",
      "duration" => 5
  ];

  $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: "wan2.5-preview",
    prompt: "석양 아래 해변 도로, 영화같은 촬영",
    size: "16:9",
    resolution: "720p",
    duration: 5
  }

  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": "wan2.5-preview",
      "prompt": "석양 아래 해변 도로, 영화같은 촬영",
      "size": "16:9",
      "resolution": "720p",
      "duration": 5
  ]

  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"": ""wan2.5-preview"",
              ""prompt"": ""석양 아래 해변 도로, 영화같은 촬영"",
              ""size"": ""16:9"",
              ""resolution"": ""720p"",
              ""duration"": 5
          }";

          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_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
      }
    ]
  }
  ```

  ```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>
  모든 엔드포인트는 Bearer Token 인증이 필요합니다

  API Key 발급:

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

  요청 헤더에 추가:

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

## 요청 매개변수

<ParamField body="model" type="string" required>
  비디오 생성 모델 이름, `wan2.5-preview` 고정
</ParamField>

<ParamField body="prompt" type="string">
  비디오 내용 설명

  텍스트-비디오(`image_urls` 없음)의 경우 **필수**, 이미지-비디오의 경우 선택 사항이지만 권장

  장면, 동작, 스타일 등을 자세히 설명하세요

  예시: `"석양 아래 해변 도로, 영화같은 촬영"`
</ParamField>

<ParamField body="image_urls" type="array<string>">
  참조 이미지 URL 배열 (1장만 지원)

  이미지-비디오 모드에서 필수, 공개 접근 가능한 이미지 URL 또는 Base64 인코딩(`data:image/png;base64,...`) 지원

  예시: `["https://example.com/image.jpg"]`

  <Note>
    `image_urls` 포함 여부에 따라 텍스트-비디오 또는 이미지-비디오 모드가 자동 선택됩니다. 텍스트-비디오 모드에서는 `image_urls`를 **전달하지 마세요**.
  </Note>
</ParamField>

<ParamField body="negative_prompt" type="string">
  부정 프롬프트, 원하지 않는 내용을 설명

  최대 500자

  예시: `"흐림, 저품질, 변형"`
</ParamField>

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

  옵션:

  * `480p` - SD, 지원 size: `16:9`, `9:16`, `1:1`
  * `720p` - HD (기본값), 지원 size: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`
  * `1080p` - FHD, 지원 size: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`

  기본값: `720p`

  <Note>
    해상도는 가격에 직접 영향을 미칩니다: 1080p > 720p > 480p.
  </Note>

  <Warning>
    480p는 `16:9`, `9:16`, `1:1` 비율만 지원합니다. `4:3` 또는 `3:4`를 전달하면 오류가 발생합니다.
  </Warning>
</ParamField>

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

  `5` 또는 `10`초만 지원

  기본값: `5`
</ParamField>

<ParamField body="size" type="string" default="16:9">
  화면 비율, **텍스트-비디오**(`image_urls` 없음)에서만 유효

  `resolution`에 따라 옵션이 다릅니다:

  **480p:**

  * `16:9` - 가로 (기본값)
  * `9:16` - 세로
  * `1:1` - 정사각형

  **720p / 1080p:**

  * `16:9` - 가로 (기본값)
  * `9:16` - 세로
  * `1:1` - 정사각형
  * `4:3` - 가로
  * `3:4` - 세로

  기본값: `16:9`

  <Warning>
    이미지-비디오의 화면 비율은 입력 이미지에 의해 결정됩니다. `size`를 **전달하지 마세요**, 오류가 발생합니다.
  </Warning>
</ParamField>

<ParamField body="seed" type="integer">
  랜덤 시드(≥0), 동일한 시드를 지정하면 유사한 결과를 재현할 수 있습니다

  예시: `12345`
</ParamField>

<ParamField body="prompt_extend" type="boolean" default="true">
  스마트 프롬프트 재작성 활성화 여부

  짧은 프롬프트의 효과를 크게 향상시키지만 처리 시간이 증가합니다

  기본값: `true`
</ParamField>

<ParamField body="audio" type="boolean" default="true">
  오디오 자동 추가 여부

  활성화하면 비디오에 맞는 오디오가 자동 생성됩니다

  기본값: `true`

  <Warning>
    이 모델은 `audio=true`만 지원합니다. `false`로 설정하여 무음 비디오를 생성하는 것은 지원되지 않습니다.
  </Warning>
</ParamField>

<ParamField body="audio_url" type="string">
  사용자 지정 오디오 URL (wav/mp3, 3-30초, ≤ 15MB)

  오디오가 비디오보다 길면 자동으로 잘립니다. 짧으면 나머지 부분은 무음이 됩니다

  <Warning>
    오디오 파일 요구사항:

    * 형식: wav, mp3
    * 길이: 3-30초
    * 크기: ≤ 15MB
  </Warning>
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  "AI 생성" 워터마크 추가 여부 (우측 하단)

  기본값: `false`
</ParamField>

## 해상도와 화면 비율 조합

`size`와 `resolution` 조합은 업스트림 픽셀 크기에 매핑됩니다 (**텍스트-비디오에서만 유효**):

| 화면 비율  | 설명       | 480p 크기 | 720p 크기  | 1080p 크기  |
| ------ | -------- | ------- | -------- | --------- |
| `16:9` | 가로 (기본값) | 832×480 | 1280×720 | 1920×1080 |
| `9:16` | 세로       | 480×832 | 720×1280 | 1080×1920 |
| `1:1`  | 정사각형     | 624×624 | 960×960  | 1440×1440 |
| `4:3`  | 가로       | -       | 1088×832 | 1632×1248 |
| `3:4`  | 세로       | -       | 832×1088 | 1248×1632 |

<Note>
  480p는 `16:9`, `9:16`, `1:1` 비율만 지원합니다. `4:3` 또는 `3:4`를 전달하면 오류가 발생합니다. 720p와 1080p는 5가지 비율 모두 지원합니다.
</Note>

## 응답

<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: 텍스트-비디오 (간단)

```json theme={null}
{
  "model": "wan2.5-preview",
  "prompt": "석양 아래 해변 도로, 영화같은 촬영"
}
```

### 시나리오 2: 텍스트-비디오 (전체 매개변수)

```json theme={null}
{
  "model": "wan2.5-preview",
  "prompt": "도시 야경, 네온과 비 온 뒤 거리",
  "negative_prompt": "흐림, 저품질, 변형",
  "size": "16:9",
  "resolution": "720p",
  "duration": 5,
  "seed": 12345,
  "prompt_extend": true,
  "audio": true,
  "watermark": false
}
```

### 시나리오 3: 이미지-비디오

```json theme={null}
{
  "model": "wan2.5-preview",
  "prompt": "고양이가 잔디밭에서 달리기",
  "image_urls": ["https://example.com/cat.jpg"],
  "resolution": "480p",
  "duration": 5
}
```

### 시나리오 4: 이미지-비디오 (Base64 이미지)

```json theme={null}
{
  "model": "wan2.5-preview",
  "prompt": "고양이를 일어서서 걷게 하기",
  "image_urls": ["data:image/png;base64,iVBORw0KGgo..."],
  "duration": 5
}
```

### 시나리오 5: 사용자 지정 오디오

```json theme={null}
{
  "model": "wan2.5-preview",
  "prompt": "인물이 음악에 맞춰 춤추기",
  "image_urls": ["https://example.com/dancer.jpg"],
  "audio_url": "https://example.com/music.mp3",
  "resolution": "720p",
  "duration": 10
}
```

## 모드 설명

### 텍스트-비디오 (Text-to-Video)

* `prompt` 매개변수 필수
* `image_urls` 불필요
* `size`로 화면 비율 지정 가능

### 이미지-비디오 (Image-to-Video)

* `image_urls` 매개변수 필수 (1장만 지원)
* `prompt`는 선택 사항, 기대하는 동작 설명에 사용
* 화면 비율은 입력 이미지에 의해 결정, `size`를 **전달하지 마세요**

<Note>
  `image_urls` 포함 여부에 따라 모드가 자동 선택됩니다
</Note>

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

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