---
title: Grok 视频生成
description: 使用 grok-imagine-video-1.5-preview 提交视频任务，包含参考图与多语言调用示例。
api: "POST /v1/videos"
---

使用 `grok-imagine-video-1.5-preview` 根据参考图和提示词创建视频任务。API Key 需绑定包含此模型的视频分组。

<RequestExample>
```bash 单图参考
curl https://sub.vcnovb.cn/v1/videos \
  -H "Authorization: Bearer $VC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video-1.5-preview",
    "prompt": "保持人物外观，人物回头微笑，镜头缓慢推进",
    "seconds": "4",
    "aspect_ratio": "16:9",
    "resolution": "720P",
    "images": ["https://example.com/character.png"]
  }'
```
```bash 多图参考
curl https://sub.vcnovb.cn/v1/videos \
  -H "Authorization: Bearer $VC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video-1.5-preview",
    "prompt": "将参考人物放入参考场景，自然行走，保持人物一致",
    "seconds": "4", "aspect_ratio": "16:9", "resolution": "720P",
    "images": ["https://example.com/character.png", "https://example.com/scene.png"]
  }'
```
```python Python
import os
import requests

response = requests.post(
    "https://sub.vcnovb.cn/v1/videos",
    headers={"Authorization": f"Bearer {os.environ['VC_API_KEY']}"},
    json={
        "model": "grok-imagine-video-1.5-preview",
        "prompt": "保持人物外观，人物回头微笑，镜头缓慢推进",
        "seconds": "4", "aspect_ratio": "16:9", "resolution": "720P",
        "images": ["https://example.com/character.png"],
    },
    timeout=120,
)
response.raise_for_status()
print(response.json())
```
```javascript JavaScript
const response = await fetch("https://sub.vcnovb.cn/v1/videos", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VC_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "grok-imagine-video-1.5-preview",
    prompt: "保持人物外观，人物回头微笑，镜头缓慢推进",
    seconds: "4", aspect_ratio: "16:9", resolution: "720P",
    images: ["https://example.com/character.png"],
  }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```
</RequestExample>

<ResponseExample>
```json 创建成功
{"id":"video_example_grok","model":"grok-imagine-video-1.5-preview","status":"queued","progress":0}
```
```json 权限错误
{"error":{"type":"permission_error","message":"Video generation is not enabled for this group"}}
```
</ResponseExample>

## 请求参数

<ParamField body="model" type="string" required>填写 `grok-imagine-video-1.5-preview`，并绑定包含此模型的视频分组。</ParamField>
<ParamField body="prompt" type="string" required>描述动作、镜头和场景。建议使用清晰、精炼的提示词，避免堆叠互相矛盾的动作。</ParamField>
<ParamField body="seconds" type="string | integer">目标视频时长，单位为秒。示例使用 `"4"`，可选时长见分组的模型说明。</ParamField>
<ParamField body="aspect_ratio" type="string">画面宽高比，例如 `16:9`、`9:16`、`1:1`。</ParamField>
<ParamField body="resolution" type="string">视频分辨率。示例使用 `720P`，可选档位见分组的模型说明。</ParamField>
<ParamField body="images" type="array<string>">参考图 URL 数组。素材链接需可公开访问；多图模式需使用已开通该能力的分组。</ParamField>
<ParamField body="input_reference" type="object">单张参考图的另一种输入格式：`{"image_url":"https://example.com/image.png"}`。与 `images` 二选一。</ParamField>

## 使用参考图

- 单图：在 `images` 中传入一张图片，并在 `prompt` 中描述主体动作和镜头变化。
- 多图：使用已开通多图能力的分组，并在提示词中说明每张图片的用途，例如人物参考、场景参考。
- 素材地址：将示例 URL 替换为实际图片链接。

## 查询生成结果

保存创建响应中的任务 ID，通过[Grok 视频查询与下载](/models/grok/query)查看进度，完成后下载视频。
