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

# 即梦视频生成

> 使用 `POST /v1/videos` 调用即梦模型提交异步视频任务。

# 即梦视频生成

OpenAI 格式入口。若需使用统一视频的 `POST /v1/video/create`，请见 [生成视频](./unified-generation)。

即梦当前使用 `POST /v1/videos` 提交任务，并以 `multipart/form-data` 提交为主。

* 路由入口是 `POST /v1/videos`。
* 当前使用 `multipart/form-data` 提交。
* 参考图通过 `input_reference` 字段传入单个文件。
* 提交成功后返回任务 `id` 与 `status`，后续用 [任务状态查询](./query) 轮询结果。

## 支持模型

* `jimeng-video-3.0`
* `jimeng-video-2.0`

## 方法与路径

```http theme={null}
POST /v1/videos
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl -X POST https://octopusx.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=jimeng-video-3.0" \
    -F "prompt=猫咪在草地上追逐蝴蝶" \
    -F "seconds=5" \
    -F "size=1280x720"
  ```

  ```python theme={null}
  import requests

  resp = requests.post(
      "https://octopusx.ai/v1/videos",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      data={
          "model": "jimeng-video-3.0",
          "prompt": "猫咪在草地上追逐蝴蝶",
          "seconds": "5",
          "size": "1280x720",
      },
      timeout=60,
  )
  print(resp.json())
  ```
</CodeGroup>

### 图生视频示例

<CodeGroup>
  ```bash theme={null}
  # 带参考图的请求示例
  curl -X POST https://octopusx.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=jimeng-video-3.0" \
    -F "prompt=让人物向前走并微笑" \
    -F "seconds=5" \
    -F "size=720x1280" \
    -F "input_reference=@/path/to/image.png"
  ```

  ```python theme={null}
  # 带参考图的请求示例
  import requests

  with open("image.png", "rb") as f:
      resp = requests.post(
          "https://octopusx.ai/v1/videos",
          headers={"Authorization": "Bearer YOUR_API_KEY"},
          data={
              "model": "jimeng-video-3.0",
              "prompt": "让人物向前走并微笑",
              "seconds": "5",
              "size": "720x1280",
          },
          files={"input_reference": f},
          timeout=60,
      )
      print(resp.json())
  ```
</CodeGroup>

## 响应示例

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "video_123",
    "task_id": "video_123",
    "object": "video",
    "model": "jimeng-video-3.0",
    "status": "queued",
    "progress": 0,
    "created_at": 1712697600
  }
  ```
</ResponseExample>

## 认证

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Body

<ParamField body="model" type="string" required>
  模型名称。支持 `jimeng-video-3.0`、`jimeng-video-2.0`。
</ParamField>

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

<ParamField body="input_reference" type="file">
  参考图。上传单个图片文件，用于图生视频场景。支持图片格式包括 png、jpeg、jpg、webp。
</ParamField>

<ParamField body="seconds" type="string">
  视频时长（秒）。可选值：`5`、`10`、`15`。
</ParamField>

<ParamField body="size" type="string">
  视频尺寸。可选值：`720x1280`（竖屏）、`1280x720`（横屏）。默认为 `720x1280`。
</ParamField>

## 当前规则

| 项目    | 规则                            |
| ----- | ----------------------------- |
| 默认时长  | 未显式传入时，默认为 `5` 秒              |
| 默认尺寸  | 未显式传入时，默认为 `720x1280`         |
| 参考图   | 通过 `input_reference` 上传单个图片文件 |
| 参考图格式 | 支持 png、jpeg、jpg、webp          |

## 相关接口

* [即梦视频概览](./overview)
* [任务状态查询](./query)
* [生成视频（统一视频）](./unified-generation)
