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

# FLUX 3 Videogenerierung

>  - Asynchroner Verarbeitungsmodus, gibt eine Task-ID für spätere Abfragen zurück
- Einheitlicher Einstieg: Text-to-Video / Image-to-Video / Videofortsetzung / Draft-Zweistufig
- Ausgabe H.264 + AAC mit synchronem Audio, Dauer 5~20 Sekunden
- Auflösung hd / fhd, sieben Seitenverhältnisse 

```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": "flux-3-video",
    "prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
    "duration": 5,
    "resolution": "hd",
    "aspect_ratio": "16:9"
  }'
```

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

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

payload = {
    "model": "flux-3-video",
    "prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
    "duration": 5,
    "resolution": "hd",
    "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: "flux-3-video",
  prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
  duration: 5,
  resolution: "hd",
  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":        "flux-3-video",
        "prompt":       "An orange cat jumps onto a sunlit wooden table",
        "duration":     5,
        "resolution":   "hd",
        "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))
}
```

```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": "Parameter conflict or invalid value",
    "type": "invalid_request_error"
  }
}
```

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

## Autorisierung

**Authorization** `string` *required*

Alle Endpunkte erfordern eine Bearer-Token-Authentifizierung

Holen Sie Ihren API-Key von der [API-Key-Verwaltungsseite](https://gccai.heqingsong.uk/keys):

```
Authorization: Bearer YOUR_API_KEY
```

## Generierungsmodi

`flux-3-video` ist ein **einheitlicher Einstieg**: Der Modus wird aus den Feldern abgeleitet oder explizit mit `mode` gesetzt.

| Modus | Auslöser | Hinweise |
| - | - | - |
| **Text-to-Video (t2v)** | nur `prompt` | Reiner Text |
| **Image-to-Video (i2v)** | `image_urls` | Keyframes; siehe unten |
| **Videofortsetzung (v2v)** | `video_url` / `video_urls` | Höherer Stückpreis; bei Bild und Video gewinnt Fortsetzung |
| **Draft → Final** | `draft:true` oder `draft_from_task_id` | Günstige Vorschau, dann Final zum vollen Preis |

`mode`-Werte: `t2v` / `i2v` / `v2v` / `draft_enhance` oder offizielle Schreibweisen `text-to-video` / `image-continuation` / `video-continuation`. **Explizites `mode` hat höchste Priorität.**

### Image-to-Video-Keyframe-Semantik

Die Reihenfolge in `image_urls` ist semantisch — nicht sortieren oder deduplizieren:

| Anzahl | Bedeutung |
| - | - |
| 1 | **Startframe** |
| 2 | Erster Start, zweiter **Endframe** |
| 3\~10 | Erster Start, letzter Ende, mittlere Frames **gleichmäßig verteilt** (`duration` explizit setzen) |

## Anfrageparameter

**model** `string` *required*

Fester Wert: `flux-3-video`

**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*

Prompt. **Darf nicht gesendet werden**, wenn `draft_from_task_id` verwendet wird (wird abgelehnt).

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

Dauer in Sekunden, Ganzzahl **5\~20**, Standard `5`

> [!WARNING]
>
> **`duration: "auto"` wird nicht unterstützt** (Abrechnung braucht eine feste Sekundenzahl). Weglassen, `"auto"` oder Nicht-Ganzzahlen → als **5 Sekunden** behandelt, ohne Fehler und ohne adaptive Länge.

> [!NOTE]
>
> Bei **Videofortsetzung** kann die gelieferte Dauer kürzer sein als angefordert (z. B. Anfrage 5 s, Ergebnis 4 s). Die angeforderten Sekunden werden vorab belastet und die Differenz nach Abschluss erstattet; Endbetrag ist Query-`cost`. Text/Image-to-Video zeigen diese Lücke nicht.

**resolution** `string` (default: hd)

Auflösung

* `hd` (Standard; akzeptiert auch `720p`)
* `fhd` (akzeptiert auch `1080p`)

Gemessen: `hd` \~1280×704 bei 16:9; `fhd` \~1920×1088.

> [!WARNING]
>
> Draft-Modus (`draft:true`) erlaubt **nur** `hd`.

**aspect\_ratio** `string` (default: auto)

Seitenverhältnis

Optionen: `21:9`, `2:1`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16` oder `auto` (Standard; wird aus Prompt und Assets automatisch gewählt)

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

Image-to-Video-Keyframes, **1\~10**, öffentliche http(s)-URL oder Base64

**video\_url** `string`

Eingabevideo für Fortsetzung (mp4, öffentliche URL oder Base64)

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

Wie `video_url`; verwendet das **erste** Element (Kompatibilität)

**audio** `boolean` (default: true)

Synchrones Audio erzeugen, Standard `true`. `false` ergibt stummes Video (**kein Rabatt**)

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

Draft-Modus: \~**1/3 Preis** niedrige Vorschauqualität; nur mit `resolution: hd`

**draft\_from\_task\_id** `string`

Draft → Final: ID **Ihrer** erfolgreichen Draft-Aufgabe

* Nur `resolution` darf geändert werden; Prompt, Dauer, Bilder, Video nicht
* Zum vollen Finalpreis abgerechnet; Draft-Gebühr wird nicht angerechnet
* Gegenseitig ausschließend mit `draft:true`

