> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.vncps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 即梦 API

> 使用即梦模型生成视频，支持运镜功能

## 模型对比

| 模型               | 分辨率支持      | 文生视频 | 图生视频-首帧 | 图生视频-首尾帧 | 运镜功能      |
| ---------------- | ---------- | ---- | ------- | -------- | --------- |
| `jimeng_v30`     | 720p/1080p | ✅    | ✅       | ✅        | ✅ (仅720p) |
| `jimeng_v30_pro` | 1080p      | ✅    | ✅       | ❌        | ❌         |

## 文生视频 (jimeng\_v30)

基础的文本生成视频功能。

<Note>
  **配置说明：**

  * 将 `api.xxx.com` 替换为您的实际 API 域名
  * 将 `sk-xxx` 替换为您的 API 密钥（可在控制台获取）
</Note>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-xxx" \
     -d '{
      "model": "jimeng_v30",
      "prompt": "一条小河流淌在森林中,鸟儿在树枝上歌唱",
      "resolution": "720p",
      "ratio": "16:9",
      "duration": 5,
      "seed": -1
  }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 参数说明

### 基础参数（必填）

| 参数名          | 类型      | 说明      | 可选值                                                        |
| ------------ | ------- | ------- | ---------------------------------------------------------- |
| `model`      | string  | 模型名称    | `jimeng_v30` / `jimeng_v30_pro`                            |
| `prompt`     | string  | 文本提示词   | 中英文描述                                                      |
| `resolution` | string  | 视频分辨率   | jimeng\_v30: `720p`/`1080p`<br />jimeng\_v30\_pro: `1080p` |
| `ratio`      | string  | 视频宽高比   | `16:9` / `4:3` / `1:1` / `3:4` / `9:16` / `21:9`           |
| `duration`   | integer | 视频时长（秒） | `5` / `10`                                                 |

### 可选参数

| 参数名               | 类型      | 默认值 | 说明                                         | 适用场景                 |
| ----------------- | ------- | --- | ------------------------------------------ | -------------------- |
| `images`          | array   | -   | 图片URL数组<br />• 单张图片 = 首帧<br />• 两张图片 = 首尾帧 | 仅 `jimeng_v30` 支持    |
| `seed`            | integer | -1  | 随机种子<br />• -1 表示随机<br />• 正整数表示固定种子       | 全部模型                 |
| `template_id`     | string  | -   | 运镜模板ID<br />**运镜时必填**                      | 仅 `jimeng_v30` 的720p |
| `camera_strength` | string  | -   | 运镜强度<br />**运镜时必填**                        | 仅 `jimeng_v30` 的720p |

## 运镜模板

### 模板列表

<CardGroup cols={3}>
  <Card title="希区柯克推进" icon="arrow-right">
    `hitchcock_dolly_in` - 镜头向前推进
  </Card>

  <Card title="希区柯克拉远" icon="arrow-left">
    `hitchcock_dolly_out` - 镜头向后拉远
  </Card>

  <Card title="机械臂" icon="robot">
    `robo_arm` - 机械臂运镜效果
  </Card>

  <Card title="动感环绕" icon="arrows-spin">
    `dynamic_orbit` - 动态环绕拍摄
  </Card>

  <Card title="中心环绕" icon="circle">
    `central_orbit` - 围绕中心旋转
  </Card>

  <Card title="起重机" icon="crane">
    `crane_push` - 起重机运镜
  </Card>

  <Card title="超级拉远" icon="maximize">
    `quick_pull_back` - 快速拉远镜头
  </Card>

  <Card title="逆时针回旋" icon="rotate-left">
    `counterclockwise_swivel` - 逆时针旋转
  </Card>

  <Card title="顺时针回旋" icon="rotate-right">
    `clockwise_swivel` - 顺时针旋转
  </Card>

  <Card title="手持运镜" icon="hand">
    `handheld` - 手持摄影效果
  </Card>

  <Card title="快速推拉" icon="arrows-up-down">
    `rapid_push_pull` - 快速推拉镜头
  </Card>
</CardGroup>

### 运镜强度

