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

# MiniMax-Hailuo-2.3 비디오 생성

>  - 비동기 처리 모드, 후속 조회를 위한 작업 ID 반환
- 텍스트-비디오, 이미지-비디오(첫 프레임 이미지) 지원
- 6초 및 10초 길이, 768p/1080p 해상도 지원
- 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": "MiniMax-Hailuo-2.3",
      "prompt": "귀여운 고양이가 잔디밭에서 달리고 있다",
      "duration": 6,
      "resolution": "768p",
      "prompt_optimizer": true,
      "fast_pretreatment": false,
      "watermark": false
    }'
  ```

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

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

  payload = {
      "model": "MiniMax-Hailuo-2.3",
      "prompt": "귀여운 고양이가 잔디밭에서 달리고 있다",
      "duration": 6,
      "resolution": "768p",
      "prompt_optimizer": True,
      "fast_pretreatment": False,
      "watermark": False
  }

  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: "MiniMax-Hailuo-2.3",
    prompt: "귀여운 고양이가 잔디밭에서 달리고 있다",
    duration: 6,
    resolution: "768p",
    prompt_optimizer: true,
    fast_pretreatment: false,
    watermark: false
  };

  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":              "MiniMax-Hailuo-2.3",
          "prompt":             "귀여운 고양이가 잔디밭에서 달리고 있다",
          "duration":           6,
          "resolution":         "768p",
          "prompt_optimizer":   true,
          "fast_pretreatment":  false,
          "watermark":          false,
      }

      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": "MiniMax-Hailuo-2.3",
            "prompt": "귀여운 고양이가 잔디밭에서 달리고 있다",
            "duration": 6,
            "resolution": "768p",
            "prompt_optimizer": true,
            "fast_pretreatment": false,
            "watermark": false
          }
          """;

          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" => "MiniMax-Hailuo-2.3",
      "prompt" => "귀여운 고양이가 잔디밭에서 달리고 있다",
      "duration" => 6,
      "resolution" => "768p",
      "prompt_optimizer" => true,
      "fast_pretreatment" => false,
      "watermark" => false
  ];

  $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: "MiniMax-Hailuo-2.3",
    prompt: "귀여운 고양이가 잔디밭에서 달리고 있다",
    duration: 6,
    resolution: "768p",
    prompt_optimizer: true,
    fast_pretreatment: false,
    watermark: false
  }

  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": "MiniMax-Hailuo-2.3",
      "prompt": "귀여운 고양이가 잔디밭에서 달리고 있다",
      "duration": 6,
      "resolution": "768p",
      "prompt_optimizer": true,
      "fast_pretreatment": false,
      "watermark": false
  ]

  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"": ""MiniMax-Hailuo-2.3"",
              ""prompt"": ""귀여운 고양이가 잔디밭에서 달리고 있다"",
              ""duration"": 6,
              ""resolution"": ""768p"",
              ""prompt_optimizer"": true,
              ""fast_pretreatment"": false,
              ""watermark"": false
          }";

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

  API 키 받기:

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

  요청 헤더에 추가:

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

## 요청 매개변수

<ParamField body="model" type="string" required>
  지원 모델:

  * `MiniMax-Hailuo-2.3` - Hailuo 2.3 모델
  * `MiniMax-Hailuo-2.3-Fast` - Hailuo 2.3 Fast 모델(더 빠른 속도)

  <Warning>
    **MiniMax-Hailuo-2.3-Fast**:<br />
    이 모델을 사용할 때 `first_frame_image`를 반드시 전달해야 합니다.
  </Warning>
</ParamField>

<ParamField body="prompt" type="string" required>
  비디오 콘텐츠 설명 (최대 2000자)

  장면, 동작, 스타일 등을 자세히 설명하면 더 나은 생성 결과를 얻을 수 있습니다. 카메라 워크 명령어를 지원합니다 (아래 카메라 워크 명령어 참조).

  예시: `"귀여운 고양이가 잔디밭에서 달리고 있다"`
</ParamField>

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

  옵션:

  * `6` - 6초 비디오
  * `10` - 10초 비디오

  기본값: `6`

  <Warning>
    **1080p 제한**: 1080p 해상도 사용 시 6초 길이만 지원됩니다
  </Warning>
</ParamField>

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

  옵션:

  * `768p` - 고화질
  * `1080p` - 풀HD (6초 길이만 지원)

  기본값: `768p`
</ParamField>

<ParamField body="first_frame_image" type="string">
  비디오 첫 프레임 이미지

  두 가지 형식 지원:

  * **공개 URL**: `https://example.com/start.jpg`
  * **Base64 인코딩**: `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...`

  전달 시 해당 이미지가 비디오의 시작 프레임으로 사용됩니다

  <Warning>
    **MiniMax-Hailuo-2.3-Fast**:<br />
    이 모델을 사용할 때 `first_frame_image`를 반드시 전달해야 합니다.
  </Warning>
