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

# Luma

> Use the Luma Dream Machine API to generate videos

> Last updated: 2026-06-06

# Luma

Luma Dream Machine provides high-quality video generation capabilities. Official docs: [docs.lumalabs.ai](https://docs.lumalabs.ai/docs/video-generation)

## Create Video

```
POST /luma/generations
```

### Request Parameters

| Parameter       | Type    | Required | Description                         |
| --------------- | ------- | -------- | ----------------------------------- |
| `user_prompt`   | string  | Yes      | Video description prompt            |
| `model_name`    | string  | No       | Model name: `ray-v1`, `ray-v2`      |
| `duration`      | string  | No       | Video duration (seconds)            |
| `resolution`    | string  | No       | Resolution: `540p`, `720p`, `1080p` |
| `expand_prompt` | boolean | No       | Whether to auto-expand the prompt   |
| `image_url`     | string  | No       | First frame reference image URL     |
| `image_end_url` | string  | No       | Last frame reference image URL      |

### Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.crazyrouter.com/luma/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "user_prompt": "A drone shot flying over a tropical island with crystal clear water",
      "model_name": "ray-v2",
      "duration": "5",
      "resolution": "720p",
      "expand_prompt": true
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.crazyrouter.com/luma/generations",
      headers={
          "Content-Type": "application/json",
          "Authorization": "Bearer YOUR_API_KEY"
      },
      json={
          "user_prompt": "A drone shot flying over a tropical island",
          "model_name": "ray-v2",
          "duration": "5",
          "resolution": "720p"
      }
  )

  print(response.json())
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "id": "luma_gen_abc123",
  "state": "queued",
  "created_at": "2024-03-01T12:00:00Z"
}
```

***

## Image-to-Video

Pass `image_url` as the first frame:

```json theme={null}
{
  "user_prompt": "The person in the image starts walking forward",
  "model_name": "ray-v2",
  "image_url": "https://example.com/portrait.jpg"
}
```

First-last frame mode:

```json theme={null}
{
  "user_prompt": "Smooth transition between two scenes",
  "model_name": "ray-v2",
  "image_url": "https://example.com/start.jpg",
  "image_end_url": "https://example.com/end.jpg"
}
```

***

## Query Task

```
GET /luma/generations/{task_id}
```

```bash cURL theme={null}
curl https://api.crazyrouter.com/luma/generations/luma_gen_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response Example

```json theme={null}
{
  "id": "luma_gen_abc123",
  "state": "completed",
  "created_at": "2024-03-01T12:00:00Z",
  "video": {
    "url": "https://storage.cdn-luma.com/...",
    "download_url": "https://storage.cdn-luma.com/..."
  }
}
```

***

## Extend Video

```
POST /luma/generations/{task_id}/extend
```

Extend a completed video.

```bash cURL theme={null}
curl -X POST https://api.crazyrouter.com/luma/generations/luma_gen_abc123/extend \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "user_prompt": "Continue the drone shot, camera pans to reveal a beach resort"
  }'
```

### Task Status

| Status      | Description |
| ----------- | ----------- |
| `queued`    | Queued      |
| `dreaming`  | Generating  |
| `completed` | Completed   |
| `failed`    | Failed      |
