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); }}
Dois níveis de modelo: Fast (otimizado para velocidade) e Std (otimizado para qualidade)
Três modos roteados automaticamente por campos da requisição: Text-to-Video (T2V), Image-to-Video (I2V), Multimodal Reference (Omni)
Resolução 480p / 720p / 1080p, duração de 3 a 15 segundos
Recursos avançados: primeiro/último/quadro-chave, imagens de referência, vídeos de referência, colagem em grade, extensão de vídeo, sincronização de áudio
Modo de processamento assíncrono, retorna um ID de tarefa para consulta posterior
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 os endpoints da API exigem autenticação via Bearer TokenObtenha sua chave de API:Acesse a página de gerenciamento de chaves de API para obter sua chave de APIAdicione ao cabeçalho da requisição:
O SkyReels V4 roteia automaticamente para o modo correto com base nos campos da requisição — nenhum campo mode é necessário:
Modo
Acionamento
Capacidade
T2V (Text-to-Video)
Apenas prompt + campos gerais
Geração orientada puramente por texto
I2V (Image-to-Video)
Qualquer um de first_frame_image / end_frame_image / mid_frame_images
Controle do primeiro/último/quadro-chave
Omni (Multimodal Reference)
Qualquer um de ref_images / ref_videos
Referência de personagem, colagem em grade, referência de movimento, extensão de vídeo, sincronização de áudio
Exclusão mútua estrita: campos I2V (first_frame_image / end_frame_image / mid_frame_images) e campos Omni (ref_images / ref_videos) não podem ser usados juntos, caso contrário retorna 422.
Mecanismo @tag: ao usar mid_frame_images / ref_images / ref_videos, cada elemento deve declarar uma tag começando com @ (por exemplo, @image1, @Actor-1, @video1), e a tagdeve aparecer no prompt.Pense no prompt como o “roteiro” e na tag como um “ponteiro de personagem” para ativos específicos (imagens / vídeos). Por exemplo, um prompt como "@Actor-1 walks into the scene of @video1" instrui o sistema a injetar o sujeito da imagem de referência vinculada a @Actor-1 e a referência de movimento vinculada a @video1 no processo de geração.
Pré-visualizações rápidas, geração em lote, conteúdo diário
skyreels-v4-std
Qualidade em primeiro lugar (preço 25~30% maior que Fast)
Tomadas-chave, requisitos de alto detalhe, entrega formal
O campo model deve ser explicitamente fornecido — sem valor padrão.
O preço está fortemente vinculado à resolução e ao uso de ref_videos: 1080p é significativamente mais caro que 480p / 720p; os níveis com ref_videos (entrada de vídeo) custam ~1,5 a 2× em comparação com os que não usam. Saída simultânea de áudio e vídeo ainda não é suportada.
Prompt de texto, máximo de 1280 tokensDescreva cenas, sujeitos, ações e estilos em detalhes para obter melhores resultados de geração.Ao usar ref_images / ref_videos / mid_frame_images, o promptdeve conter a @tag correspondente (por exemplo, @Actor-1, @video1, @image1).Exemplo: "@Actor-1 walks through a neon-lit street at night."
aspect_ratio é ignorado no modo I2V (a proporção de saída é determinada pela imagem de entrada); também é ignorado quando Omni é combinado com ref_videos.
URL da imagem do último quadro (jpg / jpeg / png / gif / bmp)Quando fornecida, esta imagem é usada como o quadro final do vídeo. Pode ser combinada com first_frame_image para controle do primeiro e do último quadro.
image - Imagem de referência regular (comprimento da lista 13; cada image_urls com comprimento 15)
grid - Colagem em grade, ou seja, uma única imagem composta por múltiplas peças (por exemplo, 2×2, 3×3); comprimento da lista deve ser = 1, image_urls deve ser 1 imagem
reference - Referência de movimento / sujeito, sobrescreve duration (segue a duração do vídeo de referência, máximo de 10 segundos), carrega o áudio do vídeo de entrada por padrão; pode ser combinado com ref_images.type=image
extend - Extensão de vídeo, cobrado pela duration solicitada; não pode ser combinado com 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 - Múltiplos sujeitos + referência de movimento por vídeo
{ "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, então a duration solicitada será sobrescrita pela duração real do vídeo de referência (máximo de 10 segundos). Mesmo que "duration": 5 seja passado aqui, a duração final do vídeo segue o vídeo de referência.
{ "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 da tarefaA geração de vídeos é uma tarefa assíncrona que retorna um task_id no envio. Use o endpoint Obter status da tarefa para consultar o progresso e os resultados da geração.