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-v3",
    "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-v3",
    "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 Authentifizierung per Bearer TokenAPI-Schlüssel abrufen:Besuchen Sie die Seite zur API-Schlüsselverwaltung, um Ihren API-Schlüssel zu erhaltenFügen Sie ihn dem Anfrage-Header hinzu:
Authorization: Bearer YOUR_API_KEY

Anfrageparameter

model
string
erforderlich
Name des VideogenerierungsmodellsUnterstützte Modelle:
  • kling-v3 — Kling v3 (empfohlen)
prompt
string
erforderlich
TextpromptBeschreiben Sie Szenen, Aktionen und Stile detailliert für bessere Generierungsergebnisse. Englische Prompts werden empfohlen.Beispiel: "a golden retriever running on the beach, sunset, cinematic"
negative_prompt
string
Negativer Prompt, um unerwünschte Inhalte auszuschließenBeispiel: "blurry, low quality, distorted"
mode
string
Standard:"std"
GenerierungsmodusOptionen:
  • std — Standardmodus (720P)
  • pro — Profimodus (1080P)
  • 4k — 4K-Modus
Standard: std
duration
integer
Standard:"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
Standard:"16:9"
Seitenverhältnis des VideosOptionen:
  • 16:9 — Querformat
  • 9:16 — Hochformat
  • 1:1 — Quadrat
Standard: 16:9
image_urls
array<url>
Array mit Bild-URLs für die Image-to-Video-Generierung
  • 1 Bild übergeben: wird als erstes Bild verwendet
  • 2 Bilder übergeben: werden automatisch als erstes Bild + letztes Bild zugewiesen
Es werden maximal 2 Bilder unterstütztBeispiel: ["https://example.com/first.jpg"]
  • Maximal 2 Bilder unterstützt
  • 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
watermark
boolean
Ob ein Wasserzeichen hinzugefügt werden soll
audio
boolean
Standard:"false"
Ob das Video mit Audio generiert werden soll
multi_shot
boolean
Standard:"false"
Ob der Multi-Shot-Modus aktiviert werden soll.
  • true
  • false
shot_type
string
Methode zur Shot-Aufteilung: customize / intelligence.Erforderlich, wenn multi_shot=true.
multi_prompt
array<object>
Informationen pro Shot, z. B. Prompt und Dauer.Definieren Sie Reihenfolge, Prompt und Dauer der Shots über index, prompt und duration.
  • Unterstützt 1 bis 6 Shots
  • Maximale Inhaltslänge pro Shot: 512
  • Jede Shot-Dauer muss >= 1 sein und darf die Gesamtdauer der Aufgabe nicht überschreiten
  • Die Summe aller Shot-Dauern muss der duration auf oberster Ebene entsprechen
Format:
"multi_prompt": [
  { "index": 1, "prompt": "string", "duration": 5 },
  { "index": 2, "prompt": "string", "duration": 5 }
]
Erforderlich, wenn multi_shot=true und shot_type=customize.
element_list
array<object>
Liste der Referenzsubjekte, bis zu 3 Subjekte.
  • Werden direkt über name, description, element_input_urls erstellt
Beispiel:
[
  {
    "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 und element_input_urls erforderlich
  • element_input_urls: 2–4 Bilder pro Subjekt (erstes Bild als Frontalansicht, restliche als Referenzen)
  • Verweisen Sie im prompt mit @name auf Elemente, z. B. "@element_dog chasing @element_cat on grass"

Parameter-Einschränkungen

  • mode=4k wird für kling-v3 unterstützt
  • image_urls unterstützt bis zu 2 Bilder (1 erstes Bild, 2 erstes + letztes Bild)
  • Eingabe nur des letzten Bildes ist ungültig (muss das erste Bild enthalten)
  • Bei multi_shot=true kann der prompt auf oberster Ebene weggelassen werden
  • multi_prompt unterstützt bis zu 6 Shots, wobei index bei 1 beginnen und fortlaufend sein muss

Funktions-Support-Matrix

TypFunktionstd 5sstd 10sstd 15spro 5spro 10s
Text-to-VideoGenerierung
Image-to-VideoGenerierung
Image-to-VideoErstes Bild
Image-to-VideoLetztes Bild

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

Das System bestimmt den Modus automatisch anhand der Bereitstellung von image_urls: 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)
negative_prompt✅ Optional✅ Optional
mode✅ Optional✅ Optional
duration✅ Optional (3–15)✅ Optional (3–15)
aspect_ratio✅ Optional⚠️ Kann durch das Bildverhältnis überschrieben werden
watermark✅ Optional✅ Optional
audio✅ 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-v3",
  "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-v3",
  "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: Text-zu-Video (15 Sekunden)

{
  "model": "kling-v3",
  "prompt": "a time-lapse of a flower blooming in a garden",
  "duration": 15,
  "aspect_ratio": "16:9"
}

Fall 4: Bild-zu-Video (Erstes Bild)

{
  "model": "kling-v3",
  "prompt": "the cat slowly walks forward and looks around",
  "image_urls": ["https://example.com/cat.jpg"],
  "mode": "std",
  "duration": 5
}

Fall 5: Bild-zu-Video (Steuerung erstes + letztes Bild)

{
  "model": "kling-v3",
  "prompt": "smooth cinematic transition",
  "image_urls": [
    "https://example.com/frame-start.jpg",
    "https://example.com/frame-end.jpg"
  ],
  "mode": "std",
  "duration": 5
}

Fall 6: Video mit Audio generieren

{
  "model": "kling-v3",
  "prompt": "A rock singer singing on this stage, concert scene, flashing lights",
  "audio": true,
  "mode": "std",
  "duration": 5
}

Fall 7: Multi-Shot-Storyboard (customize, 15 Sekunden, Hochformat mit Audio)

{
  "model": "kling-v3",
  "multi_prompt": [
    {
      "index": 1,
      "prompt": "Two friends talking under a streetlight at night. Warm glow, casual poses, no dialogue.",
      "duration": 2
    },
    {
      "index": 2,
      "prompt": "A runner sprinting through a forest, leaves flying. Low-angle shot, focus on movement.",
      "duration": 3
    },
    {
      "index": 3,
      "prompt": "A woman hugging a cat, smiling. Soft sunlight, cozy home setting, emphasize warmth.",
      "duration": 3
    },
    {
      "index": 4,
      "prompt": "A door creaking open, shadowy hallway. Dark tones, minimal details, eerie mood.",
      "duration": 3
    },
    {
      "index": 5,
      "prompt": "A man slipping on a banana peel, shocked expression. Exaggerated pose, bright colors.",
      "duration": 3
    },
    {
      "index": 6,
      "prompt": "A sunset over mountains, small figure walking away. Wide angle, peaceful atmosphere.",
      "duration": 1
    }
  ],
  "multi_shot": true,
  "shot_type": "customize",
  "duration": 15,
  "mode": "pro",
  "audio": true,
  "size": "9:16"
}
Aufgabenergebnisse abfragenDie Videogenerierung ist eine asynchrone Aufgabe, die bei der Einreichung eine task_id zurückgibt. Verwenden Sie den Endpunkt Aufgabenstatus abrufen, um Fortschritt und Ergebnis abzufragen.