> ## 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-H3 Context-IR 프롬프트 강화

>  - 멀티모달 컨텍스트 이해로 강화된 구조화 프롬프트를 생성(텍스트만, 비디오 미생성)
- H3 비디오 생성과 동일한 미디어 필드 및 상호 배타 규칙 공유
- 토큰 과금. 보통 20~40초 내 완료
- 단독 사용 또는 768P 미리보기 → 2K 재생성 워크플로의 1단계로 사용 

<Info>
  **Full 2K Workflow**(선택)：① Context-IR로 프롬프트 강화 → ② [MiniMax-H3](/ko/api-reference/videos/minimax-h3/generation) `768P` 미리보기 → ③ [Regeneration](/ko/api-reference/videos/minimax-h3/regeneration) 2K 업스케일. 합산 단가는 직접 2K와 동일하며 재시도 비용이 더 저렴합니다. 본 엔드포인트를 단독으로 호출할 수도 있습니다.
</Info>

<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-H3-Context-IR",
      "prompt": "Epic space-opera trailer: a female captain alone before a huge viewport as the last fleet gathers and jumps away.",
      "duration": 5,
      "aspect_ratio": "16:9"
    }'
  ```

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

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

  payload = {
      "model": "MiniMax-H3-Context-IR",
      "prompt": "Epic space-opera trailer: a female captain alone before a huge viewport as the last fleet gathers and jumps away.",
      "duration": 5,
      "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: "MiniMax-H3-Context-IR",
    prompt: "Epic space-opera trailer: a female captain alone before a huge viewport as the last fleet gathers and jumps away.",
    duration: 5,
    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));
  ```
