imagestring
Optional image to start the video from (upload or public HTTPS URL).
x-ai/grok-imagine-videoGrok Imagine Video by xAI makes a 1 to 15 second video with native audio at 480p or 720p from text, a first frame or up to 7 reference images, and edits or extends videos. Call it from this page, through /v1/run, or with the xAI Videos API at SandBase.
모델 사용해 보기
PNG, JPEG, WebP 또는 GIF · 최대 20 MiB
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 7
출력이 여기에 표시됩니다
입력을 완료한 다음 Run을 클릭하세요.
Grok Imagine Video is xAI's previous video model. It makes a 1 to 15 second clip with native audio at 480p or 720p from a prompt, a first frame, or up to 7 reference images, and it can also edit or extend an existing video. For 1080p and last frames, use Grok Imagine Video 1.5.
Use the form on this page, call x-ai/ through /v1/run, or call the xAI API below with model: grok-imagine-video. Both bill the same as xAI.
Pick one: text only, a first frame, or reference images (a first frame and reference images cannot be combined).
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string | — | Scene, motion, camera and sound. Required for text only. |
image | image | — | First frame. |
reference_images | image list, up to 7 | — | Characters, objects or styles to keep. Up to 10 seconds. |
duration | integer 1–15 | 8 | Output length in seconds. |
resolution | 480p / 720p | 480p | Sets the per-second rate. |
aspect_ratio | 16:99:161:14:33:43:22:321:95:2 | 16:9, or the first frame's shape | Output shape. |
To edit or extend a video, use the Video Edit and Video Extend models, or /videos/edits and /videos/extensions in the xAI API.
SandBase implements xAI's Images and Videos API under https://api.sandbase.ai/grok/v1. Requests and responses match xAI's API reference field by field, so the xAI SDK or any OpenAI-style HTTP client works after you change the base URL and use your SandBase API key.
| xAI | SandBase | |
|---|---|---|
| Base URL | https://api.x.ai/v1 | https://api.sandbase.ai/grok/v1 |
| Create | POST /videos/generations | POST /videos/generations |
| Edit a video | POST /videos/edits | POST /videos/edits |
| Extend a video | POST /videos/extensions | POST /videos/extensions |
| Retrieve | GET /videos/{request_id} | GET /videos/{request_id} |
model | grok-imagine-video | grok-imagine-video |
curl https://api.sandbase.ai/grok/v1/videos/extensions \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "The fox keeps running into the forest",
"video": {"url": "https://example.com/fox.mp4"},
"duration": 4
}'
The response is {"request_id": "..."}. Poll GET /grok/v1/videos/{request_id} every 5 to 10 seconds. pending means keep polling; done returns video.url, video.duration and usage.cost_in_usd_ticks (the charge in units of 1/10,000,000,000 USD); failed and expired are final and are not billed. Media can be public HTTPS or data: URLs. output and storage_options are not supported. Edits keep the source length and resolution; extensions add 2 to 10 seconds and return the full video.
Per output second: $0.05 at 480p, $0.07 at 720p. Each input image adds $0.002. Failed runs are not billed.
| Request | 480p | 720p |
|---|---|---|
| Generate 8s (default) | $0.40 | $0.56 |
| Generate 15s | $0.75 | $1.05 |
| Edit, per source second | $0.06 | $0.08 |
| Extend by N seconds | N × $0.05 + $0.01 per second of the source | N × $0.07 + $0.01 per second of the source |
빌드를 시작하세요
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": "x-ai/grok-imagine-video",
"prompt": "A red fox runs through deep snow, the camera tracks beside it, wind and crunching snow",
"duration": 8,
"resolution": "480p"
}
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하세요. 위의 요청 예시에는 제출과 폴링이 포함되어 있습니다.
반환된 실행 ID를 사용해 상태가 completed, failed 또는 timeout이 될 때까지 폴링하세요. completed 이후에만 출력을 읽으세요.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"모델의 이미지, 비디오 또는 오디오 필드에 공개적으로 접근 가능한 파일 URL을 전달하세요. 지원 형식과 제한은 각 Playground 입력 옆에 표시됩니다.
Playground의 지원되는 이미지 필드에서 업로드 또는 교체 컨트롤을 사용하세요. 비디오 URL 필드는 호스팅된 driving video를 받으며, 비디오 업로드 지원을 의미하지는 않습니다.
imagestringOptional image to start the video from (upload or public HTTPS URL).
promptstringDescribe the scene, motion, camera and sound. Required without images.
durationintegerOutput length in seconds (1-15, up to 10 with reference images). Billed per second.
기본값: 8
최소값: 1
최대값: 15
resolutionstring480p or 720p.
기본값: "480p"
가능한 값: "480p", "720p"
aspect_ratiostringOutput aspect ratio. Omit it to use 16:9, or the first frame's shape when you give one.
가능한 값: "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "5:2"
reference_imagesarrayUp to 7 images of characters, objects or styles to keep. Cannot be combined with a first frame; up to 10 seconds.
{
"model": "x-ai/grok-imagine-video",
"prompt": "A red fox runs through deep snow, the camera tracks beside it, wind and crunching snow",
"duration": 8,
"resolution": "480p"
}완료된 실행의 결과는 출력에 표시됩니다. 아래 내용은 새 생성 결과가 아니라 모델에 저장된 예시입니다.
예시 출력이 아직 게시되지 않았습니다. 완료된 실행 후 Playground → Result → JSON에서 응답을 확인하세요.