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); }}
Все эндпоинты API требуют аутентификации по Bearer TokenПолучение API Key:Перейдите на страницу управления API Key, чтобы получить ваш API KeyДобавьте в заголовок запроса:
SkyReels V4 автоматически выбирает корректный режим на основе полей запроса — поле mode не требуется:
Режим
Триггер
Возможности
T2V (Text-to-Video)
Только prompt + общие поля
Генерация полностью по тексту
I2V (Image-to-Video)
Любое из first_frame_image / end_frame_image / mid_frame_images
Управление первым/последним/ключевыми кадрами
Omni (мультимодальная ссылка)
Любое из ref_images / ref_videos
Опора на субъект, коллаж-сетка, опорное движение, продление видео, аудиосинхронизация
Строгое взаимоисключение: поля I2V (first_frame_image / end_frame_image / mid_frame_images) и поля Omni (ref_images / ref_videos) не могут использоваться вместе, иначе будет возвращён код 422.
Механизм @tag: при использовании mid_frame_images / ref_images / ref_videos каждый элемент должен содержать tag, начинающийся с @ (например, @image1, @Actor-1, @video1), и этот tagобязан появляться в prompt.Думайте о prompt как о «сценарии», а о tag — как об «указателе на персонаж/ресурс» для конкретных изображений/видео. Например, prompt вида "@Actor-1 walks into the scene of @video1" указывает системе встроить опорный субъект, связанный с @Actor-1, и опорное движение, связанное с @video1, в процесс генерации.
Ключевые кадры, высокая детализация, финальная поставка
Поле model обязательно — значения по умолчанию нет.
Цена тесно связана с разрешением и использованием ref_videos: 1080p существенно дороже, чем 480p / 720p; варианты с ref_videos (входное видео) стоят примерно в 1,5–2 раза больше по сравнению с вариантами без него. Одновременный вывод аудио и видео пока не поддерживается.
Текстовый промпт, максимум 1280 токеновПодробно описывайте сцены, субъектов, действия и стили для лучших результатов.При использовании ref_images / ref_videos / mid_frame_images в promptобязательно должен присутствовать соответствующий @tag (например, @Actor-1, @video1, @image1).Пример: "@Actor-1 walks through a neon-lit street at night."
aspect_ratio игнорируется в режиме I2V (соотношение сторон вывода определяется входным изображением); также игнорируется, когда Omni сочетается с ref_videos.
URL изображения для последнего кадра (jpg / jpeg / png / gif / bmp)При передаче изображение используется как конечный кадр видео. Можно комбинировать с first_frame_image для управления первым и последним кадрами.
image — обычное опорное изображение (длина списка 1–3; длина каждого image_urls 1–5)
grid — коллаж-сетка, то есть одно изображение, составленное из нескольких плиток (например, 2×2, 3×3); длина списка должна = 1, image_urls должно содержать 1 изображение
{ "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}
Сценарий 6: Omni — несколько субъектов + опорное движение из видео
{ "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" } ]}
В этом случае используется ref_videos.type=reference, поэтому запрошенный duration будет перекрыт фактической длительностью опорного видео (максимум 10 секунд). Хотя здесь передано "duration": 5, итоговая длительность видео будет следовать опорному видео.
{ "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"] } ]}
Запрос результатов задачиГенерация видео — асинхронная задача, которая при отправке возвращает task_id. Используйте эндпоинт Получение статуса задачи для запроса прогресса и результатов генерации.