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://api.apimart.ai/v1/videos/generations"; String payload = """ { "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true } """; 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$url = "https://api.apimart.ai/v1/videos/generations";$payload = [ "model" => "skyreels-v4-fast", "prompt" => "A serene forest at sunset with golden light filtering through the trees.", "duration" => 5, "resolution" => "1080p", "aspect_ratio" => "16:9", "prompt_optimizer" => true];$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;?>
require 'net/http'require 'json'require 'uri'url = URI("https://api.apimart.ai/v1/videos/generations")payload = { model: "skyreels-v4-fast", prompt: "A serene forest at sunset with golden light filtering through the trees.", duration: 5, resolution: "1080p", aspect_ratio: "16:9", prompt_optimizer: true}http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request.body = payload.to_jsonresponse = http.request(request)puts response.body
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true]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()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://api.apimart.ai/v1/videos/generations"; var payload = @"{ ""model"": ""skyreels-v4-fast"", ""prompt"": ""A serene forest at sunset with golden light filtering through the trees."", ""duration"": 5, ""resolution"": ""1080p"", ""aspect_ratio"": ""16:9"", ""prompt_optimizer"": true }"; 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); }}
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://api.apimart.ai/v1/videos/generations"; String payload = """ { "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true } """; 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$url = "https://api.apimart.ai/v1/videos/generations";$payload = [ "model" => "skyreels-v4-fast", "prompt" => "A serene forest at sunset with golden light filtering through the trees.", "duration" => 5, "resolution" => "1080p", "aspect_ratio" => "16:9", "prompt_optimizer" => true];$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;?>
require 'net/http'require 'json'require 'uri'url = URI("https://api.apimart.ai/v1/videos/generations")payload = { model: "skyreels-v4-fast", prompt: "A serene forest at sunset with golden light filtering through the trees.", duration: 5, resolution: "1080p", aspect_ratio: "16:9", prompt_optimizer: true}http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request.body = payload.to_jsonresponse = http.request(request)puts response.body
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true]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()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://api.apimart.ai/v1/videos/generations"; var payload = @"{ ""model"": ""skyreels-v4-fast"", ""prompt"": ""A serene forest at sunset with golden light filtering through the trees."", ""duration"": 5, ""resolution"": ""1080p"", ""aspect_ratio"": ""16:9"", ""prompt_optimizer"": true }"; 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); }}
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://api.apimart.ai/v1/videos/generations"; String payload = """ { "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true } """; 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$url = "https://api.apimart.ai/v1/videos/generations";$payload = [ "model" => "skyreels-v4-fast", "prompt" => "A serene forest at sunset with golden light filtering through the trees.", "duration" => 5, "resolution" => "1080p", "aspect_ratio" => "16:9", "prompt_optimizer" => true];$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;?>
require 'net/http'require 'json'require 'uri'url = URI("https://api.apimart.ai/v1/videos/generations")payload = { model: "skyreels-v4-fast", prompt: "A serene forest at sunset with golden light filtering through the trees.", duration: 5, resolution: "1080p", aspect_ratio: "16:9", prompt_optimizer: true}http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request.body = payload.to_jsonresponse = http.request(request)puts response.body
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "skyreels-v4-fast", "prompt": "A serene forest at sunset with golden light filtering through the trees.", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "prompt_optimizer": true]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()
using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;class Program{ static async Task Main(string[] args) { var url = "https://api.apimart.ai/v1/videos/generations"; var payload = @"{ ""model"": ""skyreels-v4-fast"", ""prompt"": ""A serene forest at sunset with golden light filtering through the trees."", ""duration"": 5, ""resolution"": ""1080p"", ""aspect_ratio"": ""16:9"", ""prompt_optimizer"": true }"; 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); }}
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:
Strikte gegenseitige Ausschließlichkeit: I2V-Felder (first_frame_image / end_frame_image / mid_frame_images) und Omni-Felder (ref_images / ref_videos) können nicht zusammen verwendet werden, andernfalls wird 422 zurückgegeben.
@tag-Mechanismus: Bei Verwendung von mid_frame_images / ref_images / ref_videos muss jedes Element ein tag deklarieren, das mit @ beginnt (z. B. @image1, @Actor-1, @video1), und dieser tagmuss im prompt vorkommen.Stellen Sie sich prompt als „Drehbuch” und tag als „Zeiger auf eine Figur” für bestimmte Assets (Bilder / Videos) vor. Ein Prompt wie "@Actor-1 walks into the scene of @video1" weist das System beispielsweise an, das mit @Actor-1 verknüpfte Referenzbildsubjekt und die mit @video1 verknüpfte Bewegungsreferenz in den Generierungsprozess einzufügen.
Schlüsselaufnahmen, hohe Detailanforderungen, finale Lieferung
Das Feld model muss explizit angegeben werden — kein Standardwert.
Der Preis hängt stark von der Auflösung und der Verwendung von ref_videos ab: 1080p ist deutlich teurer als 480p / 720p; Varianten mit ref_videos (Videoeingabe) kosten ca. das 1,5- bis 2-fache im Vergleich zu denen ohne. Die gleichzeitige Audio- und Videoausgabe wird noch nicht unterstützt.
Text-Prompt, maximal 1280 TokensBeschreiben Sie Szenen, Subjekte, Aktionen und Stile detailliert für bessere Generierungsergebnisse.Bei Verwendung von ref_images / ref_videos / mid_frame_imagesmuss der entsprechende @tag (z. B. @Actor-1, @video1, @image1) im prompt enthalten sein.Beispiel: "@Actor-1 walks through a neon-lit street at night."
aspect_ratio wird im I2V-Modus ignoriert (das Ausgabeverhältnis wird durch das Eingabebild bestimmt); ebenfalls ignoriert, wenn Omni mit ref_videos kombiniert wird.
URL des letzten Einzelbildes (jpg / jpeg / png / gif / bmp)Wenn angegeben, wird dieses Bild als Endbild des Videos verwendet. Kann mit first_frame_image für die Steuerung von Erst- und Endbild kombiniert werden.
reference – Bewegungs-/Subjektreferenz, überschreibt duration (folgt der Länge des Referenzvideos, maximal 10 Sekunden), übernimmt standardmäßig das Audio des Eingabevideos; kann mit ref_images.type=image kombiniert werden
extend – Videoverlängerung, Abrechnung nach angefordertem duration; kann nicht mit ref_images kombiniert werden
{ "model": "skyreels-v4-fast", "prompt": "Slowly pull the camera back to reveal the entire scene.", "first_frame_image": "https://example.com/start.png", "duration": 5}
Fall 6: Omni — Mehrere Subjekte + Video-Bewegungsreferenz
{ "model": "skyreels-v4-fast", "prompt": "The man from @image_1 imitates the move on the left in @video_1. The woman from @image_2 imitates the right side.", "duration": 5, "ref_images": [ { "tag": "@image_1", "type": "image", "image_urls": ["https://example.com/a.png"] }, { "tag": "@image_2", "type": "image", "image_urls": ["https://example.com/b.png"] } ], "ref_videos": [ { "tag": "@video_1", "type": "reference", "video_url": "https://example.com/motion.mp4" } ]}
In diesem Fall wird ref_videos.type=reference verwendet, daher wird der angeforderte duration durch die tatsächliche Länge des Referenzvideos überschrieben (maximal 10 Sekunden). Auch wenn hier "duration": 5 übergeben wird, richtet sich die endgültige Videolänge nach dem Referenzvideo.
{ "model": "skyreels-v4-fast", "prompt": "Create a video showing how to make tomato and egg noodles based on @image1.", "ref_images": [ { "tag": "@image1", "type": "grid", "image_urls": ["https://example.com/recipe_grid.png"] } ]}
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.