> ## 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.6-i2v-flash 이미지-비디오

>  - 만상 2.6 고속 이미지-비디오 모델
- 첫 프레임 이미지와 텍스트 프롬프트로 부드러운 비디오 생성
- 오디오/무음 전환, 멀티샷 내러티브, 사용자 지정 오디오 지원
- 720p/1080p 해상도, 2-15초 길이 지원
- 비디오 이펙트 템플릿 지원 

<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.6-i2v-flash",
      "prompt": "인물이 돌아서서 미소 짓기",
      "image_urls": ["https://example.com/portrait.jpg"],
      "resolution": "1080p",
      "duration": 5
    }'
  ```

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

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

  payload = {
      "model": "wan2.6-i2v-flash",
      "prompt": "인물이 돌아서서 미소 짓기",
      "image_urls": ["https://example.com/portrait.jpg"],
      "resolution": "1080p",
      "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.6-i2v-flash",
    prompt: "인물이 돌아서서 미소 짓기",
    image_urls: ["https://example.com/portrait.jpg"],
    resolution: "1080p",
    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.6-i2v-flash",
          "prompt":     "인물이 돌아서서 미소 짓기",
          "image_urls": []string{"https://example.com/portrait.jpg"},
          "resolution": "1080p",
          "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.6-i2v-flash",
            "prompt": "인물이 돌아서서 미소 짓기",
            "image_urls": ["https://example.com/portrait.jpg"],
            "resolution": "1080p",
            "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.6-i2v-flash",
      "prompt" => "인물이 돌아서서 미소 짓기",
      "image_urls" => ["https://example.com/portrait.jpg"],
      "resolution" => "1080p",
      "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.6-i2v-flash",
    prompt: "인물이 돌아서서 미소 짓기",
    image_urls: ["https://example.com/portrait.jpg"],
    resolution: "1080p",
    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.6-i2v-flash",
      "prompt": "인물이 돌아서서 미소 짓기",
      "image_urls": ["https://example.com/portrait.jpg"],
      "resolution": "1080p",
      "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.6-i2v-flash"",
              ""prompt"": ""인물이 돌아서서 미소 짓기"",
              ""image_urls"": [""https://example.com/portrait.jpg""],
              ""resolution"": ""1080p"",
              ""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.6-i2v-flash` 고정
</ParamField>

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

  공개 접근 가능한 이미지 URL 또는 Base64 인코딩(`data:image/png;base64,...`) 지원

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

  <Note>
    이미지 요구사항:

    * 형식: JPEG, JPG, PNG (투명 채널 불가), BMP, WEBP
    * 해상도: 너비/높이 범위 240-8000 픽셀
    * 크기: ≤ 10MB
  </Note>
</ParamField>

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

  이미지-비디오에서 선택 사항이지만 권장, 기대하는 동작과 효과를 설명

  주체, 동작, 카메라, 스타일을 명확하게 지정하세요

  예시: `"이미지 속 인물이 미소 지으며 손을 흔들고, 카메라가 천천히 줌인"`
</ParamField>

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

  최대 500자

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

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

  옵션:

  * `720p` - HD
  * `1080p` - FHD (기본값)

  기본값: `1080p`

  <Note>
    해상도는 가격에 직접 영향을 미칩니다. 1080p가 720p보다 비쌉니다. 화면 비율은 입력 이미지에 의해 결정됩니다.
  </Note>
</ParamField>

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

  지원 범위: `2` \~ `15`초 (정수)

  기본값: `5`
</ParamField>

<ParamField body="audio" type="boolean" default="true">
  오디오 포함 비디오 생성 여부

  `true`: 매칭되는 배경음악/효과음 자동 생성 (기본값)

  `false`: 무음 비디오 출력

  기본값: `true`

  <Note>
    모델이 `wan2.6-i2v`인 경우 이 매개변수는 지원되지 않습니다.
  </Note>
</ParamField>

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

  `audio`보다 우선순위가 낮음: `audio=false`일 때 무시됨

  오디오가 비디오보다 길면 자동으로 잘림; 짧으면 나머지 부분은 무음

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

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

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

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

  기본값: `true`
</ParamField>

<ParamField body="shot_type" type="string">
  샷 유형, `prompt_extend=true`와 함께 사용 필요

  옵션:

  * `single` - 싱글 샷 (기본값), 연속된 단일 샷 비디오 출력
  * `multi` - 멀티 샷, 여러 샷 전환으로 구성된 내러티브 비디오 출력

  <Note>
    `shot_type`은 `prompt`보다 우선순위가 높습니다. 프롬프트에 "멀티 샷"이라고 써도 `single`로 설정하면 싱글 샷이 출력됩니다.
  </Note>
</ParamField>

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

  예시: `12345`
</ParamField>

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

  기본값: `false`
</ParamField>

## 오디오 제어 설명

| 매개변수 조합                             | 결과                        |
| ----------------------------------- | ------------------------- |
| `audio`와 `audio_url` 미전달            | 자동 오디오 생성 (기본값)           |
| `audio_url: "https://..."`          | 지정된 오디오 사용                |
| `audio: false`                      | 무음 비디오                    |
| `audio: false` + `audio_url: "..."` | 무음 비디오 (`audio` 우선순위가 높음) |

## 응답

<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.6-i2v-flash",
  "image_urls": ["https://example.com/image.jpg"]
}
```

### 시나리오 2: 전체 매개변수

```json theme={null}
{
  "model": "wan2.6-i2v-flash",
  "prompt": "이미지 속 인물이 미소 지으며 손을 흔들고, 카메라가 천천히 줌인",
  "image_urls": ["https://example.com/image.jpg"],
  "negative_prompt": "흐림, 저품질, 변형",
  "resolution": "1080p",
  "duration": 10,
  "seed": 12345,
  "prompt_extend": true,
  "shot_type": "multi",
  "audio": true,
  "watermark": false
}
```

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

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

### 시나리오 4: 무음 비디오

```json theme={null}
{
  "model": "wan2.6-i2v-flash",
  "prompt": "꽃이 천천히 피어남",
  "image_urls": ["https://example.com/flower.jpg"],
  "audio": false,
  "resolution": "720p",
  "duration": 5
}
```

### 시나리오 5: 이펙트 템플릿

```json theme={null}
{
  "model": "wan2.6-i2v-flash",
  "image_urls": ["https://example.com/person.jpg"],
  "template": "flying",
  "resolution": "720p"
}
```

### 시나리오 6: Base64 이미지

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

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

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