# Le champ model peut valoir "veo3.1-fast" ou son 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
Génération vidéo VEO3
Mode de traitement asynchrone, renvoie un identifiant de tâche pour les requêtes ultérieures
Prend en charge plusieurs modes de génération, dont texte-vers-vidéo et image-vers-vidéo
Prend en charge la sortie en résolution 4K
Les liens des vidéos générées sont valides pendant 24 heures, veuillez les enregistrer rapidement
POST
/
v1
/
videos
/
generations
# Le champ model peut valoir "veo3.1-fast" ou son 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" }}
Alias de modèle compatible : cette API prend également en charge les alias veo3.1-fast-ext (équivalent à veo3.1-fast), veo3.1-quality-ext (équivalent à veo3.1-quality) et veo3.1-lite-ext (équivalent à veo3.1-lite) ; ils sont interchangeables avec leurs noms respectifs et produisent des résultats identiques.
# Le champ model peut valoir "veo3.1-fast" ou son 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);}
Tous les points de terminaison de l’API nécessitent une authentification par Bearer TokenObtenez votre API Key :Rendez-vous sur la page de gestion des API Keys pour obtenir votre API KeyAjoutez-la dans l’en-tête de la requête :
Nom du modèle de génération vidéoModèles disponibles :
veo3.1-fast — modèle de génération rapide, adapté aux prévisualisations et itérations rapides (alias compatible veo3.1-fast-ext)
veo3.1-quality — modèle de génération haute qualité, adapté à la production finale (alias compatible veo3.1-quality-ext)
veo3.1-lite — modèle de génération léger, adapté à la génération par lots à faible coût (alias compatible veo3.1-lite-ext)
Exemple : "veo3.1-fast"
Pour assurer la compatibilité avec les anciens appels, les alias veo3.1-fast-ext (correspondant à veo3.1-fast), veo3.1-quality-ext (correspondant à veo3.1-quality) et veo3.1-lite-ext (correspondant à veo3.1-lite) restent utilisables normalement.
reference — vidéo à partir d’une image de référence
Si non spécifié, défini par défaut en fonction du nombre d’images : 2 images pour image-vers-vidéo, 3 images pour vidéo à partir d’une image de référenceRemarque : le modèle veo3.1-quality ne prend pas en charge le mode reference
Le modèle veo3.1-lite ne prend pas en charge ce paramètre, ne le transmettez pas
Tableau d’URL d’images de référence pour la génération image-vers-vidéoPrend en charge les URL d’images accessibles publiquement (http:// ou https://)Exemple : ["https://example.com/image.jpg"]Limitations :
Maximum 3 images
Pour le mode image-vers-vidéo : la première image est l’image de début, la seconde est l’image de fin
Taille maximale du fichier : 10 Mo
Formats pris en charge : .jpeg, .jpg, .png, .webp
Le modèle veo3.1-lite ne prend pas en charge ce paramètre, ne le transmettez pas