promptstringzorunlu
Text description of the desired video.
xai/grok-imagine-video/text-to-videoGrok Imagine Video by xAI - generate cinematic videos from text descriptions with AI. Create high-quality video content with natural motion, camera control, and optional audio generation.
Modeli deneyin
Sırada ne yapmak istersiniz?
Bir örnek seçerek girdilerini ve sonucunu playground'a yükleyin.
{
"prompt": "Anime schoolgirl bursting out of house door, cherry blossoms blowing, morning light, speed lines indicating rush, chibi-ready expressions, classic shojo aesthetic, vibrant colors"
}Grok Imagine Video turns a prompt into a 1–15 second clip with native audio.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 4,096 characters. |
resolution | 480p / 720p | 720p | Sets the per-second rate. |
duration | integer 1–15 | 6 | Output length in seconds. |
aspect_ratio | 16:9 / 4:3 / 3:2 / 1:1 / 2:3 / 3:4 / 9:16 | 16:9 | Output frame shape. |
$0.05 per output second.
| Output | Price |
|---|---|
| 6s (default) | $0.30 |
| 10s | $0.50 |
| 15s | $0.75 |
Failed runs are not charged.
Other Grok Imagine Video endpoints: xai/grok-imagine-video/image-to-video, xai/grok-imagine-video/reference-to-video, xai/grok-imagine-video/video-edit, xai/grok-imagine-video/video-extend, xai/grok-imagine-video/1.5/text-to-video (1.5, newer).
Geliştirmeye başlayın
Bu modeli SandBase Unified Run API üzerinden gönderin.
# 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": "xai/grok-imagine-video/text-to-video",
"prompt": "Anime schoolgirl bursting out of house door, cherry blossoms blowing, morning light, speed lines indicating rush, chibi-ready expressions, classic shojo aesthetic, vibrant colors",
"duration": 6,
"resolution": "720p",
"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"Bir SandBase API anahtarı oluşturun ve sunucu ortamınıza ayarlayın. Tüm istekler Bearer kimlik doğrulaması kullanır.
export SANDBASE_API_KEY="YOUR_API_KEY"Anahtarı sunucuda tutun. Tarayıcı kodunda açığa çıkarmayın veya bir depoya commit etmeyin.
Bu model kimliği ve girdileriyle /v1/run adresine POST gönderin. Yukarıdaki istek örneği gönderme ve yoklamayı içerir.
Durum completed, failed veya timeout olana kadar verilen run ID ile yoklama yapın. Çıktıyı yalnızca completed olduktan sonra okuyun.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Modelin image, video veya audio alanına herkese açık erişilebilir bir dosya URL'si verin. Desteklenen formatlar ve sınırlar her Playground girişinin yanında gösterilir.
Playground'daki desteklenen image alanlarında yükleme veya değiştirme kontrolünü kullanın. Video URL alanları barındırılan bir sürüş videosu kabul eder; video yükleme desteği anlamına gelmez.
promptstringzorunluText description of the desired video.
durationintegerVideo duration in seconds.
Varsayılan: 6
Minimum: 1
Maksimum: 15
resolutionstringResolution of the output video.
Varsayılan: "720p"
Olası değerler: "480p", "720p"
aspect_ratiostringThe aspect ratio of the generated image.
Varsayılan: "16:9"
Olası değerler: "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16"
{
"model": "xai/grok-imagine-video/text-to-video",
"prompt": "Anime schoolgirl bursting out of house door, cherry blossoms blowing, morning light, speed lines indicating rush, chibi-ready expressions, classic shojo aesthetic, vibrant colors",
"duration": 6,
"resolution": "720p",
"aspect_ratio": "16:9"
}Tamamlanan bir run, sonucunu output içinde gösterir. Aşağıdaki, modelin kaydedilmiş örneğidir; yeni bir üretim değildir.
[
{
"poster": "https://static.sandbase.ai/examples/posters/a3eef95c5f7288e57f7a.jpg",
"source": "xAI schema mirror",
"source_url": "https://docs.x.ai/",
"url": "https://static.sandbase.ai/examples/0bd87eb9-18fe-4dd1-bc10-a1480fcab6d9/output/3869cf9e-9063-413d-bdfe-43b343a78491.mp4"
}
]