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

# Kling v3 Omni Videogenerierung

>  - Asynchroner Verarbeitungsmodus, gibt eine Task-ID für nachfolgende Abfragen zurück
- Einheitliche Text-to-Video- / Image-to-Video-Schnittstelle mit Bildreferenz-Syntax
- Unterstützt Standardmodus (720P), Profimodus (1080P) und 4K-Modus
- Bilder im Prompt mit der Syntax image_N referenzieren
- Unterstützt die Generierung von Videos mit Audio (schließt video_list aus) 

```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": "kling-v3-omni",
    "prompt": "Make the person in <<<image_1>>> wave at the camera",
    "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
```

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

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

payload = {
    "model": "kling-v3-omni",
    "prompt": "Make the person in <<<image_1>>> wave at the camera",
    "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
    "mode": "std",
    "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://gccai.heqingsong.uk/v1/videos/generations";

const payload = {
  model: "kling-v3-omni",
  prompt: "Make the person in <<<image_1>>> wave at the camera",
  image_urls: ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
  mode: "std",
  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));
```

```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":        "kling-v3-omni",
        "prompt":       "Make the person in <<<image_1>>> wave at the camera",
        "image_urls":   []string{"https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"},
        "mode":         "std",
        "duration":     5,
        "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": "kling-v3-omni",
          "prompt": "Make the person in <<<image_1>>> wave at the camera",
          "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
          "mode": "std",
          "duration": 5,
          "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" => "kling-v3-omni",
    "prompt" => "Make the person in <<<image_1>>> wave at the camera",
    "image_urls" => ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
    "mode" => "std",
    "duration" => 5,
    "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: "kling-v3-omni",
  prompt: "Make the person in <<<image_1>>> wave at the camera",
  image_urls: ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
  mode: "std",
  duration: 5,
  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": "kling-v3-omni",
    "prompt": "Make the person in <<<image_1>>> wave at the camera",
    "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
    "mode": "std",
    "duration": 5,
    "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"": ""kling-v3-omni"",
            ""prompt"": ""Make the person in <<<image_1>>> wave at the camera"",
            ""image_urls"": [""https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp""],
            ""mode"": ""std"",
            ""duration"": 5,
            ""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_xxxxxxxxxx"
    }
  ]
}
```

```json 400 theme={null}
{
  "error": {
    "code": 400,
    "message": "Invalid request parameters",
    "type": "invalid_request_error"
  }
}
```

```json 401 theme={null}
{
  "error": {
    "code": 401,
    "message": "Invalid authentication credentials",
    "type": "authentication_error"
  }
}
```

```json 402 theme={null}
{
  "error": {
    "code": 402,
    "message": "Insufficient balance. Please top up your account",
    "type": "payment_required"
  }
}
```

```json 429 theme={null}
{
  "error": {
    "code": 429,
    "message": "Rate limit exceeded. Please try again later",
    "type": "rate_limit_error"
  }
}
```

```json 500 theme={null}
{
  "error": {
    "code": 500,
    "message": "Internal server error. Please try again later",
    "type": "server_error"
  }
}
```

## Autorisierung

**Authorization** `string` *required*

Alle API-Endpunkte erfordern eine Authentifizierung per Bearer Token

API-Schlüssel abrufen:

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

Fügen Sie ihn dem Anfrage-Header hinzu:

```
Authorization: Bearer YOUR_API_KEY
```

## Anfrageparameter

**model** `string` *required*

Name des Videogenerierungsmodells

Unterstützte Modelle:

* `kling-v3-omni` — Kling v3 Omni (einheitliche Schnittstelle)

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

Positiver Textprompt

Unterstützt das Referenzieren von Bildern aus `image_urls` mit der Syntax `<<<image_N>>>`, wobei `N` bei 1 beginnt.

Beispiel: `"Make the person in <<<image_1>>> wave at the camera"`

> [!NOTE]
>
> Wenn Bilder bereitgestellt werden, der Prompt aber keine `<<<image_N>>>`-Referenz enthält, fügt das System automatisch `<<<image_1>>>` an den Anfang des Prompts an.

**negative\_prompt** `string`

Negativer Prompt zum Ausschluss unerwünschter Inhalte. Maximale Länge: 2500 Zeichen.

**mode** `string` (default: std)

Generierungsmodus

Optionen:

* `std` — Standardmodus (720P)
* `pro` — Profimodus (1080P)
* `4k` — 4K Ultra-HD-Modus

Standard: `std`

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

Standard: `5`
Videodauer (Sekunden)

Bereich: 3–15 (mindestens 3 Sekunden, maximal 15 Sekunden)

**⚠️ Hinweis:** Muss eine einfache Zahl sein (z. B. `6`), keine Anführungszeichen, sonst tritt ein Fehler auf

**aspect\_ratio** `string` (default: 16:9)

Seitenverhältnis des Videos

Optionen:

* `16:9` — Querformat
* `9:16` — Hochformat
* `1:1` — Quadrat

Standard: `16:9`

**image\_urls** `array\<url\>`

Array mit Bild-URLs für Bildreferenzen

Referenzieren Sie die entsprechenden Bilder im Prompt mit der Syntax `<<<image_N>>>` (N beginnt bei 1)

Beispiel: `["https://example.com/photo.jpg"]`

> [!WARNING]
>
> * Bild-URLs müssen öffentlich zugänglich sein, ohne Hotlink-Schutz
> * Im Image-to-Video-Modus kann `aspect_ratio` durch das tatsächliche Seitenverhältnis des Bildes überschrieben werden

**image\_with\_roles** `array\<object\>`

Rollenbasiertes Bild-Array, empfohlen für Image-to-Video.

Format jedes Elements: `{ "url": "...", "role": "..." }`

* `first_frame`: erstes Bild
* `last_frame`: letztes Bild
* `reference`: Referenzbild

> [!WARNING]
>
> `image_urls` und `image_with_roles` schließen sich gegenseitig aus. Verwenden Sie nur eines davon.

**video\_list** `array`

Liste der Referenzvideos (URL-basiert), bis zu 1 Video.

Verwenden Sie `refer_type`, um Typen zu unterscheiden:

* `base`: zu bearbeitendes Video (Standard)
* `feature`: Feature-Referenzvideo

Verwenden Sie `keep_original_sound`, um den Originalton zu steuern:

* `no`: nicht behalten (Standard)
* `yes`: Originalton behalten

Anfrageformat:

```json theme={null}
"video_list":[
  { "video_url": "video_url", "refer_type": "base", "keep_original_sound": "no" }
]
```

> [!WARNING]
>
> * `video_url` darf nicht leer sein, und die Video-URL muss zugänglich sein
> * Bei `refer_type=base`:
>   * Erste/letzte Bilder können nicht definiert werden
>   * Das Referenzvideo muss 3–10 Sekunden lang sein
>   * Die Dauer des erzeugten Videos richtet sich nach dem hochgeladenen Video
> * Bei `refer_type=feature` und nicht leerer `video_url`:
>   * `image_urls` darf nur ein Bild für das erste Bild enthalten
> * Video-Anforderungen: Nur MP4/MOV; mindestens 3 Sekunden Dauer; Auflösung 720–2160 px; Bildrate 24–60 fps (Ausgabe ist 24 fps); maximal 200 MB Größe

**multi\_shot** `boolean` (default: false)

Ob der Multi-Shot-Modus aktiviert werden soll.

**shot\_type** `string`

Methode zur Shot-Aufteilung: `customize` / `intelligence`.

Erforderlich, wenn `multi_shot=true`.

**multi\_prompt** `array\<object\>`

Multi-Shot-Liste, jedes Element ist `{ index, prompt, duration }`.

* Mindestens 1 Shot, maximal 6 Shots
* Jede Shot-`duration` muss eine ganze Zahl und >= 1 sein
* Die Summe aller Shot-Dauern muss der `duration` auf oberster Ebene entsprechen
* `index` muss bei 1 beginnen und fortlaufend ansteigen
* Erforderlich, wenn `multi_shot=true` und `shot_type=customize`

Beispiel:

```json theme={null}
[
  { "index": 1, "prompt": "a happy dog in running@element_cat", "duration": 3 },
  { "index": 2, "prompt": "a happy dog play with a cat@element_dog", "duration": 3 }
]
```

**element\_list** `array\<object\>`

Liste der Referenzsubjekte, bis zu 3 Subjekte. Unterstützt:

* Subjekte direkt mit `name`, `description`, `element_input_urls` erstellen

Allgemeines Format:

```json theme={null}
[
  {
    "name": "element_dog",
    "description": "a golden retriever, fluffy fur, friendly expression",
    "element_input_urls": [
      "https://example.com/image1.png",
      "https://example.com/image2.png"
    ]
  },
  {
    "name": "element_cat",
    "description": "an orange tabby cat, round face, bright eyes",
    "element_input_urls": [
      "https://example.com/image1.png",
      "https://example.com/image2.png"
    ]
  }
]
```

Hinweise:

* Für die direkte Erstellung sind `name`, `description`, `element_input_urls` erforderlich
* `element_input_urls`: 2 bis 4 Bilder pro Subjekt (erstes als Frontalansicht, andere als Referenzen)
* Verwenden Sie im `prompt` `@name`, z. B. `"@element_dog and @element_cat are playing on the grass"`

**watermark** `boolean`

Ob ein Wasserzeichen hinzugefügt werden soll

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

Ob das Video mit Audio generiert werden soll

> [!WARNING]
>
> Dieser Parameter schließt `video_list` aus.
>
> Wenn `video_list` einen Wert hat, ist der Parameter `audio` nicht erforderlich.

### Parameter-Einschränkungen und -Grenzen

* `image_urls` und `image_with_roles` schließen sich gegenseitig aus
* `mode=4k` ist für `kling-v3-omni` verfügbar
* Eingabe nur des letzten Bildes (`last_frame` ohne erstes Bild) ist ungültig
* Erste/letzte Bilder und Videobearbeitung schließen sich gegenseitig aus: Bei `video_list.refer_type=base` (oder weggelassen) sind erste/letzte Bilder nicht zulässig
* Wenn `video_list` vorhanden ist, wird `audio` ignoriert
* `video_list` unterstützt maximal 1 Video
* `multi_prompt` unterstützt bis zu 6 Shots, wobei `index` bei 1 beginnt und fortlaufend ansteigt

## Bildreferenz-Syntax

Das Omni-Modell verwendet die Syntax `<<<image_N>>>`, um Bilder in Prompts zu referenzieren, und bietet so ein einheitliches Text-to-Video- / Image-to-Video-Erlebnis:

| Syntax | Beschreibung |
| - | - |
| `<<<image_1>>>` | Verweist auf das 1. Bild im Array `image_urls` |
| `<<<image_2>>>` | Verweist auf das 2. Bild im Array `image_urls` |

> [!NOTE]
>
> **Automatische Referenz**: Wenn `image_urls` bereitgestellt wird, der Prompt aber keine `<<<image_N>>>`-Referenz enthält, fügt das System automatisch `<<<image_1>>>` an den Anfang des Prompts an.

## Antwort

**code** `integer`

Statuscode der Antwort, 200 bei Erfolg

**data** `array`

Datenarray der Antwort

**Array-Elemente**

**status** `string`

Task-Status, `submitted` bei der ersten Einreichung

**task\_id** `string`

Eindeutige Task-ID zur Abfrage von Status und Ergebnis

## Anwendungsfälle

### Fall 1: Text-zu-Video (Standardmodus)

```json theme={null}
{
  "model": "kling-v3-omni",
  "prompt": "A golden retriever running on the beach, sunset, cinematic",
  "mode": "std",
  "duration": 5,
  "aspect_ratio": "16:9"
}
```

### Fall 2: Bildreferenz (einzelnes Bild)

```json theme={null}
{
  "model": "kling-v3-omni",
  "prompt": "Make the person in <<<image_1>>> wave at the camera",
  "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
  "mode": "pro",
  "duration": 5
}
```

### Fall 3: Mehrere Bildreferenzen

```json theme={null}
{
  "model": "kling-v3-omni",
  "prompt": "The character in <<<image_1>>> walks toward the scene in <<<image_2>>>",
  "image_urls": [
    "https://example.com/character.jpg",
    "https://example.com/scene.jpg"
  ],
  "mode": "pro",
  "duration": 5
}
```

### Fall 4: Bild ohne explizite Referenz bereitgestellt (automatisch hinzugefügt)

```json theme={null}
{
  "model": "kling-v3-omni",
  "prompt": "The person slowly turns and smiles",
  "image_urls": ["https://upload.gccai.ai/f/models/9998230426123070-e9d6af04-cb5e-4731-8ae7-abf144cb0d29-9998230586368386-29641169-f698-4ab9-9b6d-380899e6521e-9998230593110693-c1741a3a-.webp"],
  "mode": "std",
  "duration": 5
}
```

> Das System fügt `<<<image_1>>>` automatisch am Anfang des Prompts hinzu, was `"<<<image_1>>>The person slowly turns and smiles"` entspricht.

### Fall 5: Video mit Audio generieren

```json theme={null}
{
  "model": "kling-v3-omni",
  "prompt": "A yellow canary singing on a branch",
  "audio": true,
  "mode": "std",
  "duration": 5
}
```

> **Hinweis**: `audio` schließt `video_list` aus. Wenn `video_list` einen Wert hat, ist der Parameter `audio` nicht erforderlich.

> [!NOTE]
>
> **Aufgabenergebnisse abfragen**
>
> Die Videogenerierung ist eine asynchrone Aufgabe, die bei der Einreichung eine `task_id` zurückgibt. Verwenden Sie den Endpunkt [Aufgabenstatus abrufen](https://gccai.heqingsong.uk/de/api-reference/tasks/status.md), um Fortschritt und Ergebnis abzufragen.


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