| 值        | 说明                |
| -------- | ----------------- |
| `weak`   | 弱 - 运镜幅度较小，画面变化柔和 |
| `medium` | 中 - 运镜幅度适中，平衡效果   |
| `strong` | 强 - 运镜幅度较大，视觉冲击力强 |

## 图生视频-首帧 (jimeng\_v30)

基于首帧图片生成视频。

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-xxx" \
    -d '{
      "model": "jimeng_v30",
      "prompt": "女孩抱着狐狸,女孩睁开眼,温柔地看向镜头",
      "images": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png"],
      "resolution": "720p",
      "ratio": "16:9",
      "duration": 5,
      "seed": -1
    }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 图生视频-首尾帧 (jimeng\_v30)

基于首尾两帧图片生成视频。

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-xxx" \
    -d '{
      "model": "jimeng_v30",
      "prompt": "360度环绕运镜",
      "images": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg"
      ],
      "resolution": "720p",
      "ratio": "16:9",
      "duration": 5,
      "seed": -1
    }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 运镜视频 (jimeng\_v30)

使用运镜模板生成具有特定镜头运动的视频。

<Tip>
  运镜功能仅支持 `jimeng_v30` 模型的 720p 分辨率。
</Tip>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-xxx" \
    -d '{
      "model": "jimeng_v30",
      "prompt": "一辆跑车停在赛道上,阳光照在车身上",
      "images": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png"],
      "resolution": "720p",
      "ratio": "16:9",
      "duration": 5,
      "template_id": "dynamic_orbit",
      "camera_strength": "strong",
      "seed": -1
    }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 文生视频 (jimeng\_v30\_pro)

高质量的文本生成视频，仅支持1080p。

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-xxx" \
    -d '{
      "model": "jimeng_v30_pro",
      "prompt": "一座现代化城市的夜景,灯光闪烁,车流不息",
      "resolution": "1080p",
      "ratio": "16:9",
      "duration": 5,
      "seed": -1
    }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 图生视频-首帧 (jimeng\_v30\_pro)

基于首帧图片生成高质量视频。

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.xxx.com/v1/video/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-xxx" \
    -d '{
      "model": "jimeng_v30_pro",
      "prompt": "女孩缓缓睦开眼睛,头发随风飘动",
      "images": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png"],
      "resolution": "1080p",
      "ratio": "16:9",
      "duration": 5,
      "seed": -1
    }'
  ```

  ```json Response theme={null}
  {
    "task_id": "cgt-20251209112555-fdqtx"
  }
  ```
</CodeGroup>

## 查询视频任务

使用任务ID查询视频生成结果。

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.xxx.com/v1/video/generations/{task_id} \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-xxx"
  ```

  ```json Response theme={null}
  {
      "code": "success",
      "message": "",
      "data": {
          "task_id": "cgt-20251209173715-6mn48",
          "action": "generate",
          "status": "SUCCESS",
          "fail_reason": "",
          "submit_time": 1765273035,
          "start_time": 1765273037,
          "finish_time": 1765273082,
          "progress": "100%",
          "data": {
              "id": "cgt-20251209173715-6mn48",
              "seed": 11,
              "model": "doubao-seedance-1-0-pro-fast-251015",
              "ratio": "16:9",
              "usage": {
                  "total_tokens": 97605,
                  "completion_tokens": 97605
              },
              "status": "succeeded",
              "content": {
                  "video_url": "https://ark-content-generation-cn-beijing.tos-cn-beijing.volces.com/..."
              },
              "duration": 10,
              "created_at": 1765273035,
              "resolution": "480p",
              "updated_at": 1765273077,
              "service_tier": "default",
              "framespersecond": 24,
              "execution_expires_after": 172800
          }
      }
  }
  ```
</CodeGroup>

### 任务状态说明

| 状态           | 说明     |
| ------------ | ------ |
| `PENDING`    | 任务排队中  |
| `PROCESSING` | 任务处理中  |
| `SUCCESS`    | 任务成功完成 |
| `FAILED`     | 任务失败   |

<Warning>
  视频生成任务的执行时间取决于队列长度和视频时长，通常需要几分钟时间。
</Warning>
