> ## 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.

# 视频Extend

> 使用 `POST /v1/video/extend` 通过统一视频格式对已有 Grok 任务做片段延展。

# 视频Extend

Grok 统一视频 extend 入口为 `POST /v1/video/extend`。与 [OpenAI 格式的视频Extend](./extend) 不同，原任务 ID 通过 Body 的 `task_id` 传入。

* 路由入口是 `POST /v1/video/extend`。
* 必填 `model`、`prompt`、`task_id`。
* 可通过 `start_time` 指定从原视频哪一秒开始延展。

## 方法与路径

```http theme={null}
POST /v1/video/extend
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl -X POST https://octopusx.ai/v1/video/extend \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{
      "model": "grok-video-3",
      "prompt": "play with another white cat",
      "task_id": "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
      "start_time": 4,
      "aspect_ratio": "3:2",
      "size": "1080P",
      "upscale": true
    }'
  ```

  ```python theme={null}
  import requests

  resp = requests.post(
      "https://octopusx.ai/v1/video/extend",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
          "Accept": "application/json",
      },
      json={
          "model": "grok-video-3",
          "prompt": "play with another white cat",
          "task_id": "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
          "start_time": 4,
          "aspect_ratio": "3:2",
          "size": "1080P",
          "upscale": True,
      },
      timeout=60,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const response = await fetch("https://octopusx.ai/v1/video/extend", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
      Accept: "application/json",
    },
    body: JSON.stringify({
      model: "grok-video-3",
      prompt: "play with another white cat",
      task_id: "grok:2d8ef725-c4a9-46e0-b133-eca6c297e830",
      start_time: 4,
      aspect_ratio: "3:2",
      size: "1080P",
      upscale: true,
    }),
  });

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

## 响应示例

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "grok:48a67431-0708-46d1-9ab9-83cb84700153",
    "status": "processing",
    "status_update_time": 1762685256
  }
  ```
</ResponseExample>

## 认证

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

## Body

<ParamField body="model" type="string" required>
  模型名称，例如 `grok-video-3`。
</ParamField>

<ParamField body="prompt" type="string" required>
  延展片段的提示词。
</ParamField>

<ParamField body="task_id" type="string" required>
  原始视频任务 ID。
</ParamField>

<ParamField body="images" type="array<string>">
  参考图链接列表，按需补充视觉约束。
</ParamField>

<ParamField body="size" type="string">
  分辨率规格，传 `720P` 或 `1080P`。
</ParamField>

<ParamField body="aspect_ratio" type="string">
  视频比例，例如 `3:2`。
</ParamField>

<ParamField body="start_time" type="integer">
  从原视频的哪一秒开始延展。
</ParamField>

<ParamField body="upscale" type="boolean">
  是否对输出做高清增强。
</ParamField>

## Response

<ResponseField name="id" type="string">
  新 extend 任务 ID。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态，常见值包括 `processing`、`completed`、`failed`。
</ResponseField>

<ResponseField name="status_update_time" type="integer">
  状态最近更新时间（Unix 时间戳）。
</ResponseField>

## 相关接口

* [Grok 视频概览](./overview)
* [创建视频](./unified-generation)
* [视频Remix（统一视频）](./unified-remix)
* [视频Extensions（统一视频）](./unified-extensions)
* [查询任务](./unified-query)
* [视频Extend（OpenAI 格式）](./extend)
