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

> Generate videos with xAI Grok Imagine

Generate high-quality AI videos using xAI's Grok Imagine model.

<Note>
  xAI upgraded the model behind `xai/grok-imagine-video`: it used to run Grok Imagine 1.0 Video, and now runs a **speed-optimized build of Grok Imagine 1.5 Video** — faster results in exchange for a small amount of quality. This build differs from the official API version, which is available separately as [Grok Imagine Video 1.5](/models/video/xai/grok-imagine-1.5-video).
</Note>

## Model

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

## Parameters

| Parameter         | Type      | Required | Default    | Allowed Values                                | Description                                                                                           |
| ----------------- | --------- | -------- | ---------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `prompt`          | string    | Yes      | —          | —                                             | Video generation prompt. Use `@ImageN` to point at a specific reference from `image_urls`             |
| `aspect_ratio`    | string    | No       | `"1:1"`    | `"1:1"`, `"2:3"`, `"3:2"`, `"9:16"`, `"16:9"` | Output aspect ratio                                                                                   |
| `duration`        | int       | No       | `6`        | `1`–`30`                                      | Video duration in seconds                                                                             |
| `resolution`      | string    | No       | `"720p"`   | `"480p"`, `"720p"`                            | Output resolution                                                                                     |
| `start_image_url` | string    | No       | `null`     | —                                             | Start frame image URL. Cannot be combined with `image_urls`                                           |
| `image_urls`      | string\[] | No       | `null`     | 1–7 URLs                                      | Reference image URLs for style, subject, or scene guidance. Cannot be combined with `start_image_url` |
| `video_preset`    | string    | No       | `"custom"` | `"custom"`, `"spicy"`, `"fun"`, `"normal"`    | Generation style preset                                                                               |

<Note>
  `start_image_url` and `image_urls` are mutually exclusive — send one or the other, never both. `image_urls` accepts a maximum of **7** reference images.
</Note>

**Video presets:**

| Preset   | Style                |
| -------- | -------------------- |
| `custom` | Default generation   |
| `spicy`  | Extremely spicy/nsfw |
| `fun`    | Extremely crazy/fun  |
| `normal` | Normal style         |

## Example Request

### Text to Video

```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",
    "input": {
      "prompt": "A futuristic cityscape at sunset with flying cars",
      "duration": 10,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "video_preset": "custom"
    }
  }'
```

### Image to Video

```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",
    "input": {
      "prompt": "Camera slowly zooms in while clouds move across the sky",
      "start_image_url": "https://example.com/landscape.jpg",
      "duration": 6,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    }
  }'
```

### Text to Video with Reference Images

```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",
    "input": {
      "prompt": "The woman in @Image1 walks into the neon-lit bar from @Image2 and sits down at the counter, camera tracking her from behind",
      "image_urls": [
        "https://example.com/woman.jpg",
        "https://example.com/neon-bar.jpg"
      ],
      "duration": 10,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    }
  }'
```

## Prompt References

| Token                   | Refers to                                           |
| ----------------------- | --------------------------------------------------- |
| `@Image1`, `@Image2`, … | Items from `image_urls`, in the order they are sent |

Reference the assets you pass in `image_urls` directly from the prompt, so you can assign each image a role instead of describing it in words. With a character image first and a location image second:

```
The woman in @Image1 walks into the neon-lit bar from @Image2 and sits
down at the counter, camera tracking her from behind
```

<Note>
  Prompt references are only available on `xai/grok-imagine-video` (the speed-optimized 1.5 build). [Grok Imagine Video 1.5](/models/video/xai/grok-imagine-1.5-video) does not support them — it takes a single `start_image_url` and no reference assets.
</Note>

## Response

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