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

# Videogenerierungs-API

>  AiHubMix bietet eine einheitliche Videogenerierungs-API, kompatibel mit dem OpenAI-Sora-Schnittstellenformat, mit Backend-Unterstützung für Modelle mehrerer Anbieter

## Schnellstart

Die Videogenerierung ist ein asynchroner Vorgang. Der gesamte Ablauf gliedert sich in drei Schritte:

```text theme={null}
1. Aufgabe übermitteln → video_id erhalten
2. Status abfragen → warten, bis status auf completed wechselt
3. Video herunterladen → MP4-Datei abrufen
```

**Minimalbeispiel**

```shellscript theme={null}
# Schritt 1: Videogenerierungsaufgabe übermitteln
curl -X POST https://aihubmix.com/v1/videos \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.6-t2v",
    "prompt": "A cat playing jazz on a piano, warm lighting, cinematic shot",
    "seconds": "5",
    "size": "1280x720"
  }'

# Beispielantwort:
# {
#   "id": "eyJtb2RlbCI6IndhbjI...",
#   "object": "video",
#   "status": "in_progress",
#   "model": "wan2.6-t2v",
#   "duration": 5,
#   "width": 1280,
#   "height": 720,
#   ...
# }

# Schritt 2: Status abfragen (alle 15 Sekunden abfragen, bis status auf completed steht)
curl https://aihubmix.com/v1/videos/{video_id} \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY"

# Schritt 3: Video herunterladen
curl https://aihubmix.com/v1/videos/{video_id}/content \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  --output video.mp4
```

## Übersicht der Schnittstellen

| Schnittstelle       | Methode | Pfad                            | Beschreibung                            |
| :------------------ | :------ | :------------------------------ | :-------------------------------------- |
| Video erstellen     | POST    | `/v1/videos`                    | Videogenerierungsaufgabe übermitteln    |
| Status abfragen     | GET     | `/v1/videos/{video_id}`         | Aufgabenstatus und Fortschritt abfragen |
| Video herunterladen | GET     | `/v1/videos/{video_id}/content` | Generiertes MP4-Video herunterladen     |
| Aufgabe löschen     | DELETE  | `/v1/videos/{video_id}`         | Videoaufgabe löschen                    |

Base URL: `https://aihubmix.com`

Authentifizierungsmethode: Bearer Token

```shellscript theme={null}
Authorization: Bearer $AIHUBMIX_API_KEY
```

## Unterstützte Modelle

### Text-zu-Video (Text-to-Video)

| Anbieter  | Modellname                                                 | Merkmale                                                                                           |
| --------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| OpenAI    | `sora-2`                                                   | Standard-Videogenerierung, unterstützt Audio-Bild-Synchronisation                                  |
| OpenAI    | `sora-2-pro`                                               | Hochqualitative Version, feineres und stabileres Bild                                              |
| Google    | `veo-3.1-generate-preview`                                 | Neuestes Veo 3.1, natives Audio, unterstützt 4K                                                    |
| Google    | `veo-3.1-fast-generate-preview`                            | Schnelle Version von Veo 3.1, höhere Generierungsgeschwindigkeit                                   |
| Google    | `veo-3.0-generate-preview`                                 | Veo 3.0, originalgetreues Video                                                                    |
| Google    | `veo-2.0-generate-001`                                     | Veo 2.0, stabile Version                                                                           |
| Alibaba   | `wan2.6-t2v`                                               | Neueste Version von Tongyi Wanxiang, Audio-Bild-Synchronisation                                    |
| Alibaba   | `wan2.5-t2v-preview`                                       | Tongyi Wanxiang 2.5, für Chinesisch optimiert                                                      |
| Alibaba   | `wan2.2-t2v-plus`                                          | Tongyi Wanxiang 2.2                                                                                |
| ByteDance | `jimeng-3.0-pro`                                           | Jimeng 3.0 Pro, 1080P HD                                                                           |
| ByteDance | `jimeng-3.0-1080p`                                         | Jimeng 3.0 1080P                                                                                   |
| ByteDance | `doubao-seedance-2-0-260128`                               | Professionelles multimodales Video-Kreationsmodell Seedance 2.0                                    |
| ByteDance | `doubao-seedance-2-0-fast-260128`                          | Schnelle Version von Seedance 2.0                                                                  |
| Kuaishou  | `kling-v3`, `kling-v2-6`, `kling-v2-5-turbo`, `kling-v2-1` | Kling Text-zu-Video / Bild-zu-Video, neue Versionen unterstützen 3–15 Sekunden                     |
| Kuaishou  | `kling-v3-omni`, `kling-video-o1`                          | Kling OmniVideo multimodal, unterstützt Referenzvideos, natives Audio, mehrere Kameraeinstellungen |

### Bild-zu-Video (Image-to-Video)

