Grok 视频
创建 Grok 视频
使用 grok-imagine-video-1.5 创建异步视频任务,支持文生视频、首尾帧、关键帧和多图参考。
POST
/v1/videos请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
model必填 | stringbody | 使用 grok-imagine-video-1.5;Key 需有该模型的调用权限。 |
prompt必填 | stringbody | 所有模式均需非空提示词,包括带图请求。 |
duration可选 | integerbody | 1~15 秒,默认 8 秒,使用整数。 |
seconds可选 | integerbody | duration 的兼容别名。建议只传 duration,不要传入冲突值。 |
resolution可选 | stringbody | 480p(默认)、720p、1080p;多图参考、尾帧和关键帧最高 720p。 |
aspect_ratio可选 | stringbody | 支持 1:1、16:9、9:16、4:3、3:4、3:2、2:3、21:9、5:2。 |
generate_audio可选 | booleanbody | false 关闭音频;省略时使用上游默认。 |
image可选 | objectbody | 首帧:{url: "https://..."};支持公网 HTTP(S) 或完整图片 data URL,不支持 file_id。 |
last_frame可选 | objectbody | 尾帧:{url: "https://..."};可与 image 组合锁定首尾帧。 |
keyframes可选 | arraybody | 1~4 项:{image: {url}, timestamp_s};时间须在 0 与 duration 之间,且不能落在同一 1/3 秒槽位。 |
reference_images可选 | arraybody | 1~14 个 {url: "https://..."} 对象;用于角色和风格引导,不锁定精确帧。 |
请求示例
cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false
}'cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false,
"image": {
"url": "https://example.com/start.jpg"
}
}'cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false,
"last_frame": {
"url": "https://example.com/end.jpg"
}
}'cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false,
"image": {
"url": "https://example.com/start.jpg"
},
"last_frame": {
"url": "https://example.com/end.jpg"
}
}'cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false,
"image": {
"url": "https://example.com/start.jpg"
},
"keyframes": [
{
"image": {
"url": "https://example.com/middle.jpg"
},
"timestamp_s": 1
}
],
"last_frame": {
"url": "https://example.com/end.jpg"
}
}'cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/videos' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-video-1.5",
"prompt": "A paper boat floats on a calm lake. Locked camera, soft daylight.",
"duration": 3,
"resolution": "480p",
"aspect_ratio": "16:9",
"generate_audio": false,
"reference_images": [
{
"url": "https://example.com/character.jpg"
},
{
"url": "https://example.com/style.jpg"
}
]
}'响应示例
JSON
{
"id": "task_example",
"object": "video",
"model": "grok-imagine-video-1.5",
"status": "queued",
"progress": 0
}调用注意事项
- 请将 example.com 图片占位地址替换为供应商可访问的真实图片。
- 原样保存返回的 id,之后查询状态;不要重复创建来检查进度。
- 本渠道支持 Grok 1.5 生成,不提供视频编辑、延长、参考音频、storage_options 或自定义结果上传。