Animate the exact single chestnut alpaca in this first frame. In one continuous five-second locked-off wildlife shot, it gives one brief natural shake of its neck and torso, sending a modest spray of fine water droplets outward from its wet wool, then settles and stands quietly. All four hooves remain planted. Preserve its face, long neck, two ears, four legs, chestnut coat pattern and body proportions. Wool moves with the body; droplets fall naturally under gravity. Keep the stone wall and distant cloudy Andean slopes unchanged. Natural speed, no slow motion, no cuts, no new animals or transformation. Audio: a short soft wet-fur rustle during the shake and gentle highland wind, no human speech or music. No text, logos or watermark.
Grok Imagine Video 1.5 Image to Video API
xai/grok-imagine-video-v1.5/image-to-videoGrok Imagine Video 1.5 Image to Video 将首帧图片转化为动作连贯、音画同步的短片,输出最高1080p。以原图主体与构图为起点,通过提示词引导动作和运镜,设定1–15秒时长。
拖拽文件、粘贴剪贴板素材,或输入 URL。 上传一张 JPG、JPEG、PNG 或 WebP 图片作为首帧,大小不超过 10 MB;也可填写可公开访问的 HTTP(S) 图片链接。
1/1 个素材
示例
开发接入
快速开始
通过统一生成接口提交请求,再使用任务编号查询视频。示例可切换为 cURL、JavaScript 或 Python。
配置访问凭证
在服务端配置 VIDGO_API_KEY,并通过 Authorization 请求头传递 Bearer 凭证。
- 提交地址
- POST
https://api.vidgo.ai/api/generate/submit - 请求鉴权
- Authorization: Bearer VIDGO_API_KEY
提交生成请求
填写 model 与 input,并向生成接口发送 POST 请求;成功后保存返回的 task_id。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "xai/grok-imagine-video-v1.5/image-to-video",
"input": {
"prompt": "One continuous FOUR-SECOND real-time shot of this exact boxer and heavy bag. ONE JAB TOTAL. During the first second she extends ONLY the glove nearest the bag straight forward, contacts the bag once, and returns the same glove to her chin. The other glove stays touching her cheek for the entire shot and never punches. During seconds two through four she holds her guard and makes no further attacks while watching the bag gently swing and settle. Preserve the same face, curly hair, grey top, dark red gloves, two arms and single hanging bag attached to its chain. Locked camera. A compact deliberate training movement, stable anatomy and equipment. Audio: one soft padded impact exactly at the single contact, then a light chain rattle, natural breathing and quiet gym ambience. No speech, music, cut, text or branding.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/xai/grok-imagine-video-v1.5/image-to-video/v1/01/input.png"
],
"resolution": "720p",
"duration": 4
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"查询执行状态
使用 task_id 发送 GET 请求,等待状态变为 finished 或 failed。
任务查询
GET https://api.vidgo.ai/api/generate/status/{task_id}将地址中的 {task_id} 替换为提交响应中的编号,使用同一 Bearer 凭证查询。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-grok-video-15-example",
"status": "not_started",
"created_time": "2026-09-27T00:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}读取视频文件
完成后读取 data.files 中的视频链接;失败时读取 data.error_message 并检查请求。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "xai/grok-imagine-video-v1.5/image-to-video",
"input": {
"prompt": "One continuous FOUR-SECOND real-time shot of this exact boxer and heavy bag. ONE JAB TOTAL. During the first second she extends ONLY the glove nearest the bag straight forward, contacts the bag once, and returns the same glove to her chin. The other glove stays touching her cheek for the entire shot and never punches. During seconds two through four she holds her guard and makes no further attacks while watching the bag gently swing and settle. Preserve the same face, curly hair, grey top, dark red gloves, two arms and single hanging bag attached to its chain. Locked camera. A compact deliberate training movement, stable anatomy and equipment. Audio: one soft padded impact exactly at the single contact, then a light chain rattle, natural breathing and quiet gym ambience. No speech, music, cut, text or branding.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/xai/grok-imagine-video-v1.5/image-to-video/v1/01/input.png"
],
"resolution": "720p",
"duration": 4
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
将以下参数放入请求的 input 对象,model 使用当前页面对应的模型标识。
| 字段 | 类型 | 必填 | 默认值 | 用途与取值 |
|---|---|---|---|---|
| prompt | string | 是 | — | 填写 1–4096 个字符,描述首帧中的主体动作、镜头运动与声音。 |
| image_urls | array<string> | 是 | — | 提供恰好一个可公开访问的 HTTP(S) 图片链接作为首帧,视频画幅由图片决定。 |
| resolution | string | 否 | 720p | 选择 480p、720p 或 1080p,默认 720p。 |
| duration | integer | 否 | 6 | 填写 1–15 的整数,单位为秒,默认 6。 |
响应字段
提交响应提供任务编号,状态查询响应提供执行状态与视频文件。
| 字段 | 类型 | 用途与取值 |
|---|---|---|
| code | integer | 业务结果码;0 或 200 表示本次请求成功。 |
| data.task_id | string | 本次生成任务的编号,用于后续状态查询。 |
| data.status | string | 任务状态:not_started、running、finished 或 failed。 |
| data.files | array<object> | 完成后的文件列表;读取 file_type 为 video 的条目及其 file_url。 |
| data.error_message | string | null | 任务失败时的错误说明,可据此检查素材或调整请求。 |
任务生命周期
保存提交后获得的 task_id,通过同一编号跟踪任务直至完成或失败。
not_started任务已创建,等待开始处理。
running任务正在处理,继续查询同一任务。
finished任务已完成,从 files 读取视频链接。
failed任务已失败,读取 error_message 并检查输入。
查询与错误处理
- 继续查询同一任务获得 task_id 后,用它查询执行进度;查询遇到网络错误时,重试该任务的状态请求。
- 按字段检查请求检查必填字段、类型与允许值,并使用可公开访问的图片链接。
- 核对完成响应状态为 finished 时读取视频文件;若缺少 file_url,保留 task_id 和返回数据以便排查。
模型规格
| 规格项 | 取值 | 说明 |
|---|---|---|
| 输入 | 单张图片与动作提示词 | 图片作为首帧并决定视频画幅。 |
| 时长 | 1–15秒 | 整数秒,默认6秒。 |
| 清晰度 | 480p / 720p / 1080p | 默认720p。 |
| 声音 | 同步声音 | 在提示词中描述音效、环境声或对白。 |
相关模型
Grok Imagine Video 1.5 Image to Video API 常见问题
Grok Imagine Video 1.5 Image to Video API 是什么?
Grok Imagine Video 1.5 Image to Video API 是 xAI 将单张首帧图片转化为视频的模型。它结合连续动作、同步声音与最高1080p输出。图片建立主体和构图,提示词引导1–15秒内的动作与运镜。可通过 API 文档接入,也可在上方体验区试用。
Grok Imagine Video 1.5 如何让首帧主体动起来?
图片提供视频的起始画面。提示词描述接下来发生的动作,包括方向、速度与运镜;清晰主体和完整轮廓为动作生成建立明确的视觉起点。
Grok Imagine Video 1.5 会生成同步声音吗?
会。音效、环境声与对白随视频一起生成。在动作提示词中写明声音来源和时机,例如转身时衣料摩擦、迈步时脚步声响起。
Grok Imagine Video 1.5 的视频画幅如何确定?
视频画幅由首帧图片决定。竖向构图使用竖图,宽幅镜头使用横图,再选择输出清晰度。
Grok Imagine Video 1.5 能生成15秒短片吗?
可以。将 Duration 设为15,也可选择1–15之间的任意整数,默认6秒。根据动作安排时长,例如短促手势或持续运镜。
Grok Imagine Video 1.5 能输出1080p视频吗?
可以。在 Resolution 中选择1080p,也可选择480p或720p,默认720p。费用随清晰度和时长更新。















