Hailuo 02 Pro — text to video
MegaBrain API üzerinden Hailuo 02 Pro — text to video (Metinden videoya): video saniyesi başına $0.057. Tüm modeller için tek anahtar, dolar cinsinden ön ödemeli bakiyeden ödeme, abonelik yok.
minimax/hailuo-02-pro/text-to-videoSüre 6–6 sn; 6 saniyelik bir videonun fiyatı $0.342.
Görev kuyruğa alındığında düşülür, üretim başarısız olursa iade edilir.
Örnek çıktı
Tarayıcıda deneyin
Giriş yaptıktan sonra İngilizce sayfadaki playground Hailuo 02 Pro — text to video modelini tarayıcıda çalıştırır; ücret API ile aynı bakiyeden düşülür.
Playground’u açİstek parametreleri
İsteğin JSON gövdesindeki alanlar. Model başka alan kabul etmez: bunları içeren bir istek 400 hatası alır.
- promptmetinzorunlu
- prompt_optimizertrue / falseisteğe bağlı
API ile kullanım
Görevi gönderin, status_url COMPLETED olana kadar durumu sorgulayın, ardından sonucu response_url adresinden alın. Aynı anahtar ve bakiye metin modellerinde de geçerlidir. API belgeleri (İngilizce)
curl
curl -X POST https://getmegabrain.com/api/gateway/v1/queue/minimax/hailuo-02-pro/text-to-video \
-H "Authorization: Bearer $MEGABRAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"a slow dolly shot of a lighthouse at dawn, waves below"}'
# Then poll status_url and fetch the result from response_url:
curl https://getmegabrain.com/api/gateway/v1/queue/requests/$REQUEST_ID -H "Authorization: Bearer $MEGABRAIN_API_KEY"Python
import os, time, requests
BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}
job = requests.post(f"{BASE}/queue/minimax/hailuo-02-pro/text-to-video", headers=HEADERS, json={
"prompt": "a slow dolly shot of a lighthouse at dawn, waves below"
}).json()
while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
time.sleep(2)
print(requests.get(job["response_url"], headers=HEADERS).json())JavaScript
const BASE = 'https://getmegabrain.com/api/gateway/v1';
const headers = {
Authorization: `Bearer ${process.env.MEGABRAIN_API_KEY}`,
'Content-Type': 'application/json',
};
const job = await fetch(`${BASE}/queue/minimax/hailuo-02-pro/text-to-video`, {
method: 'POST',
headers,
body: JSON.stringify({
"prompt": "a slow dolly shot of a lighthouse at dawn, waves below"
}),
}).then(r => r.json());
let status = job.status;
while (status !== 'COMPLETED' && status !== 'FAILED') {
await new Promise(r => setTimeout(r, 2000));
({ status } = await fetch(job.status_url, { headers }).then(r => r.json()));
}
console.log(await fetch(job.response_url, { headers }).then(r => r.json()));Sık sorulan sorular
Hailuo 02 Pro — text to video API’si ne kadar?
video saniyesi başına $0.057: 6 saniyelik bir videonun fiyatı $0.342. Ücret dolar cinsinden ön ödemeli bakiyeden düşülür; başarısız bir üretim tamamen iade edilir. Abonelik yoktur.
Hailuo 02 Pro — text to video API ile nasıl kullanılır?
Görevi MegaBrain API anahtarınızla POST https://getmegabrain.com/api/gateway/v1/queue/minimax/hailuo-02-pro/text-to-video adresine gönderin, status_url COMPLETED olana kadar durumu sorgulayın ve sonucu response_url adresinden alın. Aynı anahtar ve bakiye metin modellerinde de geçerlidir.
Hailuo 02 Pro — text to video modelini kod yazmadan deneyebilir miyim?
Evet: giriş yaptıktan sonra modelin İngilizce sayfasındaki playground Hailuo 02 Pro — text to video modelini tarayıcıda çalıştırır; ücret API ile aynı bakiyeden düşülür.
Hailuo 02 Pro — text to video videosu en fazla ne kadar sürebilir?
6 saniye; duration alanıyla ayarlanır.