| Anbieter  | Modellname                        | Merkmale                                                                         |
| --------- | --------------------------------- | -------------------------------------------------------------------------------- |
| Alibaba   | `wan2.6-i2v`                      | Neueste Version von Tongyi Wanxiang für Bild-zu-Video                            |
| Alibaba   | `wan2.5-i2v-preview`              | Tongyi Wanxiang 2.5 Bild-zu-Video                                                |
| Alibaba   | `wan2.2-i2v-plus`                 | Tongyi Wanxiang 2.2 Bild-zu-Video                                                |
| ByteDance | `doubao-seedance-2-0-260128`      | Multimodale Referenzeingabe, unterstützt Bild/Video/Audio                        |
| ByteDance | `doubao-seedance-2-0-fast-260128` | Schnelle Version von Seedance 2.0                                                |
| Kuaishou  | `kling-v1-6` u. a.                | Kling Bild-zu-Video, unterstützt Endbild und Mehrbild-Referenz (bis zu 4 Bilder) |

<Note>
  Bei Bild-zu-Video wird das Referenzbild über den Parameter `input_reference` übergeben (Tongyi Wanxiang von Alibaba); Doubao Seedance übergibt es über das Array `extra_body.content` und unterstützt Bild-, Video- und Audio-Referenztypen; Kling verwendet `image` / `image_tail` / `image_list` zur Bildübergabe, siehe Abschnitt [Kling](#kling) weiter unten.
</Note>

## Detaillierte API-Beschreibung

### Request-Header

```shellscript theme={null}
Authorization: Bearer $AIHUBMIX_API_KEY
Content-Type: application/json
```

### Videogenerierungsaufgabe erstellen

```shellscript theme={null}
POST /v1/videos
```

#### **Request-Body**

| Parameter         | Typ           | Pflicht | Beschreibung                                                                                                           |
| :---------------- | :------------ | :------ | :--------------------------------------------------------------------------------------------------------------------- |
| `model`           | string        | Ja      | Modellname, z. B. `wan2.6-t2v`, `sora-2`                                                                               |
| `prompt`          | string        | Ja      | Beschreibungstext des Videos                                                                                           |
| `seconds`         | string        | Nein    | Videodauer (Sekunden), einheitlich als String-Typ, z. B. `"5"`, `"8"` (siehe Detailbeschreibung der einzelnen Modelle) |
| `size`            | string        | Nein    | Auflösung, Format `BreitexHöhe`, z. B. `1920x1080` (unterstützte Werte je nach Modell unterschiedlich)                 |
| `input_reference` | string/object | Nein    | Referenzbild (Bild-zu-Video), unterstützt URL oder base64                                                              |

> Das Antwortformat unterscheidet sich je nach Modell leicht, enthält aber stets die Felder `id` (video\_id) und `status`. Den Aufgabenfortschritt kann man anhand von `status` beurteilen.

#### Beispielantwort (**Tongyi Wanxiang/Veo/Jimeng**)

```json theme={null}
{
  "id": "eyJtb2RlbCI6IndhbjI...",
  "object": "video",
  "created": 1772460274,
  "model": "wan2.6-t2v",
  "status": "in_progress",
  "prompt": "A cat watching the rain on a windowsill",
  "duration": 5,
  "width": 1920,
  "height": 1080,
  "url": null,
  "error": null
}
```

**Beispielantwort (Sora)**

```json theme={null}
{
  "id": "eyJtb2RlbCI6InNvcmEtMi...",
  "object": "video",
  "created_at": 1772451930,
  "status": "queued",
  "model": "sora-2",
  "progress": 0,
  "prompt": "A cinematic drone shot over mountains",
  "seconds": "8",
  "size": "1280x720"
}
```

#### Beschreibung der allgemeinen Statuswerte

| Status        | Beschreibung                                |
| :------------ | :------------------------------------------ |
| `queued`      | In der Warteschlange (Sora-spezifisch)      |
| `in_progress` | Wird generiert                              |
| `completed`   | Generierung abgeschlossen, Download möglich |
| `failed`      | Generierung fehlgeschlagen                  |

### Videostatus abfragen

```shellscript theme={null}
GET /v1/videos/{video_id}
```

Fragen Sie diese Schnittstelle ab, um zu prüfen, ob die Aufgabe abgeschlossen ist. Empfohlen wird eine Abfrage alle **15 Sekunden**.

#### **Beispielantwort (Generierung abgeschlossen – Tongyi Wanxiang)**

```json theme={null}
{
  "id": "eyJtb2RlbCI6IndhbjI...",
  "object": "video",
  "status": "completed",
  "model": "wan2.5-t2v-preview",
  "duration": 5,
  "width": 1920,
  "height": 1080,
  "url": "https://aihubmix.com/v1/videos/eyJtb2RlbCI6IndhbjI.../content",
  "error": null
}
```

#### **Beispielantwort (Generierung abgeschlossen – Sora)**

```json theme={null}
{
  "id": "eyJtb2RlbCI6InNvcmEtMi...",
  "object": "video",
  "created_at": 1772451930,
  "status": "completed",
  "completed_at": 1772452114,
  "expires_at": 1772538330,
  "model": "sora-2",
  "progress": 100,
  "prompt": "A cinematic drone shot over mountains",
  "seconds": "8",
  "size": "1280x720"
}
```

> Alle Modelle beurteilen den Abschlussstatus über `status == "completed"` und rufen dann die `/content`-Schnittstelle zum Herunterladen auf.

### Videoinhalt herunterladen

```shellscript theme={null}
GET /v1/videos/{video_id}/content
```

Sobald der Status `completed` ist, rufen Sie diese Schnittstelle auf, um die MP4-Videodatei herunterzuladen.

**Antwort**: Gibt direkt den binären Videostream zurück (`Content-Type: video/mp4`).

```shellscript theme={null}
curl https://aihubmix.com/v1/videos/{video_id}/content \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  --output my_video.mp4
```

> **Hinweis**: Der Video-Downloadlink ist in der Regel 24 Stunden gültig. Bitte zeitnah herunterladen und speichern.

### Videoaufgabe löschen

Diese Schnittstelle dient dazu, eine bereits erstellte Videoaufgabe zu löschen.

```shellscript theme={null}
DELETE /v1/videos/{video_id}
```

## Detaillierte Parameter der einzelnen Modelle

### **OpenAI Sora**

| Parameter        | Unterstützte Werte                                          |
| ---------------- | ----------------------------------------------------------- |
| Modell           | `sora-2`, `sora-2-pro`                                      |
| Dauer (seconds)  | `"4"` (Standard), `"8"`, `"12"`                             |
| Auflösung (size) | `720x1280` (Standard), `1280x720`, `1024x1792`, `1792x1024` |
| Bild-zu-Video    | Unterstützt, Bild über `input_reference` übergeben          |

> Hinweis: Der Parameter `seconds` wird bei allen Modellen einheitlich als String-Typ übergeben (z. B. `"8"`).

**Beispiel**

<CodeGroup>
  ```shellscript Sora theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "sora-2",
      "prompt": "A cinematic drone shot soaring over a misty mountain range at sunrise, golden light filtering through the clouds",
      "seconds": "8",
      "size": "1280x720"
    }'
  ```

  ```shellscript Sora Pro Hochformat-Video theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "sora-2-pro",
      "prompt": "A person walking through a neon-lit city street at night, rain reflecting on the pavement, cinematic lighting",
      "seconds": "12",
      "size": "720x1280"
    }'
  ```
</CodeGroup>

### Google Veo

| Parameter               | Unterstützte Werte                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Modell                  | `veo-3.1-generate-preview` (empfohlen), `veo-3.1-fast-generate-preview` (schnell), `veo-3.0-generate-preview`, `veo-2.0-generate-001`                                                                                                                                                                                                                                                                                                                       |
| Dauer (seconds)         | Veo 3/3.1: `"4"`, `"6"`, `"8"`; Veo 2: `"5"`\~`"8"` (Standard `"8"`)                                                                                                                                                                                                                                                                                                                                                                                        |
| Auflösung (size)        | `720p` (Standard), `1080p`, `4k` (4K nur Veo 3+), oder Pixelformat wie `1280x720`, `1920x1080`                                                                                                                                                                                                                                                                                                                                                              |
| Seitenverhältnis        | 16:9 (Standard), 9:16                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Bild-zu-Video (Veo 3.1) | **Erstes Bild**: `first_frame` (oder das kompatible Feld `input_reference`); **Letztes Bild**: `last_frame`; **Referenzbilder**: `reference_images` (Array, bis zu 3). Bilder akzeptieren eine öffentliche URL, eine base64-Data-URL oder ein `{"mime_type": "...", "data": "..."}`-Objekt. **Dauer**: Erstes-Bild / Erstes-und-letztes-Bild unterstützen `"4"`/`"6"`/`"8"`; bei Verwendung von Referenzbildern legt Google die Ausgabe fest auf 8 Sekunden |

**Beispiel**

<CodeGroup>
  ```shellscript Veo 3.1 theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-generate-preview",
      "prompt": "A tranquil Japanese garden, cherry blossom petals slowly drifting down, koi swimming in the pond, with the melodious sound of wind chimes in the background",
      "seconds": "8",
      "size": "1280x720"
    }'
  ```

  ```shellscript Veo 3.1 Fast theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-fast-generate-preview",
      "prompt": "Ocean waves crashing on rocky cliffs at sunset, seagulls flying overhead",
      "seconds": "8",
      "size": "1280x720"
    }'
  ```

  ```shellscript Erster & letzter Frame theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-generate-preview",
      "prompt": "The camera slowly pushes in from a valley at dawn, transitioning naturally into sunset",
      "seconds": "8",
      "size": "1280x720",
      "first_frame": "https://example.com/first.jpg",
      "last_frame": "https://example.com/last.jpg"
    }'
  ```

  ```shellscript Referenzbilder (bis zu 3) theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-generate-preview",
      "prompt": "The character from the reference images walks through a forest, cinematic shot",
      "seconds": "8",
      "size": "1280x720",
      "reference_images": [
        "https://example.com/ref1.jpg",
        "https://example.com/ref2.jpg"
      ]
    }'
  ```
</CodeGroup>

<Note>
  **Hinweise zu Bildfeldern**:

  * Vorrang beim ersten Bild: `first_frame` > `input_reference` (OpenAI-kompatibles Einzelbild).
  * Jedes Element von `first_frame` / `last_frame` / `reference_images` akzeptiert: eine öffentliche URL, eine base64-Data-URL (`data:image/png;base64,...`) oder ein `{"mime_type":"image/png","data":"<base64>"}`-Objekt.
  * Die OpenRouter-Aliasse `frame_images` (Elemente mit `frame_type: first_frame | last_frame`) und `input_references` werden ebenfalls akzeptiert.
  * Bis zu 3 Referenzbilder; bei Überschreitung wird 400 zurückgegeben.
</Note>

> Hinweis: Veo unterstützt native Audiogenerierung; Soundeffekte können im Prompt beschrieben werden, z. B. „im Hintergrund erklingt Vogelgezwitscher", „Klaviermelodie".

### Tongyi Wanxiang

| Parameter            | Unterstützte Werte                                                                                 |
| -------------------- | -------------------------------------------------------------------------------------------------- |
| Text-zu-Video-Modell | `wan2.6-t2v` (empfohlen), `wan2.5-t2v-preview`, `wan2.2-t2v-plus`                                  |
| Bild-zu-Video-Modell | `wan2.6-i2v` (empfohlen), `wan2.5-i2v-preview`, `wan2.2-i2v-plus`                                  |
| Dauer (seconds)      | je nach Modell (siehe Beschreibung unten), Standard `"5"`                                          |
| Auflösung (size)     | siehe Tabelle unten, Trennzeichen `x` und `*` jeweils möglich (z. B. `1920x1080` oder `1920*1080`) |
| Bild-zu-Video        | Bild-URL oder base64 über `input_reference` übergeben                                              |

**Von den einzelnen Modellen unterstützte Dauer**

| Modell                                      | mögliche seconds-Werte                       | Standardwert |
| :------------------------------------------ | :------------------------------------------- | :----------- |
| `wan2.6-t2v` / `wan2.6-i2v`                 | `"2"`\~`"15"` (beliebiger ganzzahliger Wert) | `"5"`        |
| `wan2.5-t2v-preview` / `wan2.5-i2v-preview` | `"5"` oder `"10"`                            | `"5"`        |
| `wan2.2-t2v-plus` / `wan2.2-i2v-plus`       | `"5"` (fest)                                 | `"5"`        |

**Unterstützte Auflösungen (Breite\*Höhe)**

| Auflösungsstufe | mögliche Auflösungen                                                             |
| :-------------- | :------------------------------------------------------------------------------- |
| 480P            | `832x480`, `480x832`, `624x624`                                                  |
| 720P            | `1280x720` (Standard), `720x1280`, `960x960`, `1088x832` (4:3), `832x1088` (3:4) |
| 1080P           | `1920x1080`, `1080x1920`, `1440x1440`, `1632x1248` (4:3), `1248x1632` (3:4)      |

> **Hinweis**: wan2.6 unterstützt nur 720P und 1080P; wan2.5 unterstützt 480P, 720P, 1080P; wan2.2 unterstützt nur 480P und 1080P.

**Beispiel**

<CodeGroup>
  ```shellscript Text-zu-Video theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.6-t2v",
      "prompt": "A winding stream flows through an autumn forest, golden fallen leaves drifting on the water surface, sunlight casting dappled light and shadow through the leaves",
      "seconds": "5",
      "size": "1920x1080"
    }'
  ```

  ```shellscript Bild-zu-Video theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.6-i2v",
      "prompt": "The character in the frame slowly turns their head and smiles, the camera slowly pushes in",
      "seconds": "5",
      "size": "1280x720",
      "input_reference": "https://example.com/my-image.jpg"
    }'
  ```
</CodeGroup>

> Hinweis: Versionen ab wan2.5 generieren standardmäßig Videos mit Ton (automatische Vertonung), chinesische Prompts liefern bessere Ergebnisse.

### Jimeng

| Parameter        | Unterstützte Werte                                                 |
| ---------------- | ------------------------------------------------------------------ |
| Modell           | `jimeng-3.0-pro` (empfohlen), `jimeng-3.0-1080p`                   |
| Dauer (seconds)  | `"5"` oder `"10"` (Standard `"5"`)                                 |
| Auflösung (size) | unterstützt Seitenverhältnis-Format oder Pixelformat               |
| Bild-zu-Video    | Unterstützt, Bild-URL oder base64 über `input_reference` übergeben |

**Unterstützte Seitenverhältnisse und zugehörige Auflösungen**

| Seitenverhältnis (size) | tatsächliche Auflösung |
| :---------------------- | :--------------------- |
| `16:9` oder `1920x1080` | 1920×1088              |
| `9:16` oder `1080x1920` | 1088×1920              |
| `4:3` oder `1664x1248`  | 1664×1248              |
| `3:4` oder `1248x1664`  | 1248×1664              |
| `1:1` oder `1440x1440`  | 1440×1440              |
| `21:9` oder `2176x928`  | 2176×928               |

**Beispiel**

<CodeGroup>
  ```shellscript Jimeng theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "jimeng-3.0-pro",
      "prompt": "A young woman in Hanfu dances gracefully amid a bamboo forest, her long dress flowing in the wind, with a faint morning mist in the background",
      "seconds": "5",
      "size": "16:9"
    }'
  ```

  ```Jimeng Hochformat theme={null}
  curl -X POST https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "jimeng-3.0-1080p",
      "prompt": "A sunset over the ocean, waves gently rolling, warm golden light",
      "seconds": "5",
      "size": "9:16"
    }'
  ```
</CodeGroup>

### Doubao Seedance

| Parameter                       | Unterstützte Werte                                                                                       |
| ------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Modell                          | `doubao-seedance-2-0-260128`, `doubao-seedance-2-0-fast-260128`                                          |
| Auflösung (resolution)          | `"480p"`, `"720p"` (Standard)                                                                            |
| Dauer (duration)                | Ganzzahl, Bereich `4`\~`15`, oder `-1` (Modell entscheidet automatisch)                                  |
| Seitenverhältnis (ratio)        | `"adaptive"` (Standard, automatische Anpassung), `"16:9"`, `"9:16"`, `"1:1"`, `"4:3"`, `"3:4"`, `"21:9"` |
| Video mit Ton (generate\_audio) | Standard `true`; auf `false` setzen, um ein stummes Video zu generieren                                  |
| Wasserzeichen (watermark)       | Standard `false`                                                                                         |
| Multimodale Referenz            | unterstützt Bild, Video, Audio                                                                           |

**Von `extra_body.content` unterstützte Referenztypen**

| Typ           | `type`-Wert | `role`-Wert       | Beschreibung                                  |
| ------------- | ----------- | ----------------- | --------------------------------------------- |
| Referenzbild  | `image_url` | `reference_image` | Bild-/Stilreferenzbild                        |
| Referenzvideo | `video_url` | `reference_video` | Referenzvideo für Kamerafahrt/Bildkomposition |
| Referenzaudio | `audio_url` | `reference_audio` | Audiodatei für Hintergrundmusik               |

**Beispiel**

```shellscript Seedance 2.0 / 2.0 Fast theme={null}
curl -X POST "https://aihubmix.com/v1/videos" \
  -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "prompt": "Use the first-person POV framing from Video 1 throughout, and use Audio 1 as the background music for the entire clip. Create a first-person fruit tea commercial featuring the Seedance brand limited-edition apple fruit tea, "Ping Ping An An." 

Opening frame: Image 1. From a first-person perspective, your hand picks a dew-covered Aksu red apple, accompanied by a crisp, satisfying bite-like tapping sound.

Seconds 2–4: Fast-paced cuts. Your hand drops freshly cut apple chunks into a shaker, adds ice and tea base, then shakes vigorously. The sound of ice clinking and shaking syncs with upbeat percussion. Background voiceover: "Freshly cut, freshly shaken."

Seconds 4–6: First-person close-up of the finished drink. The layered fruit tea is poured into a clear cup. Your hand gently squeezes a creamy topping across the surface. A pink label is placed on the cup. The camera pushes in to highlight the rich texture and layering.

Seconds 6–8: First-person hand holding the drink. You raise the fruit tea from Image 2 toward the camera, as if offering it directly to the viewer. The label is clearly visible. Background voiceover: "Take a refreshing sip."

Final frame: Freeze on Image 2. 

All background voiceovers should be in a female voice.",
    "extra_body": {
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic1.jpg"
          },
          "role": "reference_image"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic2.jpg"
          },
          "role": "reference_image"
        },
        {
          "type": "video_url",
          "video_url": {
            "url": "https://ark-project.tos-cn-beijing.volces.com/doc_video/r2v_tea_video1.mp4"
          },
          "role": "reference_video"
        },
        {
          "type": "audio_url",
          "audio_url": {
            "url": "https://ark-project.tos-cn-beijing.volces.com/doc_audio/r2v_tea_audio1.mp3"
          },
          "role": "reference_audio"
        }
      ],
      "ratio": "16:9",
      "duration": 11,
      "watermark": false
    }
  }'
```

### Kling

Kling unterstützt die vier Fähigkeiten **Text-zu-Video, Bild-zu-Video, Mehrbild-Referenz-Video und OmniVideo multimodal**, die alle einheitlich über die Schnittstelle `/v1/videos` aufgerufen werden. Das Gateway leitet anhand von „Modellname + Eingabeform" automatisch an den entsprechenden Kling-Endpunkt weiter, ohne dass der Aufrufer differenzieren muss.

| Fähigkeit                     | Modell                                                                                             |
| ----------------------------- | -------------------------------------------------------------------------------------------------- |
| Text-zu-Video / Bild-zu-Video | `kling-v1`, `kling-v1-5`, `kling-v1-6`, `kling-v2-1`, `kling-v2-5-turbo`, `kling-v2-6`, `kling-v3` |
| Mehrbild-Referenz             | `kling-v1-6`                                                                                       |
| OmniVideo multimodal          | `kling-video-o1`, `kling-v3-omni`                                                                  |

**Parameter**

| Parameter              | Typ    | Beschreibung                                                                                                                                          |
| ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                | string | **Pflicht**, `kling-*`, bestimmt Fähigkeit und Version                                                                                                |
| `prompt`               | string | Text-Prompt                                                                                                                                           |
| `negative_prompt`      | string | Negativer Prompt                                                                                                                                      |
| `mode`                 | string | Generierungsmodus: `std` (720P) / `pro` (1080P) / `4k`, Standard `std`                                                                                |
| `duration` / `seconds` | string | Dauer (Sekunden), alte Modelle `5`/`10`, neue Modelle `3`\~`15`, Standard `5`                                                                         |
| `aspect_ratio`         | string | Bildformat: `16:9` / `9:16` / `1:1` (bei reinem Text-zu-Video von omni sowie bei Videoreferenz Pflicht, bei Fehlen automatisch `16:9` ergänzt)        |
| `cfg_scale`            | float  | Prompt-Relevanz `[0, 1]`, Standard `0.5` (von `kling-v2.x` nicht unterstützt)                                                                         |
| `image`                | string | **Bild-zu-Video**: Einzelbild, Bild-URL oder Base64 (Base64 ohne Präfix `data:image/...;base64,`)                                                     |
| `image_tail`           | string | **Bild-zu-Video**: Endbild (optional)                                                                                                                 |
| `image_list`           | array  | **Mehrbild-Referenz**: Array von Bild-URLs, maximal 4 Bilder                                                                                          |
| `sound`                | string | **omni**: `on`/`off`, ob natives Audio generiert wird, Standard `off`                                                                                 |
| `video_list`           | array  | **omni**: Referenzvideo `[{ "video_url": "...", "refer_type": "feature" }]`, `refer_type` nimmt `feature` (Videoreferenz) / `base` (Videobearbeitung) |

<Note>
  Nicht unterstützte oder nicht zugeordnete Schlüsselparameter führen zu einem expliziten Fehler und werden nicht stillschweigend verworfen. Übrige native Kling-Parameter können in `extra_body` abgelegt und an das Upstream durchgereicht werden.
</Note>

**Beispiel**

<CodeGroup>
  ```shellscript Text-zu-Video theme={null}
  curl https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kling-v1-6",
      "prompt": "An orange cat running on a sunlit grassy meadow",
      "mode": "std",
      "duration": "5"
    }'
  ```

  ```shellscript Bild-zu-Video theme={null}
  curl https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kling-v1-6",
      "image": "https://example.com/first.png",
      "prompt": "The camera pulls back, the character smiles",
      "mode": "std",
      "duration": "5"
    }'
  ```

  ```shellscript Mehrbild-Referenz theme={null}
  curl https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kling-v1-6",
      "image_list": ["https://example.com/a.png", "https://example.com/b.png"],
      "prompt": "Two characters meet on the street",
      "mode": "std",
      "duration": "5"
    }'
  ```

  ```shellscript OmniVideo Referenzvideo theme={null}
  curl https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kling-v3-omni",
      "prompt": "Generate the next shot based on the reference video",
      "video_list": [{ "video_url": "https://example.com/in.mp4", "refer_type": "feature" }],
      "mode": "std",
      "duration": "5"
    }'
  ```

  ```shellscript OmniVideo natives Audio theme={null}
  curl https://aihubmix.com/v1/videos \
    -H "Authorization: Bearer $AIHUBMIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kling-v3-omni",
      "prompt": "A man smiles and says hello",
      "sound": "on",
      "aspect_ratio": "16:9",
      "duration": "5"
    }'
  ```
</CodeGroup>

**Beschreibung**

* **Asynchrone drei Schritte**: Übermitteln und `video_id` erhalten → `GET /v1/videos/{video_id}` abfragen, bis `status` auf `completed` steht → `GET /v1/videos/{video_id}/content` zum Herunterladen des MP4. Statuswerte: `in_progress` / `completed` / `failed`.
* Die Fertigstellung dauert in der Regel 1–3 Minuten; die URL des Ergebnisvideos wird **nach 30 Tagen gelöscht**, bitte zeitnah umspeichern.
* **Aufgabe löschen**: Kling hat keine Löschschnittstelle, `DELETE /v1/videos/{video_id}` gibt `501 not_supported` zurück.
* **Abrechnung**: Abrechnung nach Modell × `mode` × Dauer × Fähigkeit (mit/ohne Referenzvideo, mit/ohne Ton); **fehlgeschlagene Generierung wird nicht berechnet**, Abfrage und Download sind kostenlos.

## **Vollständiges Aufrufbeispiel**

<CodeGroup>
  ```python Tongyi Wanxiang theme={null}
  import requests
  import time

  API_KEY = "AIHUBMIX_API_KEY"
  BASE_URL = "https://aihubmix.com"
  HEADERS = {
      "Authorization": f"Bearer {API_KEY}",
      "Content-Type": "application/json"
  }

  # Schritt 1: Videogenerierungsaufgabe erstellen
  response = requests.post(
      f"{BASE_URL}/v1/videos",
      headers=HEADERS,
      json={
          "model": "wan2.6-t2v",
          "prompt": "A desert under a starry sky, a meteor streaking across the night sky, the glow of a distant campfire flickering in the breeze",
          "seconds": "5",
          "size": "1920x1080"
      }
  )
  result = response.json()
  video_id = result["id"]
  print(f"Aufgabe erstellt, video_id: {video_id}")

  # Schritt 2: Status abfragen
  while True:
      status_response = requests.get(
          f"{BASE_URL}/v1/videos/{video_id}",
          headers=HEADERS
      )
      status_data = status_response.json()
      current_status = status_data["status"]
      print(f"Aktueller Status: {current_status}")

      if current_status == "completed":
          print("Videogenerierung abgeschlossen!")
          break
      elif current_status == "failed":
          error_msg = status_data.get("error", {})
          if isinstance(error_msg, dict):
              error_msg = error_msg.get("message", "Unbekannter Fehler")
          print(f"Generierung fehlgeschlagen: {error_msg}")
          break

      time.sleep(15)  # alle 15 Sekunden abfragen

  # Schritt 3: Video herunterladen
  video_response = requests.get(
      f"{BASE_URL}/v1/videos/{video_id}/content",
      headers=HEADERS
  )
  with open("output.mp4", "wb") as f:
      f.write(video_response.content)
  print(f"Video gespeichert als output.mp4 ({len(video_response.content) / 1024 / 1024:.1f} MB)")
  ```

  ```python Sora theme={null}
  import requests
  import time

  API_KEY = "AIHUBMIX_API_KEY"
  BASE_URL = "https://aihubmix.com"
  HEADERS = {
      "Authorization": f"Bearer {API_KEY}",
      "Content-Type": "application/json"
  }

  # Videogenerierungsaufgabe erstellen
  response = requests.post(
      f"{BASE_URL}/v1/videos",
      headers=HEADERS,
      json={
          "model": "sora-2",
          "prompt": "A cinematic shot of a futuristic city at sunset, flying cars in the background",
          "seconds": "8",       # optional "4"/"8"/"12"
          "size": "1280x720"    # unterstützt 1280x720, 720x1280, 1024x1792, 1792x1024
      }
  )
  result = response.json()
  video_id = result["id"]
  print(f"Aufgabe erstellt, video_id: {video_id}")

  # Sora-Statusabfrage (möglicher Verlauf queued -> in_progress -> completed)
  while True:
      status_response = requests.get(
          f"{BASE_URL}/v1/videos/{video_id}",
          headers=HEADERS
      )
      status_data = status_response.json()
      current_status = status_data["status"]
      progress = status_data.get("progress", "")
      print(f"Status: {current_status}, Fortschritt: {progress}%")

      if current_status == "completed":
          print("Videogenerierung abgeschlossen!")
          break
      elif current_status == "failed":
          print(f"Generierung fehlgeschlagen: {status_data.get('error')}")
          break

      time.sleep(15)

  # Video herunterladen
  video_response = requests.get(
      f"{BASE_URL}/v1/videos/{video_id}/content",
      headers=HEADERS
  )
  with open("sora_output.mp4", "wb") as f:
      f.write(video_response.content)
  print("Video gespeichert als sora_output.mp4")
  ```

  ```javascript Node.js theme={null}
  const API_KEY = "your_aihubmix_api_key";
  const BASE_URL = "https://aihubmix.com";

  async function generateVideo() {
    // Schritt 1: Aufgabe erstellen (am Beispiel von Veo 3.1)
    const createResponse = await fetch(`${BASE_URL}/v1/videos`, {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        model: "veo-3.1-generate-preview",
        prompt: "A desert under a starry sky, a meteor streaking across the night sky",
        seconds: "8",
        size: "1280x720"
      })
    });
    const { id: videoId } = await createResponse.json();
    console.log(`Aufgabe erstellt: ${videoId}`);

    // Schritt 2: Status abfragen
    let status = "in_progress";
    while (status !== "completed" && status !== "failed") {
      await new Promise(resolve => setTimeout(resolve, 15000));
      const statusResponse = await fetch(`${BASE_URL}/v1/videos/${videoId}`, {
        headers: { "Authorization": `Bearer ${API_KEY}` }
      });
      const result = await statusResponse.json();
      status = result.status;
      console.log(`Aktueller Status: ${status}`);
    }

    if (status === "completed") {
      // Schritt 3: Video herunterladen
      const videoResponse = await fetch(`${BASE_URL}/v1/videos/${videoId}/content`, {
        headers: { "Authorization": `Bearer ${API_KEY}` }
      });
      const fs = require("fs");
      const buffer = Buffer.from(await videoResponse.arrayBuffer());
      fs.writeFileSync("output.mp4", buffer);
      console.log("Video gespeichert als output.mp4");
    }
  }

  generateVideo();
  ```
</CodeGroup>

## **FAQ**

### **Wie lange dauert die Videogenerierung?**

Die Videogenerierung dauert in der Regel 1–5 Minuten, die genaue Zeit hängt von Modell, Auflösung und Dauer ab. Empfohlen wird ein Abfrageintervall von 15 Sekunden.

### Wie verwendet man den Parameter `input_reference`?

`input_reference` wird im Bild-zu-Video-Szenario verwendet und unterstützt drei Übergabemethoden:

```json theme={null}
// Methode 1: Bild-URL direkt übergeben
"input_reference": "https://example.com/image.jpg"

// Methode 2: base64-kodiertes Bild übergeben (Objektformat)
"input_reference": {
  "mime_type": "image/jpeg",
  "data": "<BASE64_ENCODED_IMAGE>"
}

// Methode 3: data-URL übergeben
"input_reference": "data:image/jpeg;base64,<BASE64_ENCODED_IMAGE>"
```

### **Wie lange ist der Video-Downloadlink gültig?**

Der Downloadlink des generierten Videos ist in der Regel **24 Stunden** gültig. Bitte zeitnah herunterladen und speichern.

### Worin unterscheidet sich der Parameter `seconds` bei den einzelnen Modellen?

| Modell                                                        | mögliche Werte                       | Standardwert |
| ------------------------------------------------------------- | ------------------------------------ | ------------ |
| Sora (`sora-2` / `sora-2-pro`)                                | `"4"`, `"8"`, `"12"`                 | `"4"`        |
| Veo 3/3.1 (`veo-3.1-generate-preview` u. a.)                  | `"4"`, `"6"`, `"8"`                  | `"8"`        |
| Veo 2 (`veo-2.0-generate-001`)                                | `"5"`\~`"8"`                         | `"8"`        |
| Tongyi Wanxiang `wan2.6`                                      | `"2"`\~`"15"`                        | `"5"`        |
| Tongyi Wanxiang `wan2.5`                                      | `"5"`, `"10"`                        | `"5"`        |
| Tongyi Wanxiang `wan2.2`                                      | `"5"` (fest)                         | `"5"`        |
| Jimeng (`jimeng-3.0-pro` u. a.)                               | `"5"`, `"10"`                        | `"5"`        |
| Doubao Seedance (`doubao-seedance-2-0-*`)                     | Ganzzahl `duration4`\~`15` oder `-1` | `5`          |
| Kling neue Version (`kling-v2-x` / `kling-v3` u. a.)          | `"3"`\~`"15"`                        | `"5"`        |
| Kling alte Version (`kling-v1` / `kling-v1-5` / `kling-v1-6`) | `"5"`, `"10"`                        | `"5"`        |

\> **Hinweis**: Der Parameter `seconds` wird bei allen Modellen einheitlich als String-Typ übergeben (z. B. `"8"`), die API verarbeitet dies automatisch.

### Worin unterscheidet sich das Format des Parameters `size` bei den verschiedenen Modellen?

| Modell          | unterstützte size-Werte                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Sora            | `1280x720`, `720x1280`, `1024x1792`, `1792x1024`                                                                                                 |
| Veo             | Pixelformat (`1280x720` usw.) oder Auflösungslabel (`720p`, `1080p`, `4k`)                                                                       |
| Tongyi Wanxiang | Pixelformat, `x` und `*` jeweils möglich (z. B. `1920x1080` oder `1920*1080`)                                                                    |
| Jimeng          | Seitenverhältnis-Format (`16:9`, `9:16` usw.) oder Pixelformat                                                                                   |
| Doubao Seedance | Seitenverhältnis-Format (`"adaptive"`, `"16:9"`, `"9:16"` usw.)                                                                                  |
| Kling           | verwendet kein `size`, stattdessen `mode` (`std`/`pro`/`4k` steuert die Auflösung) + `aspect_ratio` (`16:9`/`9:16`/`1:1` steuert das Bildformat) |

### Worin unterscheiden sich `seconds` und `duration`?

Beide haben dieselbe Bedeutung und stehen für die Videodauer. Die API unterstützt beide Parameternamen (außer Sora, das nur `seconds` akzeptiert). Empfohlen wird die einheitliche Verwendung von `seconds`.

### Wie schreibt man bessere Prompts?

* **Konkrete Szene beschreiben**: enthält Subjekt, Aktion, Umgebung, Licht, Atmosphäre
* **Kamerasprache angeben**: z. B. „Nahaufnahme", „Luftaufnahme", „Heranfahren", „Zeitlupe"
* **Stil beschreiben**: z. B. „filmisch", „Dokumentarstil", „Animationsstil"
* **Bei chinesischen Modellen liefern chinesische Prompts bessere Ergebnisse**: Tongyi Wanxiang ist für Chinesisch optimiert
* **Veo unterstützt Audiobeschreibungen**: Klänge können im Prompt beschrieben werden, z. B. „Vogelgezwitscher", „Klaviermelodie"

### Was tun, wenn eine Aufgabe fehlschlägt?

Wenn `status` auf `failed` steht, enthält das Feld `error` in der Antwort die Fehlerinformation:

```json theme={null}
{
  "status": "failed",
  "error": {
    "message": "Video generation failed due to content policy violation",
    "type": "video_generation_error"
  }
}
```

## Häufige Fehlerursachen sind: Inhaltsverstoß, zu langer Prompt, nicht unterstütztes Bildformat usw. Bitte anhand der Fehlerinformation anpassen und erneut versuchen.

Zuletzt aktualisiert: 2026-06-01
