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); }}
Semua endpoint API memerlukan autentikasi Bearer TokenDapatkan API Key Anda:Kunjungi Halaman Manajemen API Key untuk mendapatkan API Key AndaTambahkan ke header permintaan:
SkyReels V4 otomatis merutekan ke mode yang benar berdasarkan field permintaan — tanpa mode field diperlukan:
Mode
Pemicu
Kemampuan
T2V (Teks-ke-Video)
Hanya prompt + field umum
Pembuatan murni berbasis teks
I2V (Gambar-ke-Video)
Salah satu dari first_frame_image / end_frame_image / mid_frame_images
Kontrol frame pertama/akhir/kunci
Omni (Referensi Multimodal)
Salah satu dari ref_images / ref_videos
Subjek referensi, kolase grid, gerakan referensi, perpanjangan video, sinkronisasi audio
Saling eksklusif secara ketat: Field I2V (first_frame_image / end_frame_image / mid_frame_images) dan field Omni (ref_images / ref_videos) tidak dapat digunakan bersama, jika tidak akan mengembalikan 422.
Mekanisme @tag: Saat menggunakan mid_frame_images / ref_images / ref_videos, setiap elemen harus mendeklarasikan tag yang dimulai dengan @ (misalnya, @image1, @Actor-1, @video1), dan tagharus muncul di prompt.Anggap prompt sebagai “skrip” dan tag sebagai “penunjuk karakter” ke aset tertentu (gambar / video). Misalnya, prompt seperti "@Actor-1 walks into the scene of @video1" menginstruksikan sistem untuk memasukkan gambar referensi subjek yang ditautkan ke @Actor-1 dan gerakan referensi yang ditautkan ke @video1 ke dalam proses pembuatan.
Field model harus disediakan secara eksplisit — tidak ada nilai default.
Harga sangat terkait dengan resolusi dan apakah ref_videos digunakan: 1080p jauh lebih mahal daripada 480p / 720p; tier dengan ref_videos (input video) berbiaya ~1,5 ~ 2× dibandingkan yang tanpa itu. Output audio dan video secara bersamaan belum didukung.
Prompt teks, maksimum 1280 tokensJelaskan adegan, subjek, aksi, dan gaya secara detail untuk hasil pembuatan yang lebih baik.Saat menggunakan ref_images / ref_videos / mid_frame_images, promptharus berisi@tag terkait (misalnya, @Actor-1, @video1, @image1).Contoh: "@Actor-1 walks through a neon-lit street at night."
URL gambar frame akhir (jpg / jpeg / png / gif / bmp)Saat disediakan, gambar ini digunakan sebagai frame akhir video. Dapat dikombinasikan dengan first_frame_image untuk kontrol frame pertama dan terakhir.
reference - Referensi gerakan / subjek, menimpa duration (mengikuti durasi video referensi, maks. 10 detik), membawa audio video input secara default; dapat dikombinasikan dengan ref_images.type=image
extend - Perpanjangan video, ditagih berdasarkan duration; tidak dapat dikombinasikan dengan ref_images
{ "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}
Kasus 6: Omni - Multi-Subjek + Video Gerakan Referensi
{ "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" } ]}
Kasus ini menggunakan ref_videos.type=reference, sehingga ** duration akan ditimpa oleh durasi aktual video referensi** (maks. 10 detik). Meskipun "duration": 5 dikirim di sini, durasi video final mengikuti video referensi.
{ "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"] } ]}
Kueri Hasil TugasPembuatan video adalah tugas asinkron yang mengembalikan task_id saat dikirim. Gunakan endpoint Dapatkan Status Tugas untuk mengueri progres dan hasil pembuatan.