> ## 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 Prompt-Verbesserung

>  - Multimodales Kontextverständnis erzeugt einen verbesserten strukturierten Prompt (nur Text, kein Video)
- Dieselben Medienfelder und wechselseitigen Ausschlussregeln wie bei der H3-Videogenerierung
- Token-basierte Abrechnung; typisch 20~40 Sekunden
- Einzeln nutzbar oder als Schritt 1 des Workflows 768P-Vorschau → 2K-Regeneration 

<Info>
  **Full 2K Workflow** (optional): ① Context-IR verbessert den Prompt → ② [MiniMax-H3](/de/api-reference/videos/minimax-h3/generation) mit `768P` als Vorschau → ③ [Regeneration](/de/api-reference/videos/minimax-h3/regeneration) skaliert auf 2K. Die kombinierten Einzelpreise entsprechen direktem 2K, mit günstigeren Wiederholungen. Sie können diesen Endpunkt auch allein aufrufen.
</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": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed, please check your API key",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance, please top up and try again",
      "type": "payment_required"
    }
  }
  ```
</ResponseExample>

## Autorisierung

<ParamField header="Authorization" type="string" required>
  Bearer-Token-Auth. Holen Sie einen Key auf der [API-Key-Verwaltungsseite](https://apimart.ai/keys).

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

## Überblick

Senden Sie Ihre Idee plus optionale Medien zur multimodalen Verarbeitung; Sie erhalten einen **strukturierten, reicheren Prompt**.

* **Es wird kein Video erzeugt.** Das Ergebnis liegt in `result.prompt` (nicht `result.videos`)
* Medienfelder nutzen **dieselben Validierungsregeln** wie die [Videogenerierung](/de/api-reference/videos/minimax-h3/generation) (wechselseitiger Ausschluss Frame vs. Referenz; Audio nicht allein), damit dieselben Eingaben als Nächstes an die Generierung gehen können

Beispiel für eine abgeschlossene Task-Abfrage:

```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
    }
  }
}
```

Übergeben Sie `result.prompt` **unverändert** an `MiniMax-H3` als `prompt`.

## Anfrageparameter

<ParamField body="model" type="string" required>
  Fester Wert: `MiniMax-H3-Context-IR`
</ParamField>

<ParamField body="prompt" type="string" required>
  Ursprünglicher Ideentext, **≤ 7000 Zeichen**
</ParamField>

<ParamField body="duration" type="integer" default="5">
  Ziel-Videodauer (Sekunden), **4\~15**, Standard `5`. Beeinflusst die Tempobeschreibung im verbesserten Prompt.
</ParamField>

<ParamField body="aspect_ratio" type="string">
  Ziel-Seitenverhältnis. **Bei reiner Texteingabe erforderlich**, und darf nicht `adaptive` sein.

  Häufige Werte: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `21:9` usw.
</ParamField>

<ParamField body="first_frame_image" type="string">
  URL des ersten Einzelbilds
</ParamField>

<ParamField body="last_frame_image" type="string">
  URL des letzten Einzelbilds
</ParamField>

<ParamField body="image_urls" type="string[]">
  Referenzbilder (immer als Referenzen behandelt), ≤ **9**
</ParamField>

<ParamField body="image_with_roles" type="object[]">
  Rollenmarkierte Bilder: `first_frame` / `last_frame` / `reference_image`
</ParamField>

<ParamField body="video_urls" type="string[]">
  Referenzvideos, ≤ **3**; jeweils 2\~15 s, gesamt ≤ 15 s
</ParamField>

<ParamField body="audio_urls" type="string[]">
  Referenz-Audio, ≤ **3**; nicht allein nutzbar — mit Bild oder Video kombinieren
</ParamField>

## Abrechnung

**Token-basiert** (einziges H3-Familienmodell mit Token-Abrechnung):

| Position       | Preis                |
| -------------- | -------------------- |
| Eingabe-Tokens | **\$0.87 / Million** |
| Ausgabe-Tokens | **\$3.45 / Million** |

Ein typischer Aufruf (\~5.6k Eingabe + \~3.4k Ausgabe-Tokens) kostet etwa **\$0.0167**.

Beim Submit wird eine feste Kaution vorab belastet und danach gegen reale `prompt_tokens` / `completion_tokens` abgerechnet (Überschuss erstatten / Unterdeckung nachziehen). Multimodale Eingaben erhöhen die Eingabe-Tokens deutlich.

## Hinweise

1. Üblicherweise **20\~40 Sekunden**; pollen Sie den [Task-Status](/de/api-reference/tasks/status) alle **3\~5 Sekunden**.
2. Ungültige Parameter → synchron **400** (kein Task, keine Belastung); Laufzeitfehler → `failed` mit automatischer Erstattung.
3. Hinweise zum vollständigen Workflow stehen auf der [Regeneration](/de/api-reference/videos/minimax-h3/regeneration)-Seite.

## Response

<ResponseField name="code" type="integer">
  Statuscode; 200 bei Erfolg
</ResponseField>

<ResponseField name="data" type="array">
  Beim Submit: `status` / `task_id`

  <Expandable title="Array-Elemente">
    <ResponseField name="status" type="string">
      Anfänglich `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      Task-ID
    </ResponseField>
  </Expandable>
</ResponseField>
