> ## Documentation Index
> Fetch the complete documentation index at: https://docs.1788.love/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Imagine 1.5 视频生成

> 异步创建 Grok Imagine 1.5 文生视频或图生视频任务

* 支持文生视频和图生视频。
* 返回 1788 平台任务 ID，用于查询进度和下载视频。
* 支持横屏、竖屏等画幅，以及 480p、720p 清晰度。

## 请求

`POST https://1788.love/v1/videos`

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_1788_API_KEY`
</ParamField>

<ParamField body="model" type="string" default="grok-imagine-1.5-video" required>
  固定填写 1788 对外模型名 `grok-imagine-1.5-video`。
</ParamField>

<ParamField body="prompt" type="string" required>
  视频内容描述，支持中英文。
</ParamField>

<ParamField body="size" type="string" default="16:9">
  画幅比例：`16:9`、`9:16`、`1:1`、`3:2` 或 `2:3`。
</ParamField>

<ParamField body="duration" type="integer" default={6}>
  视频时长，单位为秒。支持 6 到 30。
</ParamField>

<ParamField body="quality" type="string" default="720p">
  清晰度：`480p` 或 `720p`。`resolution` 是兼容别名；同时提供时以 `quality` 为准。
</ParamField>

<ParamField body="image_urls" type="string[]">
  可选参考图 URL，最多 7 张。必须使用公网可访问 URL，不支持 base64。
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://1788.love/v1/videos \
    --header 'Authorization: Bearer YOUR_1788_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "grok-imagine-1.5-video",
      "prompt": "一只狗在海滩上奔跑，阳光明媚，慢镜头",
      "size": "16:9",
      "duration": 6,
      "quality": "720p"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://1788.love/v1/videos",
      headers={
          "Authorization": "Bearer YOUR_1788_API_KEY",
          "Content-Type": "application/json",
      },
      json={
          "model": "grok-imagine-1.5-video",
          "prompt": "一只狗在海滩上奔跑，阳光明媚，慢镜头",
          "size": "16:9",
          "duration": 6,
          "quality": "720p",
      },
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://1788.love/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_1788_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "grok-imagine-1.5-video",
      prompt: "一只狗在海滩上奔跑，阳光明媚，慢镜头",
      size: "16:9",
      duration: 6,
      quality: "720p",
    }),
  });

  console.log(await response.json());
  ```
</CodeGroup>

## 图生视频示例

先调用[上传图片](/api-reference/upload-image)，再将返回的 URL 放入 `image_urls`：

```json theme={null}
{
  "model": "grok-imagine-1.5-video",
  "prompt": "让画面动起来，添加自然的动态效果",
  "image_urls": ["https://1788.love/uploaded/example-image.png"],
  "size": "16:9",
  "duration": 10,
  "quality": "720p"
}
```

## 成功响应

```json theme={null}
{
  "id": "task_example123456789",
  "object": "video.generation",
  "model": "grok-imagine-1.5-video",
  "status": "queued",
  "progress": 0,
  "created_at": 1785564000
}
```

<Note>
  使用 `GET https://1788.love/v1/videos/{id}` 查询状态；任务完成后使用 `GET https://1788.love/v1/videos/{id}/content` 获取视频内容。
</Note>
