# El campo model puede ser "veo3.1-fast" o el alias compatible "veo3.1-fast-ext"curl --request POST \ --url https://api.apimart.ai/v1/videos/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"] }'
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]]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"": ""veo3.1-fast"", ""prompt"": ""Dolphins leaping in the azure ocean"", ""duration"": 8, ""aspect_ratio"": ""16:9"", ""image_urls"": [""https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png""] }"; 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); }}
(* Requires cohttp and yojson libraries *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://api.apimart.ai/v1/videos/generations"let payload = {|{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://api.apimart.ai/v1/videos/generations'); final payload = { 'model': 'veo3.1-fast', 'prompt': 'Dolphins leaping in the azure ocean', 'duration': 8, 'aspect_ratio': '16:9', 'image_urls': ['https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png'] }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', }, body: jsonEncode(payload), ); print(response.body);}
{ "error": { "code": 500, "message": "Internal server error. Please try again later", "type": "server_error" }}
{ "error": { "code": 502, "message": "Bad gateway. The server is temporarily unavailable", "type": "bad_gateway" }}
VEO3
Generación de video VEO3
Modo de procesamiento asíncrono, devuelve un ID de tarea para consultas posteriores
Admite varios modos de generación, incluyendo texto-a-video e imagen-a-video
Admite salida en resolución 4K
Los enlaces de los videos generados son válidos durante 24 horas, guárdelos lo antes posible
POST
/
v1
/
videos
/
generations
# El campo model puede ser "veo3.1-fast" o el alias compatible "veo3.1-fast-ext"curl --request POST \ --url https://api.apimart.ai/v1/videos/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"] }'
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]]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"": ""veo3.1-fast"", ""prompt"": ""Dolphins leaping in the azure ocean"", ""duration"": 8, ""aspect_ratio"": ""16:9"", ""image_urls"": [""https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png""] }"; 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); }}
(* Requires cohttp and yojson libraries *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://api.apimart.ai/v1/videos/generations"let payload = {|{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://api.apimart.ai/v1/videos/generations'); final payload = { 'model': 'veo3.1-fast', 'prompt': 'Dolphins leaping in the azure ocean', 'duration': 8, 'aspect_ratio': '16:9', 'image_urls': ['https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png'] }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', }, body: jsonEncode(payload), ); print(response.body);}
{ "error": { "code": 500, "message": "Internal server error. Please try again later", "type": "server_error" }}
{ "error": { "code": 502, "message": "Bad gateway. The server is temporarily unavailable", "type": "bad_gateway" }}
Aviso de compatibilidad de nombres de modelo: Esta interfaz también admite los alias veo3.1-fast-ext (equivalente a veo3.1-fast), veo3.1-quality-ext (equivalente a veo3.1-quality) y veo3.1-lite-ext (equivalente a veo3.1-lite); cada alias y su modelo son intercambiables y producen los mismos resultados.
# El campo model puede ser "veo3.1-fast" o el alias compatible "veo3.1-fast-ext"curl --request POST \ --url https://api.apimart.ai/v1/videos/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"] }'
import Foundationlet url = URL(string: "https://api.apimart.ai/v1/videos/generations")!let payload: [String: Any] = [ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]]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"": ""veo3.1-fast"", ""prompt"": ""Dolphins leaping in the azure ocean"", ""duration"": 8, ""aspect_ratio"": ""16:9"", ""image_urls"": [""https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png""] }"; 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); }}
(* Requires cohttp and yojson libraries *)open Lwtopen Cohttpopen Cohttp_lwt_unixlet url = "https://api.apimart.ai/v1/videos/generations"let payload = {|{ "model": "veo3.1-fast", "prompt": "Dolphins leaping in the azure ocean", "duration": 8, "aspect_ratio": "16:9", "image_urls": ["https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png"]}|}let () = let headers = Header.init () |> fun h -> Header.add h "Authorization" "Bearer <token>" |> fun h -> Header.add h "Content-Type" "application/json" in let body = Cohttp_lwt.Body.of_string payload in let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) -> body |> Cohttp_lwt.Body.to_string >|= fun body_str -> print_endline body_str in Lwt_main.run response
import 'dart:convert';import 'package:http/http.dart' as http;void main() async { final url = Uri.parse('https://api.apimart.ai/v1/videos/generations'); final payload = { 'model': 'veo3.1-fast', 'prompt': 'Dolphins leaping in the azure ocean', 'duration': 8, 'aspect_ratio': '16:9', 'image_urls': ['https://cdn.apimart.ai/doc/9998238783208208-9972597b-255d-4e7e-9649-e6ee38a837aa-image_task_01K88B53MTK41PP5KGDTG2PA5P_0.png'] }; final response = await http.post( url, headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', }, body: jsonEncode(payload), ); print(response.body);}
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 a la cabecera de la solicitud:
Nombre del modelo de generación de videoModelos disponibles:
veo3.1-fast - Modelo de generación rápida, adecuado para previsualizaciones e iteraciones rápidas (alias compatible veo3.1-fast-ext)
veo3.1-quality - Modelo de generación de alta calidad, adecuado para la producción final (alias compatible veo3.1-quality-ext)
veo3.1-lite - Modelo de generación ligero, adecuado para generación por lotes de bajo coste (alias compatible veo3.1-lite-ext)
Ejemplo: "veo3.1-fast"
Para mantener la compatibilidad con llamadas anteriores, los alias veo3.1-fast-ext (corresponde a veo3.1-fast), veo3.1-quality-ext (corresponde a veo3.1-quality) y veo3.1-lite-ext (corresponde a veo3.1-lite) siguen estando disponibles.
Si no se especifica, se determina según el número de imágenes: 2 imágenes para fotograma-a-video, 3 imágenes para imagen-de-referencia-a-videoNota: El modelo veo3.1-quality no admite el modo reference
El modelo veo3.1-lite no admite este parámetro, no lo envíe
Array de URLs de imagen de referencia para generación imagen-a-videoAdmite URLs de imagen accesibles públicamente (http:// o https://)Ejemplo: ["https://example.com/image.jpg"]Limitaciones:
Máximo de 3 imágenes
Para el modo fotograma-a-video: la primera imagen es el fotograma inicial, la segunda imagen es el fotograma final
Tamaño máximo del archivo: 10MB
Formatos admitidos: .jpeg, .jpg, .png, .webp
El modelo veo3.1-lite no admite este parámetro, no lo envíe