> ## Documentation Index
> Fetch the complete documentation index at: https://gccai.heqingsong.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax-H3 Videogenerierung

>  - Asynchroner Verarbeitungsmodus, gibt eine Task-ID für spätere Abfragen zurück
- Unterstützt Text-to-Video, Image-to-Video (erstes / letztes / erstes+letztes Einzelbild) und multimodale Referenz-zu-Video (Referenzbilder + Videos + Audio)
- Unterstützt 2K / 768P Auflösung, Dauer 4 ~ 15 Sekunden, mit Audiospur
- Nutzt dieselben Submit- und Abfrage-APIs wie MiniMax-Hailuo-02 / MiniMax-Hailuo-2.3 

```bash cURL theme={null}
curl --request POST \
  --url https://gccai.heqingsong.uk/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "MiniMax-H3",
    "prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
    "duration": 5,
    "resolution": "2K",
    "aspect_ratio": "16:9"
  }'
```

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

url = "https://gccai.heqingsong.uk/v1/videos/generations"

payload = {
    "model": "MiniMax-H3",
    "prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
    "duration": 5,
    "resolution": "2K",
    "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://gccai.heqingsong.uk/v1/videos/generations";

const payload = {
  model: "MiniMax-H3",
  prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
  duration: 5,
  resolution: "2K",
  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));
```

```go Go theme={null}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://gccai.heqingsong.uk/v1/videos/generations"

    payload := map[string]interface{}{
        "model":        "MiniMax-H3",
        "prompt":       "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
        "duration":     5,
        "resolution":   "2K",
        "aspect_ratio": "16:9",
    }

    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://gccai.heqingsong.uk/v1/videos/generations";

        String payload = """
        {
          "model": "MiniMax-H3",
          "prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
          "duration": 5,
          "resolution": "2K",
          "aspect_ratio": "16:9"
        }
        """;

        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://gccai.heqingsong.uk/v1/videos/generations";

$payload = [
    "model" => "MiniMax-H3",
    "prompt" => "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
    "duration" => 5,
    "resolution" => "2K",
    "aspect_ratio" => "16:9"
];

$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://gccai.heqingsong.uk/v1/videos/generations")

payload = {
  model: "MiniMax-H3",
  prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
  duration: 5,
  resolution: "2K",
  aspect_ratio: "16:9"
}

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://gccai.heqingsong.uk/v1/videos/generations")!

let payload: [String: Any] = [
    "model": "MiniMax-H3",
    "prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
    "duration": 5,
    "resolution": "2K",
    "aspect_ratio": "16:9"
]

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://gccai.heqingsong.uk/v1/videos/generations";

        var payload = @"{
            ""model"": ""MiniMax-H3"",
            ""prompt"": ""A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"",
            ""duration"": 5,
            ""resolution"": ""2K"",
            ""aspect_ratio"": ""16:9""
        }";

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

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

```json 422 theme={null}
{
  "error": {
    "code": 422,
    "message": "Content safety review failed",
    "type": "invalid_request_error"
  }
}
```

```json 429 theme={null}
{
  "error": {
    "code": 429,
    "message": "Too many requests, please try again later",
    "type": "rate_limit_error"
  }
}
```

```json 500 theme={null}
{
  "error": {
    "code": 500,
    "message": "Internal server error, please retry later",
    "type": "server_error"
  }
}
```

## Autorisierung

**Authorization** `string` *required*

Alle API-Endpunkte erfordern eine Bearer-Token-Authentifizierung

API-Key abrufen:

