promptstringआवश्यक
Describe the scene, action, camera and sound.
heygen/heygen-video/text-to-videoHeyGen Video Text to Video turns a text prompt into a 5-15 second video at up to 2K resolution.
model को आज़माएँ
आप आगे क्या करना चाहेंगे?
प्लेग्राउंड में इसके इनपुट और परिणाम लोड करने के लिए कोई उदाहरण चुनें।
{
"aspect_ratio": "16:9",
"prompt": "A red paper boat drifting on a calm misty lake at sunrise, gentle camera push-in, soft golden light, birds calling in the distance."
}{
"aspect_ratio": "16:9",
"prompt": "A street food vendor in a neon-lit night market flips noodles in a flaming wok, handheld camera, sizzling sounds and crowd chatter."
}HeyGen Video turns a text prompt into a 5–15 second video at up to 2K resolution.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Scene, action, camera and sound. |
aspect_ratio | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 | 16:9 | Output frame shape. |
resolution | 480p / 768p / 1080p / 2k | 768p | Output resolution; 1080p and 2k cost more. |
duration | 5–15 | 5 | Output length in seconds. |
Billed per output second: $0.02 at 480p, $0.036 at 768p, $0.06 at 1080p and 2k.
| Output | Price |
|---|---|
| 5s, 768p (default) | $0.18 |
| 5s, 480p | $0.10 |
| 10s, 1080p | $0.60 |
| 15s, 2k | $0.90 |
| Failed runs are not charged. |
Other HeyGen Video endpoints: heygen/heygen-video/image-to-video, heygen/heygen-video/reference-to-video.
बिल्डिंग शुरू करें
इस model को SandBase Unified Run API के माध्यम से सबमिट करें।
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "heygen/heygen-video/text-to-video",
"duration": 5,
"resolution": "768p",
"aspect_ratio": "16:9"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"एक SandBase API key बनाएँ और इसे अपने server environment में सेट करें। सभी requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"Key को सर्वर पर रखें। इसे browser code में expose न करें या repository में commit न करें।
इस model ID और इसके inputs के साथ /v1/run पर POST करें। ऊपर दिया गया request example submission और polling दोनों शामिल करता है।
Completed, failed या timeout होने तक poll करने के लिए लौटाए गए run ID का उपयोग करें। Output केवल completed होने के बाद पढ़ें।
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Model के image, video या audio field में सार्वजनिक रूप से उपलब्ध फ़ाइल URL पास करें। समर्थित formats और limits प्रत्येक Playground input के पास दिखाए गए हैं।
Playground में समर्थित image fields पर upload या replace control का उपयोग करें। Video URL fields hosted driving video स्वीकार करते हैं; इससे video-upload support का संकेत नहीं मिलता।
promptstringआवश्यकDescribe the scene, action, camera and sound.
durationintegerOutput length in seconds (5-15).
डिफ़ॉल्ट: 5
न्यूनतम: 5
अधिकतम: 15
resolutionstringOutput resolution. 1080p and 2k cost more.
डिफ़ॉल्ट: "768p"
संभावित मान: "480p", "768p", "1080p", "2k"
aspect_ratiostringOutput frame shape.
डिफ़ॉल्ट: "16:9"
संभावित मान: "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"
{
"model": "heygen/heygen-video/text-to-video",
"duration": 5,
"resolution": "768p",
"aspect_ratio": "16:9"
}पूरा हुआ run अपना परिणाम output में दिखाता है। नीचे दिया गया model का सेव किया हुआ example है, नई generation नहीं।
[
{
"url": "https://static.sandbase.ai/examples/4a216857-494e-49b6-9b49-c01514aba4e0/output/0d7b4a3b-a270-4519-8c48-e8cd3c7bdf4d.mp4"
}
]