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); }}
Dos niveles de modelo: Fast (optimizado para velocidad) y Std (optimizado para calidad)
Tres modos enrutados automáticamente según los campos de la solicitud: Text-to-Video (T2V), Image-to-Video (I2V), Referencia multimodal (Omni)
Resolución 480p / 720p / 1080p, duración de 3 a 15 segundos
Funciones avanzadas: primer/último/fotograma clave, imágenes de referencia, videos de referencia, collage en cuadrícula, extensión de video, sincronización de audio
Modo de procesamiento asíncrono, devuelve un ID de tarea para consultas posteriores
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": "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 }'
import requestsurl = "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}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}response = requests.post(url, json=payload, headers=headers)print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";const 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};const headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"};fetch(url, { method: "POST", headers: headers, body: JSON.stringify(payload)}) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
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); }}
Todos los endpoints de la API requieren autenticación mediante Bearer TokenObtenga su API Key:Visite la página de gestión de API Keys para obtener su API KeyAñádala al encabezado de la solicitud:
SkyReels V4 se enruta automáticamente al modo correcto según los campos de la solicitud — no se necesita el campo mode:
Modo
Activador
Capacidad
T2V (Text-to-Video)
Solo prompt + campos generales
Generación basada únicamente en texto
I2V (Image-to-Video)
Cualquiera de first_frame_image / end_frame_image / mid_frame_images
Control de primer/último/fotograma clave
Omni (Referencia multimodal)
Cualquiera de ref_images / ref_videos
Referencia de sujeto, collage en cuadrícula, referencia de movimiento, extensión de video, sincronización de audio
Exclusión mutua estricta: los campos I2V (first_frame_image / end_frame_image / mid_frame_images) y los campos Omni (ref_images / ref_videos) no pueden usarse juntos; de lo contrario, se devuelve 422.
Mecanismo @tag: Al usar mid_frame_images / ref_images / ref_videos, cada elemento debe declarar un tag que comience con @ (por ejemplo, @image1, @Actor-1, @video1), y el tagdebe aparecer en el prompt.Piense en el prompt como un “guion” y en el tag como un “puntero de personaje” hacia activos específicos (imágenes / videos). Por ejemplo, un prompt como "@Actor-1 walks into the scene of @video1" indica al sistema que inyecte el sujeto de la imagen de referencia ligado a @Actor-1 y la referencia de movimiento ligada a @video1 en el proceso de generación.
Vistas previas rápidas, generación por lotes, contenido diario
skyreels-v4-std
Prioriza calidad (precio 25~30% superior al Fast)
Tomas clave, requisitos de alto detalle, entregas formales
El campo model debe proporcionarse explícitamente — no tiene valor por defecto.
El precio está fuertemente ligado a la resolución y al uso de ref_videos: 1080p es significativamente más caro que 480p / 720p; los niveles con ref_videos (entrada de video) cuestan ~1.5 ~ 2× en comparación con los que no lo usan. Aún no se admite la salida simultánea de audio y video.
Prompt de texto, máximo 1280 tokensDescriba escenas, sujetos, acciones y estilos en detalle para obtener mejores resultados.Al usar ref_images / ref_videos / mid_frame_images, el promptdebe contener el @tag correspondiente (por ejemplo, @Actor-1, @video1, @image1).Ejemplo: "@Actor-1 walks through a neon-lit street at night."
aspect_ratio se ignora en modo I2V (la proporción de salida la determina la imagen de entrada); también se ignora cuando Omni se combina con ref_videos.
URL de la imagen del último fotograma (jpg / jpeg / png / gif / bmp)Cuando se proporciona, esta imagen se utiliza como fotograma final del video. Puede combinarse con first_frame_image para el control de primer y último fotograma.
image - Imagen de referencia regular (longitud de lista 13; cada image_urls con longitud 15)
grid - Collage en cuadrícula, es decir, una sola imagen compuesta por múltiples mosaicos (por ejemplo, 2×2, 3×3); la longitud de la lista debe ser 1, image_urls debe ser 1 imagen
reference - Referencia de movimiento / sujeto, sobrescribe duration (sigue la longitud del video de referencia, máx. 10 segundos), incluye por defecto el audio del video de entrada; puede combinarse con ref_images.type=image
extend - Extensión de video, facturada según la duration solicitada; no puede combinarse con 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}
Caso 6: Omni - Multi-sujeto + referencia de movimiento por video
{ "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" } ]}
Este caso usa ref_videos.type=reference, por lo que la duration solicitada será sobrescrita por la longitud real del video de referencia (máx. 10 segundos). Aunque aquí se pase "duration": 5, la duración final del video sigue la del video de referencia.
{ "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"] } ]}
Consultar resultados de la tareaLa generación de video es una tarea asíncrona que devuelve un task_id al enviarse. Use el endpoint Obtener estado de la tarea para consultar el progreso y los resultados de la generación.