**safety\_tolerance** `integer` (default: 2)

Moderations-Toleranz **0\~4**, Standard `2` (höher = permissiver)

> [!NOTE]
>
> Nicht mit FLUX.2-Bildern (0~~5) oder Kontext (0~~6) verwechseln.

**mode** `string`

Expliziter Modus (optional); siehe Generierungsmodi

## Draft-Modus

Zweistufiger Workflow, wenn Iteration teuer ist:

```
Step 1  draft:true            → ~1/3 Preis niedrige Vorschauqualität
Step 2  draft_from_task_id    → Final zum vollen Preis mit Draft-Look
```

### Draft erstellen

```json theme={null}
{
  "model": "flux-3-video",
  "prompt": "An orange cat jumps onto a sunlit wooden table",
  "duration": 5,
  "draft": true
}
```

### Draft zu Final

```json theme={null}
{
  "model": "flux-3-video",
  "draft_from_task_id": "task_01K_DRAFT...",
  "resolution": "fhd"
}
```

Beim Übergang vom Draft zum Final wird in voller Qualität mit den gespeicherten Draft-Parametern (Modus / Prompt / Seed / Assets) gerendert. Fortsetzungs-Drafts finalisieren zu Fortsetzungs-Finalpreisen.

## Anfragebeispiele

### Text-to-Video (Hochformat)

```json theme={null}
{
  "model": "flux-3-video",
  "prompt": "Rainy Tokyo street at night, neon in puddles, a person walks with an umbrella.",
  "duration": 8,
  "resolution": "fhd",
  "aspect_ratio": "9:16"
}
```

### Image-to-Video (Start + Endframe)

```json theme={null}
{
  "model": "flux-3-video",
  "prompt": "Slow push-in as a flower opens from bud to bloom",
  "image_urls": [
    "https://example.com/bud.jpg",
    "https://example.com/bloom.jpg"
  ],
  "duration": 5
}
```

### Videofortsetzung

```json theme={null}
{
  "model": "flux-3-video",
  "prompt": "Camera keeps following as the lead turns toward a distant lighthouse",
  "video_url": "https://example.com/clip.mp4",
  "duration": 5
}
```

### Stummes Video

```json theme={null}
{
  "model": "flux-3-video",
  "prompt": "...",
  "audio": false
}
```

## Einschränkungen

| Limit | Wert |
| - | - |
| Dauer | Ganzzahl 5\~20 (`auto` nicht unterstützt; `21` wird abgelehnt) |
| Keyframes | 1\~10 |
| Auflösung | nur `hd` / `fhd`; Draft nur `hd` |
| Seitenverhältnis | Sieben Optionen oder `auto` |
| `safety_tolerance` | 0\~4 |

### Häufige Submit-Fehler (meist nicht berechnet)

| Fall | Hinweise |
| - | - |
| Fehlendes `prompt` | Erforderlich außer bei Draft-Finalisierung |
| Ungültige `resolution` / `aspect_ratio` / `duration` | Außerhalb des Bereichs |
| Keyframes > 10 | Obergrenze überschritten |
| Explizites `i2v` ohne Bilder / `v2v` ohne Video | Modus/Asset-Mismatch |
| `draft:true` + `fhd` | Draft nur hd |
| Ungültige / Nicht-Draft / unfertige `draft_from_task_id` | Finalisierungs-Vorbedingungen |
| Prompt / Dauer bei Finalisierung ändern | Nur `resolution` erlaubt |
| Sowohl `draft` als auch `draft_from_task_id` | Gegenseitig ausschließend |

Moderationsfehler enden als `failed` mit **voller Rückerstattung**.

## Funktionsabdeckung

| Fähigkeit | Status |
| - | - |
| t2v / i2v / v2v | ✅ Auto oder explizites `mode` |
| Draft / Draft-Finalisierung | ✅ `draft` / `draft_from_task_id` |
| Synchrones Audio | ✅ Standard an; `audio:false` aus (kein Rabatt) |
| Zeitgesteuerte Keyframes `[Sekunden, Bild]` | ❌ Nur gleichmäßig verteiltes Keyframe-Array |
| `duration: "auto"` | ❌ Nicht unterstützt |

## Response

**code** `integer`

Statuscode; 200 bei Erfolg

**data** `array`

Antwortdaten-Array

**Array-Elemente**

**status** `string`

Task-Status; bei Erstellung `submitted`

**task\_id** `string`

Task-ID zum Abfragen

> [!NOTE]
>
> **Ergebnisse abfragen**
>
> Die Videogenerierung ist asynchron. Abfragen Sie [Aufgabenstatus abrufen](https://gccai.heqingsong.uk/de/api-reference/tasks/status.md).
>
> Empfohlenes Intervall **5\~10 Sekunden**; Client-Timeout **15 Minuten** (20 s fhd ist langsamer). Gemessen \~60 s für `t2v` + `hd` + 5 s.
>
> Bei Erfolg `result.videos[0].url` verwenden; Assets werden auf das Plattform-CDN gespiegelt. `cost` ist der Endbetrag. Bei Fehlern volle Rückerstattung.


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