Zum Hauptinhalt springen
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v2-6",
    "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_xxxxxxxxxx"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kling-v2-6",
    "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
    "mode": "std",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_xxxxxxxxxx"
    }
  ]
}

Autorisierung

Authorization
string
erforderlich
Alle API-Endpunkte erfordern eine Bearer-Token-AuthentifizierungAPI-Key abrufen:Besuchen Sie die Seite zur API-Key-Verwaltung, um Ihren API-Key zu erhaltenFügen Sie ihn zum Request-Header hinzu:
Authorization: Bearer YOUR_API_KEY

Anfrageparameter

model
string
erforderlich
Name des VideogenerierungsmodellsUnterstützte Modelle:
  • kling-v2-6 – Kling v2.6 (empfohlen)
prompt
string
erforderlich
Text-Prompt, maximal 2500 ZeichenBeschreiben Sie Szenen, Aktionen und Stile detailliert für bessere GenerierungsergebnisseBeispiel: "A golden cat running on a sunlit meadow, slow motion, cinematic quality"
mode
string
Standard:"std"
GenerierungsmodusOptionen:
  • std – Standardmodus (720P, nur stummes Video)
  • pro – Profimodus (1080P, unterstützt automatische Audio-Generierung)
Standard: std
Einschränkung des Standardmodus: Der Modus std unterstützt nur stumme Videos. Der Parameter audio erfordert den Modus pro.
duration
integer
Standard:"5"
Videodauer (Sekunden)Optionen: 5 oder 10Standard: 5
aspect_ratio
string
Standard:"16:9"
Seitenverhältnis des VideosOptionen:
  • 16:9 – Querformat
  • 9:16 – Hochformat
  • 1:1 – Quadrat
Standard: 16:9
negative_prompt
string
Negativer Prompt zum Ausschluss unerwünschter InhalteBeispiel: "blurry, low quality, distorted"
image_urls
array<url>
Array von Bild-URLs für die Image-to-Video-Generierung
  • 1 Bild übergeben: wird als Erstbild verwendet
  • 2 Bilder übergeben: werden automatisch als Erstbild + letztes Einzelbild zugewiesen (erfordert mode: "pro")
Maximal 2 Bilder unterstütztBeispiel: ["https://example.com/first.jpg"]
  • Maximal 2 Bilder unterstützt
  • Letztes Einzelbild (2 Bilder) erfordert nur den Modus pro; der Modus std unterstützt nur das Erstbild (1 Bild)
  • Letztes Einzelbild und Audio schließen sich gegenseitig aus: Im Modus pro können letztes Einzelbild (2 Bilder) und Audio (audio: true) nicht zusammen verwendet werden
  • Im Image-to-Video-Modus kann aspect_ratio durch das tatsächliche Bildverhältnis überschrieben werden
audio
boolean
Standard:"false"
Soll Audio automatisch generiert werden?Standard: false
  • Nur in mode: "pro" verfügbar
  • Schließt sich gegenseitig mit dem letzten Einzelbild aus: Audio kann nicht zusammen mit dem letzten Einzelbild (2 Bilder) verwendet werden
watermark
boolean
Soll ein Wasserzeichen hinzugefügt werden?

Funktionsunterstützungsmatrix

TypFunktionstd 5sstd 10spro 5spro 10s
Text-to-VideoGenerierung✅ (nur stumm)✅ (nur stumm)
Text-to-VideoAuto-Audio--
Image-to-VideoGenerierung✅ (nur stumm)✅ (nur stumm)
Image-to-VideoErstbild
Image-to-VideoLetztes Einzelbild--
Image-to-VideoAuto-Audio--
Hinweis: Im Modus pro schließen sich Steuerung des letzten Einzelbildes und Audio gegenseitig aus und können nicht zusammen verwendet werden.

Text-zu-Video (Text-to-Video) vs Bild-zu-Video (Image-to-Video)

Das System ermittelt den Modus automatisch danach, ob image_urls angegeben ist: ohne Bilder bedeutet Text-to-Video, mit Bildern bedeutet Image-to-Video.
ParameterText-to-VideoImage-to-Video
prompt✅ Erforderlich✅ Erforderlich
image_urls❌ Nicht verwendet✅ Erforderlich (1–2 Bilder, letztes Einzelbild benötigt pro)
negative_prompt✅ Optional✅ Optional
mode✅ Optional✅ Optional
duration✅ Optional✅ Optional
aspect_ratio✅ Optional⚠️ Kann durch Bildverhältnis überschrieben werden
audio✅ Optional (benötigt pro)✅ Optional (benötigt pro)
watermark✅ Optional✅ Optional

Antwort

code
integer
Statuscode der Antwort, 200 bei Erfolg
data
array
Datenarray der Antwort

Anwendungsfälle

Fall 1: Text-zu-Video (Standardmodus)

{
  "model": "kling-v2-6",
  "prompt": "A golden cat running on a sunlit meadow, slow motion, cinematic quality",
  "mode": "std",
  "duration": 5,
  "aspect_ratio": "16:9"
}

Fall 2: Text-zu-Video (Pro-Modus + negativer Prompt)

{
  "model": "kling-v2-6",
  "prompt": "Tokyo Shibuya crossing at night, neon lights reflected on wet ground, people walking with umbrellas",
  "negative_prompt": "blurry, low quality, distorted",
  "mode": "pro",
  "duration": 10,
  "aspect_ratio": "16:9"
}

Fall 3: Bild-zu-Video (Erstbild)

{
  "model": "kling-v2-6",
  "prompt": "The person in the frame turns and smiles",
  "image_urls": ["https://example.com/portrait.jpg"],
  "mode": "std",
  "duration": 5,
  "aspect_ratio": "16:9"
}

Fall 4: Bild-zu-Video (Steuerung Erst- + Endbild)

{
  "model": "kling-v2-6",
  "prompt": "City timelapse transitioning from day to night",
  "image_urls": ["https://example.com/day-city.jpg", "https://example.com/night-city.jpg"],
  "mode": "pro",
  "duration": 5
}

Fall 5: Pro-Modus + Auto-Audio

{
  "model": "kling-v2-6",
  "prompt": "Waves crashing against rocks, seagulls circling in the sky, lighthouse in the distance",
  "mode": "pro",
  "duration": 10,
  "audio": true,
  "aspect_ratio": "16:9"
}
Aufgabenergebnisse abfragenDie Videogenerierung ist eine asynchrone Aufgabe, die nach der Übermittlung eine task_id zurückgibt. Verwenden Sie den Endpunkt Aufgabenstatus abrufen, um den Generierungsfortschritt und die Ergebnisse abzufragen.