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

# Video Extensions

> Use `POST /v1/videos/extensions` to perform segment extension for Grok tasks under the unified video pipeline.

# Video Extensions

In the Grok unified video pipeline, segment extension is still submitted through `POST /v1/videos/extensions` (the same path as [OpenAI-format Video Extensions](./extensions)), with the original task ID passed in `video.url` in the body.

* The route entry is `POST /v1/videos/extensions`.
* `model`, `prompt`, `video`, and `start_time` are required.
* Set `video.url` to the original task ID, for example `grok:f673ba58-b053-4d8d-8938-c0b429de4d7f`.
* After a successful submission, use [Query Task](./unified-query) to poll for results.

## Method and Path

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

## Request Example

<CodeGroup>
  ```bash theme={null}
  curl -X POST https://octopusx.ai/v1/videos/extensions \
    -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",
      "duration": 6,
      "start_time": 4,
      "video": {
        "url": "grok:f673ba58-b053-4d8d-8938-c0b429de4d7f"
      }
    }'
  ```

  ```python theme={null}
  import requests

  resp = requests.post(
      "https://octopusx.ai/v1/videos/extensions",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
          "Accept": "application/json",
      },
      json={
          "model": "grok-video-3",
          "prompt": "play with another white cat",
          "duration": 6,
          "start_time": 4,
          "video": {"url": "grok:f673ba58-b053-4d8d-8938-c0b429de4d7f"},
      },
      timeout=60,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const response = await fetch("https://octopusx.ai/v1/videos/extensions", {
    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",
      duration: 6,
      start_time: 4,
      video: { url: "grok:f673ba58-b053-4d8d-8938-c0b429de4d7f" },
    }),
  });

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

## Response Example

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

## Authentication

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

## Body

<ParamField body="model" type="string" required>
  Model name, for example `grok-video-3`.
</ParamField>

<ParamField body="prompt" type="string" required>
  Prompt for the extension segment.
</ParamField>

<ParamField body="video" type="object" required>
  Reference to the original video, which must include the `url` field.
</ParamField>

<ParamField body="video.url" type="string" required>
  Original video task ID, the same as the `id` returned by unified [Create Video](./unified-generation).
</ParamField>

<ParamField body="start_time" type="integer" required>
  Segment start time (seconds).
</ParamField>

<ParamField body="duration" type="integer">
  Target extension duration (seconds). Defaults to `10`, supports `6`, `10`, and `15`.
</ParamField>

## Response

<ResponseField name="id" type="string">
  New extensions task ID.
</ResponseField>

<ResponseField name="status" type="string">
  Task status, common values include `processing`, `completed`, and `failed`.
</ResponseField>

<ResponseField name="status_update_time" type="integer">
  Most recent status update time (Unix timestamp).
</ResponseField>

## Difference Between Extend and Extensions Under Unified Video

| Item             | Video Extend                  | Video Extensions              |
| ---------------- | ----------------------------- | ----------------------------- |
| Path             | `POST /v1/video/extend`       | `POST /v1/videos/extensions`  |
| Original task ID | Body `task_id`                | Body `video.url`              |
| Query            | [Query Task](./unified-query) | [Query Task](./unified-query) |

## Related APIs

* [Grok Video Overview](./overview)
* [Create Video](./unified-generation)
* [Video Remix (Unified Video)](./unified-remix)
* [Video Extend (Unified Video)](./unified-extend)
* [Query Task](./unified-query)
* [Video Extensions (OpenAI Format)](./extensions)