</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"
    }
  }
  ```
</ResponseExample>

## 인증

<ParamField header="Authorization" type="string" required>
  Bearer Token 인증. [API 키 관리 페이지](https://apimart.ai/keys)에서 키를 받으세요.

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

## 개요

아이디어와 선택적 미디어를 보내 멀티모달 이해 결과로 **구조화되고 더 풍부한 프롬프트**를 받습니다.

* **비디오는 생성되지 않습니다.** 결과는 `result.prompt`에 있습니다(`result.videos`가 아님)
* 미디어 필드는 [비디오 생성](/ko/api-reference/videos/minimax-h3/generation)과 **동일한 검증 규칙**을 사용합니다(첫/끝 프레임과 참조의 상호 배타, 오디오 단독 불가). 같은 입력을 이어서 생성에 넘길 수 있습니다

완료 작업 조회 예시:

```json theme={null}
{
  "code": 200,
  "data": {
    "actual_time": 28,
    "completed": 1700000128,
    "cost": 0.011204,
    "created": 1700000100,
    "credits_cost": 0.11204,
    "estimated_time": 100,
    "id": "task_01J9HA7J*************",
    "progress": 100,
    "result": {
      "prompt": "integrated_multimodal_description: [Shot 1] Cinematic, close-up shot. The camera slowly pushes in on a lone adult astronaut standing in a dimly lit, metallic corridor. The astronaut wears a weathered, white and silver extravehicular spacesuit heavily scuffed with grey dust, featuring a completely opaque, gold-tinted helmet visor. The astronaut slowly pushes open a rusted, thick steel airlock door on the right side of the frame. As the heavy metal door shifts, a sudden, intense beam of vibrant green light spills across the dark frame, illuminating the intricate fabric folds of the suit. The curved golden visor vividly reflects a dense, tangled mass of luminescent green leaves and vines. [Shot 2] At 00:02.500, the camera cuts to a wide shot from directly behind the astronaut from Shot 1, smoothly pedestaling up to reveal the interior of the abandoned orbital station. The vast, hexagonal titanium room is completely overrun by a lush, zero-gravity living garden. Giant, emerald-green vines spiral tightly around cracked, grey ceiling support beams, while thick patches of bioluminescent cyan moss emit a soft glow from the rusted floor grid. Several large, perfectly spherical water droplets float weightlessly in the midground, refracting the ambient green light. The astronaut lowers their heavy, white-gloved hands to their sides, standing perfectly motionless before the massive canopy of overgrown flora.\noverall_soundscape: A loud, grinding metallic creak dominates the foreground as the heavy steel door shifts, instantly followed by a pronounced, high-pitched hiss of escaping pressurized air. A continuous, low-frequency mechanical hum rumbles in the background, establishing the station's deadened room tone. As the space opens, the distinct, crisp rustle of thick foliage is clearly heard, accompanied by soft, resonant liquid plops as unseen water drops collide in the metallic chamber.\nnon_diegetic_music: Ambient electronic score, slow tempo, featuring a deep, sustained synthesizer drone heavily overlaid with delicate, shimmering glockenspiel notes and a solitary, reverberating cello."
    },
    "status": "completed",
    "usage": {
      "input_tokens": 5512,
      "output_tokens": 2388,
      "total_tokens": 7900
    }
  }
}
```

`result.prompt`를 **그대로** `MiniMax-H3`의 `prompt`로 전달하세요.

## 요청 매개변수

<ParamField body="model" type="string" required>
  고정값: `MiniMax-H3-Context-IR`
</ParamField>

<ParamField body="prompt" type="string" required>
  원본 아이디어 텍스트, **≤ 7000자**
</ParamField>

<ParamField body="duration" type="integer" default="5">
  목표 비디오 길이(초), **4\~15**, 기본값 `5`. 강화 프롬프트의 리듬 표현에 영향을 줍니다.
</ParamField>

<ParamField body="aspect_ratio" type="string">
  목표 화면비. **텍스트 전용 입력 시 필수**이며 `adaptive`는 불가.

  자주 쓰는 값: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `21:9` 등.
</ParamField>

<ParamField body="first_frame_image" type="string">
  첫 프레임 이미지 URL
</ParamField>

<ParamField body="last_frame_image" type="string">
  끝 프레임 이미지 URL
</ParamField>

<ParamField body="image_urls" type="string[]">
  참조 이미지(항상 참조로 처리), ≤ **9**
</ParamField>

<ParamField body="image_with_roles" type="object[]">
  역할 지정 이미지: `first_frame` / `last_frame` / `reference_image`
</ParamField>

<ParamField body="video_urls" type="string[]">
  참조 비디오, ≤ **3**; 각 2\~15초, 총합 ≤ 15초
</ParamField>

<ParamField body="audio_urls" type="string[]">
  참조 오디오, ≤ **3**; 단독 사용 불가 — 이미지 또는 비디오와 함께 사용
</ParamField>

## 과금

**토큰 과금**(H3 패밀리 중 유일하게 토큰으로 과금되는 모델):

| 항목        | 단가              |
| --------- | --------------- |
| 입력 tokens | **\$0.87 / 백만** |
| 출력 tokens | **\$3.45 / 백만** |

일반적인 호출(입력 약 5.6k + 출력 약 3.4k tokens)은 약 **\$0.0167**.

제출 시 고정 보증금을 선차감하고, 실제 `prompt_tokens` / `completion_tokens`로 정산(초과 환불 / 부족분 청구). 멀티모달 입력은 입력 tokens를 크게 늘립니다.

## 참고 사항

1. 보통 **20\~40초**. **3\~5초**마다 [작업 상태](/ko/api-reference/tasks/status)를 폴링하세요.
2. 잘못된 매개변수 → 동기 **400**(작업 없음, 과금 없음). 런타임 실패는 `failed`이며 자동 환불.
3. 전체 워크플로 설명은 [Regeneration](/ko/api-reference/videos/minimax-h3/regeneration) 페이지를 참고하세요.

## Response

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

<ResponseField name="data" type="array">
  제출 시: `status` / `task_id`

  <Expandable title="배열 요소">
    <ResponseField name="status" type="string">
      초기값 `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      작업 ID
    </ResponseField>
  </Expandable>
</ResponseField>
