promptstring必須
Text description of the desired video.
xai/grok-imagine-video/1.5/lite/text-to-videoGrok Imagine Video 1.5 Lite, the low-cost tier of xAI's video model, turns a text prompt into a 1-15 second video with native audio.
モデルを試す
Grok Imagine Video 1.5 Lite, the low-cost tier, turns a prompt into a 1–15 second clip with native audio.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 4,096 characters. |
aspect_ratio | 16:9 / 4:3 / 3:2 / 1:1 / 2:3 / 3:4 / 9:16 | 16:9 | Output frame shape. |
resolution | 480p / 720p / 1080p | 720p | Sets the per-second rate. |
duration | integer 1–15 | 6 | Output length in seconds. |
Per output second: $0.02 at 480p, $0.03 at 720p, $0.14 at 1080p.
| Output | 480p | 720p | 1080p |
|---|---|---|---|
| 6s (default) | $0.12 | $0.18 | $0.84 |
| 10s | $0.20 | $0.30 | $1.40 |
| 15s | $0.30 | $0.45 | $2.10 |
Failed runs are not charged.
Other Grok Imagine Video 1.5 endpoints: xai/grok-imagine-video/1.5/text-to-video, xai/grok-imagine-video/1.5/image-to-video, xai/grok-imagine-video/1.5/reference-to-video, xai/grok-imagine-video/1.5/lite/image-to-video, xai/grok-imagine-video/text-to-video (previous version).
開発を始める
このモデルを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": "xai/grok-imagine-video/1.5/lite/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"SandBaseのAPIキーを作成し、サーバー環境に設定してください。すべてのリクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開したり、リポジトリにコミットしたりしないでください。
このモデルIDと入力を使って /v1/run にPOSTしてください。上のリクエスト例には送信とポーリングが含まれています。
返されたrun IDを使って、ステータスがcompleted、failed、timeoutになるまでポーリングしてください。出力はcompleted後にのみ読み取ってください。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"モデルのimage、video、またはaudioフィールドに、公開アクセス可能なファイルURLを指定してください。対応形式と制限は各Playground入力の横に表示されます。
Playgroundの対応する画像フィールドでアップロードまたは置換を使用してください。video URLフィールドはホストされたドライビング動画を受け付けますが、動画アップロード対応を意味するものではありません。
promptstring必須Text description of the desired video.
durationintegerVideo duration in seconds.
デフォルト: 6
最小: 1
最大: 15
resolutionstringResolution of the output video.
デフォルト: "720p"
指定可能な値: "480p", "720p", "1080p"
aspect_ratiostringOutput aspect ratio.
デフォルト: "16:9"
指定可能な値: "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16"
{
"model": "xai/grok-imagine-video/1.5/lite/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"
}完了したrunの結果は出力に表示されます。以下はモデルに保存されたサンプルであり、新規生成ではありません。
[
{
"poster": "https://static.sandbase.ai/examples/posters/7858d7942becb20dfd96.jpg",
"source": "Self organization completed prediction",
"source_url": "https://www.sandbase.ai",
"url": "https://static.sandbase.ai/examples/c86fb725-4e1b-4c4e-acd0-8e5086dd493d/output/3c22babf-0352-4af5-89fb-45f501b2fa16.mp4"
}
]