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

# Grok Imagine Video Extend

> Extend videos with xAI Grok Imagine

Extend a previously generated video using xAI's Grok Imagine model via HTTP streaming. Provide the `task_id` of a completed video generation and choose between **preset mode** or **custom mode**.

<Note>
  Extend only works on videos generated with [Grok Imagine Video](/models/video/xai/grok-imagine-video) (`xai/grok-imagine-video`, the speed-optimized 1.5 build). Task IDs from [Grok Imagine Video 1.5](/models/video/xai/grok-imagine-1.5-video) (`xai/grok-imagine-1.5-video`) are not supported — that model is API-level and separate.
</Note>

## Model

```
xai/grok-imagine-video-extend
```

## Modes

There are two mutually exclusive modes:

| Mode       | How to activate        | Behaviour                                                                                     |
| ---------- | ---------------------- | --------------------------------------------------------------------------------------------- |
| **Preset** | Provide `video_preset` | The preset controls the video style. `prompt`, `extend_at`, and `extend_duration` are ignored |
| **Custom** | Omit `video_preset`    | You control timing and prompt. `prompt`, `extend_at`, and `extend_duration` are required      |

## Parameters

| Parameter         | Type   | Required | Description                                                                         |
| ----------------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `task_id`         | string | Yes      | Task ID of a completed video generation                                             |
| `video_preset`    | string | No       | `"spicy"` or `"normal"`. Enables preset mode                                        |
| `prompt`          | string | No       | Text prompt to guide the extension. **Required in custom mode**                     |
| `extend_at`       | float  | No       | Second in the source video to start the extension from. **Required in custom mode** |
| `extend_duration` | int    | No       | Length of the extension: `6` or `10` seconds. **Required in custom mode**           |

## Example Requests

### Preset Mode

```bash theme={null}
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-video-extend",
    "input": {
      "task_id": "abc123def456",
      "video_preset": "spicy"
    }
  }'
```

### Custom Mode

```bash theme={null}
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-video-extend",
    "input": {
      "task_id": "abc123def456",
      "prompt": "The camera continues panning right to reveal a mountain range",
      "extend_at": 8.5,
      "extend_duration": 10
    }
  }'
```

## Response

```json theme={null}
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "xyz789ghi012",
    "status": "processing"
  }
}
```