</ParamField>

<ParamField body="prompt_optimizer" type="boolean" default="true">
  프롬프트 자동 최적화 여부

  활성화 시 시스템이 자동으로 프롬프트를 최적화하여 더 나은 생성 결과를 제공합니다

  기본값: `true`
</ParamField>

<ParamField body="fast_pretreatment" type="boolean" default="false">
  프롬프트 최적화 시간 단축 여부

  활성화 시 처리 속도가 빨라지지만 최적화 품질이 약간 영향을 받을 수 있습니다

  기본값: `false`
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  워터마크 추가 여부

  기본값: `false`
</ParamField>

## 해상도 및 길이 조합

| 해상도   | 지원 길이   | 비고      |
| ----- | ------- | ------- |
| 768p  | 6초, 10초 | 모두 지원   |
| 1080p | 6초      | 10초 미지원 |

## 카메라 워크 명령어

`prompt`에서 `[명령어]` 구문을 사용하여 카메라 워크를 제어할 수 있습니다. 명령어 라벨은 아래의 중국어 라벨을 그대로 입력해야 합니다. 15가지 명령어 지원:

| 카테고리  | 명령어                                   |
| ----- | ------------------------------------- |
| 패닝    | `[左移]` (좌측 이동) `[右移]` (우측 이동)         |
| 수평 회전 | `[左摇]` (좌측 회전) `[右摇]` (우측 회전)         |
| 푸시/풀  | `[推进]` (푸시 인) `[拉远]` (풀 아웃)           |
| 수직 이동 | `[上升]` (상승) `[下降]` (하강)               |
| 수직 회전 | `[上摇]` (틸트 업) `[下摇]` (틸트 다운)          |
| 줌     | `[变焦推近]` (줌 인) `[变焦拉远]` (줌 아웃)        |
| 기타    | `[晃动]` (흔들림) `[跟随]` (팔로우) `[固定]` (고정) |

**사용 예시**:

```json theme={null}
{
  "model": "MiniMax-Hailuo-2.3",
  "prompt": "[推进]고양이가 정원에서 달리고 있고, 카메라가 천천히 클로즈업으로 다가간다"
}
```

## 응답

<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": "MiniMax-Hailuo-2.3",
  "prompt": "귀여운 고양이가 잔디밭에서 달리고 있다, 화창한 날"
}
```

### 시나리오 2: 고품질 1080p 비디오

```json theme={null}
{
  "model": "MiniMax-Hailuo-2.3",
  "prompt": "도시 야경, 네온 불빛이 깜빡이고, 차량이 오가는 모습",
  "duration": 6,
  "resolution": "1080p",
  "prompt_optimizer": true,
  "watermark": false
}
```

### 시나리오 3: 첫 프레임 이미지로 비디오 생성

```json theme={null}
{
  "model": "MiniMax-Hailuo-2.3",
  "prompt": "고양이가 카메라를 향해 달려오며 미소짓고 윙크한다",
  "first_frame_image": "https://example.com/cat.jpg",
  "duration": 6,
  "resolution": "1080p"
}
```

### 시나리오 4: 카메라 워크 명령어 사용

```json theme={null}
{
  "model": "MiniMax-Hailuo-2.3",
  "prompt": "[推进]고양이가 정원에서 달리고 있고, 카메라가 천천히 클로즈업으로 다가간다",
  "duration": 6,
  "resolution": "768p"
}
```

### 시나리오 5: 빠른 전처리 모드

```json theme={null}
{
  "model": "MiniMax-Hailuo-2.3",
  "prompt": "파도가 해변에 부딪히고 있다, 해질녘",
  "duration": 10,
  "resolution": "768p",
  "prompt_optimizer": true,
  "fast_pretreatment": true
}
```

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

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