Besuchen Sie die [Seite zur API-Key-Verwaltung](https://gccai.heqingsong.uk/keys), um Ihren API-Key zu erhalten

Fügen Sie ihn zum Request-Header hinzu:

```
Authorization: Bearer YOUR_API_KEY
```

## Generierungsmodi

MiniMax-H3 wählt den passenden Modus automatisch anhand der Anfragefelder. **Kein `mode`-Feld erforderlich**:

| Modus | Auslöser | Funktion |
| - | - | - |
| **Text-to-Video (T2V)** | Nur `prompt` und allgemeine Felder | Rein textgesteuerte Generierung |
| **Image-to-Video (I2V)** | `first_frame_image` / `last_frame_image` (oder `first_frame` / `last_frame` in `image_with_roles`) | Steuerung erstes Einzelbild, letztes Einzelbild, erstes+letztes Einzelbild |
| **Multimodal Reference (R2V)** | `image_urls` / `video_urls` / `audio_urls` oder `reference_image` in `image_with_roles` | Referenzbilder + Videos + Audio |

> [!WARNING]
>
> **Strikte gegenseitige Ausschließlichkeit**: Image-to-Video-Felder (`first_frame_image` / `last_frame_image` sowie `first_frame` / `last_frame` in `image_with_roles`) können nicht mit multimodalen Referenzfeldern (`image_urls`, `video_urls`, `audio_urls` und `reference_image` in `image_with_roles`) kombiniert werden. Eine Mischung gibt **400** zurück.

> [!WARNING]
>
> **Audio allein ist nicht erlaubt.** Wenn Sie `audio_urls` übergeben, müssen Sie auch mindestens ein Referenzbild oder Referenzvideo angeben.

## Anfrageparameter

### Allgemeine Felder

**model** `string` *required*

Fester Wert: `MiniMax-H3`

> [!WARNING]
>
> **`model` ist erforderlich und muss explizit gesendet werden.** Clients, die bereits mit Hailuo integriert sind, können umschalten, indem sie `model` auf `MiniMax-H3` setzen.

**nsfw\_check** `boolean` (default: false)

Legt fest, ob der Inhalt vor dem Absenden des Videoauftrags moderiert wird.

* `true`: Prompts und Eingabebilder mit `omni-moderation-latest` prüfen
* `false` oder nicht angegeben: keine Moderationsanfrage und damit keine zusätzlichen Moderationskosten oder Verzögerung (Standard)

**prompt** `string` *required*

Beschreibung des Videoinhalts. **In jedem Szenario erforderlich und nicht leer**, maximal **7000** Zeichen pro Anfrage.

Beschreiben Sie Szene, Subjekt, Bewegung und Stil detailliert für bessere Ergebnisse.

Beispiel: `"A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"`

**duration** `integer` (default: 5)

Ausgabedauer (Sekunden)

* Bereich: Ganzzahl von `4` bis `15`
* Standard: `5`

**resolution** `string` (default: 2K)

Videoauflösung

Optionen:

* `2K` (Standard)
* `768P`

**aspect\_ratio** `string`

Seitenverhältnis. Sie können auch `size` oder `ratio` mit derselben Wirkung übergeben.

Zulässige Verhältnisse: `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`

Das Verhalten je Szenario ist unten unter „Regeln zum Seitenverhältnis“ beschrieben.

**watermark** `boolean` (default: false)

Ob ein AIGC-Wasserzeichen hinzugefügt werden soll

Standard: `false`

Kompatibler Alias: `aigc_watermark`

**webhook** `string`

URL, die eine Benachrichtigung erhält, wenn die Aufgabe einen Endzustand erreicht (Erfolg / Fehler)

> [!NOTE]
>
> Verwenden Sie `webhook`. Übergeben Sie nicht die offizielle `callback_url`. `callback_url` ist für den internen Gebrauch reserviert und wird von Benutzern nicht akzeptiert.

### Image-to-Video-Felder

Für Image-to-Video mit **erstem / letztem Einzelbild** Rollen explizit angeben. Nicht aus der Anzahl von `image_urls` ableiten.

**first\_frame\_image** `string`

URL des ersten Einzelbildes

Wenn angegeben, wird dieses Bild als **Anfangsbild** des Videos verwendet.

**last\_frame\_image** `string`

URL des letzten Einzelbildes

Wenn angegeben, wird dieses Bild als **Endbild** verwendet. Mit `first_frame_image` für die Steuerung von Erst- und Endbild kombinieren.

### Multimodale Referenzfelder

**image\_urls** `string[]`

Array von Referenzbild-URLs

> [!WARNING]
>
> **Jedes Bild in `image_urls` wird als Referenzbild (`reference_image`) behandelt**, unabhängig von der Anzahl. Sie werden nie automatisch anhand der Array-Länge dem ersten / ersten+letzten Einzelbild zugeordnet.

* Anzahl: ≤ **9**

**video\_urls** `string[]`

Array von Referenzvideo-URLs

* Anzahl: ≤ **3**
* Format und Grenzen: siehe „Eingabe-Medienlimits“ unten

**audio\_urls** `string[]`

Array von Referenzaudio-URLs

* Anzahl: ≤ **3**
* Kann nicht allein verwendet werden; muss mit einem Referenzbild oder Referenzvideo kombiniert werden

### Gemeinsames Bild-Array (optionale Form)

**image\_with\_roles** `object[]`

Rollenmarkiertes Bild-Array. Kann `first_frame_image` / `last_frame_image` / `image_urls` ersetzen. Jedes Element:

**image\_with\_roles-Element**

**url** `string` *required*

Bild-URL

**role** `string` *required*

Bildrolle. Zulässige Werte:

* `first_frame` (akzeptiert auch `first`) — erstes Einzelbild (I2V)
* `last_frame` (akzeptiert auch `last`) — letztes Einzelbild (I2V)
* `reference_image` (akzeptiert auch `reference`) — Referenzbild (R2V)

Beispiel (erstes + letztes Einzelbild):

```json theme={null}
{
  "image_with_roles": [
    {"url": "https://example.com/start.png", "role": "first_frame"},
    {"url": "https://example.com/end.png", "role": "last_frame"}
  ]
}
```

Beispiel (Referenzbild):

```json theme={null}
{
  "image_with_roles": [
    {"url": "https://example.com/char.png", "role": "reference_image"}
  ]
}
```

## Regeln zum Seitenverhältnis

| Szenario | Verhalten von `aspect_ratio` |
| - | - |
| **Text-to-Video** (nur Prompt) | Muss ein konkretes Verhältnis sein; weglassen oder `adaptive` **fällt auf `16:9` zurück** |
| **Image-to-Video** (erstes / letztes Einzelbild) | Wird durch das Eingabebild bestimmt; jeder Wert wird ignoriert (immer `adaptive`) |
| **Multimodale Referenz** | Optional, Standard `adaptive`; kann auch ein explizites Verhältnis setzen |

Zulässige konkrete Verhältnisse: `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`.

## Eingabe-Medienlimits

Gesamtgröße des Request-Bodys ≤ **64 MB**. Für große Dateien öffentliche URLs verwenden; **kein Base64 verwenden**.

### Bilder

| Element | Limit |
| - | - |
| Format | JPG / JPEG / PNG / WEBP / HEIC / HEIF |
| Pro Datei | ≤ 30 MB |
| Breite / Höhe | 256 \~ 5760 px |
| Seitenverhältnis (w/h) | 0.4 \~ 2.5 |
| Anzahl | Erstes Einzelbild ≤ 1, letztes Einzelbild ≤ 1, Referenzbilder ≤ 9 |

### Video (nur multimodale Referenz)

| Element | Limit |
| - | - |
| Format | MP4 (`.mp4`), MOV (`.mov`) |
| Codec | Video H.264/AVC, H.265/HEVC; Audio AAC, MP3 |
| Pro Datei | ≤ 50 MB |
| Anzahl | ≤ 3 |
| Dauer | Pro Clip 2 \~ 15 s; **Gesamtdauer ≤ 15 s** |
| Größe / Verhältnis / FPS | 256 \~ 5760 px / 0.4 \~ 2.5 / 23.976 \~ 60 |

### Audio (nur multimodale Referenz)

| Element | Limit |
| - | - |
| Format | WAV, MP3 |
| Pro Datei | ≤ 15 MB |
| Anzahl | ≤ 3 |
| Dauer | Pro Clip 2 \~ 15 s; Gesamtdauer ≤ 15 s |

## Parameter-Einschränkungen

Verstöße werden mit **400** abgelehnt (sensibler Inhalt kann **422** zurückgeben) und **werden nicht abgerechnet**:

| Parameter | Einschränkung |
| - | - |
| `prompt` | In jedem Szenario erforderlich und nicht leer, ≤ 7000 Zeichen |
| `duration` | Nur Ganzzahl von `4` bis `15` |
| `resolution` | `2K` (Standard) oder `768P` |
| `aspect_ratio` | Siehe „Regeln zum Seitenverhältnis“; T2V fällt bei Weglassen auf `16:9` zurück |
| Erstes/letztes Einzelbild vs. Referenzressourcen | **Gegenseitig ausschließend**, können nicht gemischt werden |
| `audio_urls` | Kann nicht allein verwendet werden; muss mit Referenzbild oder -video kombiniert werden |
| Referenzbilder | ≤ 9 |
| Referenzvideos | ≤ 3 |
| Referenzaudio | ≤ 3 |
| Probe-Fehler bei Referenzvideo | Gibt `input_video_probe_failed` zurück (URL nicht erreichbar oder Datei beschädigt), **keine Abrechnung** |

## Antwort

**code** `integer`

Statuscode der Antwort, 200 bei Erfolg

**data** `array`

Datenarray der Antwort

**Array-Elemente**

**status** `string`

Aufgabenstatus; `submitted` bei der Erstübermittlung

**task\_id** `string`

Eindeutige Aufgabenkennung zur Abfrage von Status und Ergebnissen

## Anfragebeispiele

### Fall 1: Text-zu-Video

```json theme={null}
{
  "model": "MiniMax-H3",
  "prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
  "duration": 6,
  "resolution": "2K",
  "aspect_ratio": "16:9"
}
```

### Fall 2: Bild-zu-Video — Erstes Einzelbild

```json theme={null}
{
  "model": "MiniMax-H3",
  "prompt": "Pull focus to the people in the background and add more steam to the ramen bowl.",
  "first_frame_image": "https://cdn.example.com/ramen.png",
  "duration": 5,
  "resolution": "2K"
}
```

### Fall 3: Bild-zu-Video — Erstes + letztes Einzelbild

```json theme={null}
{
  "model": "MiniMax-H3",
  "prompt": "Camera slowly transitions from morning light to sunset",
  "first_frame_image": "https://cdn.example.com/morning.png",
  "last_frame_image": "https://cdn.example.com/sunset.png",
  "duration": 8
}
```

### Fall 4: Multimodale Referenz-zu-Video

```json theme={null}
{
  "model": "MiniMax-H3",
  "prompt": "Character speaks: Follow the wind, live free. Leave worries behind, enjoy the moment. Voice references audio 1",
  "image_with_roles": [
    {"url": "https://cdn.example.com/char.png", "role": "reference_image"}
  ],
  "video_urls": ["https://cdn.example.com/ref_motion.mp4"],
  "audio_urls": ["https://cdn.example.com/ref_voice.mp3"],
  "duration": 5,
  "resolution": "2K"
}
```

### Fall 5: Erstes + letztes Einzelbild über image\_with\_roles

```json theme={null}
{
  "model": "MiniMax-H3",
  "prompt": "Camera slowly transitions from morning light to sunset",
  "image_with_roles": [
    {"url": "https://cdn.example.com/morning.png", "role": "first_frame"},
    {"url": "https://cdn.example.com/sunset.png", "role": "last_frame"}
  ],
  "duration": 8
}
```

> [!NOTE]
>
> **Aufgabenergebnisse abfragen**
>
> Die Videogenerierung ist eine asynchrone Aufgabe, die nach der Übermittlung eine `task_id` zurückgibt. Verwenden Sie den Endpunkt [Aufgabenstatus abrufen](https://gccai.heqingsong.uk/de/api-reference/tasks/status.md), um den Generierungsfortschritt und die Ergebnisse abzufragen.
>
> Empfohlenes Abfrageintervall: alle **5 \~ 10 Sekunden**. Client-Timeout: **15 Minuten**. Bei Erfolg ist `result.videos[0].url` die mp4-URL. Video-URLs laufen in etwa **24 Stunden** ab — speichern Sie sie zeitnah. Fehlgeschlagene Aufgaben werden automatisch erstattet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.