curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
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));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
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": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
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" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
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"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
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);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
HappyHorse
Pembuatan Video HappyHorse 1.1
- Model pembuatan video Alibaba Cloud Bailian HappyHorse 1.1 (entry terpadu, routing otomatis satu model)
- Melakukan routing otomatis berdasarkan parameter: T2V (hanya prompt) / I2V (first_frame_image) / R2V (image_urls)
- Mendukung resolusi 720P/1080P dan durasi bilangan bulat apa pun dari 3 hingga 15 detik
- Ditagih hanya berdasarkan resolusi × durasi (detik), terlepas dari kemampuan
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": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
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));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
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": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
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" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
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"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
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);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
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));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
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": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
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" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$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: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
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"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
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);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
Otorisasi
string
wajib
Semua endpoint API memerlukan autentikasi Bearer TokenDapatkan API Key Anda:Kunjungi Halaman Manajemen API Key untuk mendapatkan API Key AndaTambahkan ke header request:
Authorization: Bearer YOUR_API_KEY
Routing Mode
happyhorse-1.1 adalah entry terpadu untuk Teks-ke-Video / Gambar-ke-Video / Gambar-Referensi-ke-Video. Backend secara otomatis menentukan mode berdasarkan parameter yang masuk. Semua mode ditagih dengan aturan yang sama (hanya resolusi × detik):
| Field yang Anda kirim | Diarahkan Ke | Deskripsi Mode |
|---|---|---|
hanya prompt | Teks-ke-Video (T2V) | Membuat video murni dari teks |
prompt + first_frame_image | Gambar-ke-Video (I2V) | Menganimasikan dari gambar frame pertama |
prompt + image_urls (1–9 gambar) | Gambar-Referensi-ke-Video (R2V) | Membuat adegan baru dari gambar referensi |
first_frame_image > image_urls > hanya prompt.
Aturan saling eksklusif: dua field media (first_frame_image / image_urls) saling eksklusif. Mengirim dua field yang saling eksklusif secara bersamaan akan mengembalikan 400 mixed_media_not_allowed.
Parameter Request
string
wajib
Nama model pembuatan video, tetap sebagai
happyhorse-1.1boolean
default:"false"
Menentukan apakah moderasi konten dijalankan sebelum tugas video dikirim.
true: periksa prompt dan gambar input denganomni-moderation-latestfalseatau dihilangkan: tidak mengirim permintaan moderasi, tanpa biaya atau latensi moderasi tambahan (default)
string
Deskripsi konten video, hingga 2500 karakter; tidak boleh berisi token khususContoh:
"A little girl walking down the road, cinematic feel"string
Gambar frame pertama, memicu I2V (Gambar-ke-Video). Mendukung URL atau base64 (
data:image/<mime>;base64,<payload>, gateway mengunggahnya ke OSS secara otomatis)Saling eksklusif dengan image_urlsPersyaratan gambar frame pertama:
- Format: JPEG / JPG / PNG / BMP / WEBP
- Sisi pendek: ≥ 300px
- Rasio aspek:
1:2.5hingga2.5:1 - Ukuran file: ≤ 10MB
array<string>
Array gambar (Mode R2V): 1–9 gambar, digunakan sebagai referensi subjek/gaya untuk membuat adegan baruMendukung URL atau base64Saling eksklusif dengan
first_frame_imagePersyaratan gambar referensi:
- Format: JPEG / JPG / PNG / BMP / WEBP
- Sisi pendek: direkomendasikan ≥ 720p
- Rasio aspek: sisi pendek / sisi panjang ≥ 0.4
- Ukuran file: ≤ 10MB
- Jumlah: 1–9 gambar
string
default:"1080P"
Resolusi video (memengaruhi penagihan)Opsi:
720P- Standar1080P- Definisi tinggi (default)
integer
default:"5"
Durasi video dalam detik (memengaruhi penagihan)Rentang yang didukung: bilangan bulat apa pun dari
3 hingga 15Default: 5string
default:"16:9"
Rasio aspekFormat yang didukung:
16:9- Lanskap widescreen (default)9:16- Potret1:1- Persegi4:3- Lanskap3:4- Potret
Diabaikan dalam mode I2V — rasio aspek output ditentukan otomatis oleh media input (gambar frame pertama)
boolean
default:"false"
Apakah menambahkan watermark ke video yang dibuat
true: Tambahkan watermarkfalse: Jangan tambahkan watermark (default)
integer
Seed acak yang digunakan untuk mengontrol keacakan konten yang dibuatRentang nilai:
[0, 2147483647]. Jika dihilangkan, seed acak akan digunakan.- Untuk request yang identik, model menghasilkan hasil berbeda ketika menerima nilai seed berbeda (misalnya seed dihilangkan)
- Untuk request yang identik, model menghasilkan hasil mirip ketika menerima nilai seed yang sama, tetapi konsistensi persis tidak dijamin
Respons
integer
Kode status respons, 200 jika berhasil
array
Kasus Penggunaan
Kasus 1: Teks-ke-Video T2V (Request Paling Sederhana)
{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel"
}
Kasus 2: Teks-ke-Video T2V (Parameter Lengkap)
{
"model": "happyhorse-1.1",
"prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 8,
"seed": 42
}
Kasus 3: Gambar-ke-Video I2V (first_frame_image)
{
"model": "happyhorse-1.1",
"prompt": "Bring the scene in the image to life",
"first_frame_image": "https://example.com/first_frame.png",
"resolution": "1080P",
"duration": 5
}
Kasus 4: Gambar-Referensi-ke-Video R2V (beberapa referensi)
{
"model": "happyhorse-1.1",
"prompt": "The protagonist from image 1 runs through the scene from image 2, then picks up the prop from image 3. Keep a 3D cartoon style with smooth motion.",
"image_urls": [
"https://example.com/img_01.jpg",
"https://example.com/img_02.png",
"https://example.com/img_03.jpeg"
],
"resolution": "1080P",
"size": "16:9",
"duration": 5
}
Kasus 5: 720P untuk Menghemat Biaya
{
"model": "happyhorse-1.1",
"prompt": "Waves crashing on the beach at sunset",
"resolution": "720P",
"size": "16:9",
"duration": 5
}
Panduan Pemilihan Mode
| Kebutuhan | Pendekatan yang Direkomendasikan |
|---|---|
| Membuat video hanya dari teks | Kirim hanya prompt (T2V) |
| Membuat gambar “hidup” (menggunakannya sebagai frame pertama) | Kirim first_frame_image (I2V) |
| Membuat adegan baru dari sekumpulan gambar referensi | Kirim image_urls (1–9, R2V) |
| Menghemat biaya | Gunakan resolution: "720P" |
Tips Penggunaan
- Logika entry terpadu: field input menentukan mode. Perhatikan bahwa dua field media (
first_frame_image/image_urls) saling eksklusif sizehanya efektif di T2V/R2V: dalam mode I2V,sizediabaikan — rasio aspek output ditentukan oleh media input- Durasi: 5–10 detik adalah rentang yang ideal. Terlalu pendek menyebabkan gerakan patah-patah; terlalu panjang meningkatkan waktu pemrosesan upstream secara signifikan
- Kualitas gambar frame pertama: jelas, komposisi baik, subjek berada di tengah — sangat meningkatkan output I2V
- Penulisan prompt: jelaskan gerakan / kamera / suasana (mis. “slow push-in, cinematic, warm tones”) untuk hasil yang lebih baik daripada deskripsi adegan statis saja
Kueri Hasil TugasPembuatan video adalah tugas asinkron yang mengembalikan
task_id saat dikirim. Gunakan endpoint Dapatkan Status Tugas untuk mengueri progres dan hasil pembuatan.