# Captions

> Generate avatar videos, add styled captions and check video processing in Mirage.

App · 7 actions. Web page: https://docs.lodol.com/docs/integrations/captions

## Actions

### Add captions to video

Create a captioned video from either an uploaded video file or an existing video ID.

**Inputs**

- Caption template (`caption_template_id`, text, required): Caption style template ID
- Video (`video`, text): Video file to caption (MP4, MOV). Must be 9:16 aspect ratio. Max 50mb. Either video or video_id must be provided.
- Video (`video_id`, text): Existing video ID to add captions to. Either video or video_id must be provided.

**Outputs**

- `data` (object): Represents a video object.

**Example output**

```json
{
  "data": {
    "aspect_ratio": "example",
    "caption_template_id": "example",
    "completed_at": 1,
    "created_at": 1,
    "error": {
      "code": "example",
      "message": "example"
    },
    "generation_mode": "example",
    "id": "example",
    "model": "example",
    "object": "example",
    "progress": 1,
    "source_video_id": "example",
    "status": "example",
    "video_id": "example"
  }
}
```

### Generate avatar video

Generate avatar video.

**Inputs**

- Audio reference (`audio_reference`, text, required): Driving audio file (WAV or MP3, 1-180 seconds)
- Video reference (`video_reference`, text): Video appearance reference (MP4 or MOV, 10-60 seconds; feature-gated preview). Exactly one visual reference is required.
- Model (`model`, text): Model to use for generation. One of: `mirage-avatar-x`, `mirage-video-1-latest`. Default: `mirage-avatar-x`.
- Image reference (`image_reference`, text): Image appearance reference (JPEG or PNG). Exactly one visual reference is required.

**Outputs**

- `data` (object): Represents a video object.

**Example output**

```json
{
  "data": {
    "aspect_ratio": "example",
    "caption_template_id": "example",
    "completed_at": 1,
    "created_at": 1,
    "error": {
      "code": "example",
      "message": "example"
    },
    "generation_mode": "example",
    "id": "example",
    "model": "example",
    "object": "example",
    "progress": 1,
    "source_video_id": "example",
    "status": "example",
    "video_id": "example"
  }
}
```

### Get caption template

Get caption template.

**Inputs**

- Template (`template_id`, text, required): Template Id

**Outputs**

- `data` (object): Represents a caption style template

**Example output**

```json
{
  "data": {
    "created_at": 1,
    "id": "example",
    "name": "example",
    "object": "example",
    "preview_url": "example"
  }
}
```

### Get video download link

Download the video file (redirects to video URL).

**Inputs**

- Video (`video_id`, text, required): Video Id

**Outputs**

- `data` (object): Result.

**Example output**

```json
{
  "data": {
    "url": "example"
  }
}
```

### Get video status

Get the status of a video.

**Inputs**

- Video (`video_id`, text, required): Video Id

**Outputs**

- `data` (object): Represents a video object.

**Example output**

```json
{
  "data": {
    "aspect_ratio": "example",
    "caption_template_id": "example",
    "completed_at": 1,
    "created_at": 1,
    "error": {
      "code": "example",
      "message": "example"
    },
    "generation_mode": "example",
    "id": "example",
    "model": "example",
    "object": "example",
    "progress": 1,
    "source_video_id": "example",
    "status": "example",
    "video_id": "example"
  }
}
```

### List caption templates

List available caption style templates.

**Inputs**

- Limit (`limit`, number): Max number of items to return. From 1 to 100. Default: `20`.
- After (`after`, text): Return items strictly after this template ID

**Outputs**

- `data` (object): Paginated list of caption templates

**Example output**

```json
{
  "data": {
    "data": [],
    "has_more": false,
    "object": "example"
  }
}
```

### List videos

List videos for the authenticated API key with optional pagination.

**Inputs**

- After (`after`, text): Return items strictly after this video ID
- Limit (`limit`, number): Max number of items to return. From 1 to 100. Default: `20`.
- Order (`order`, text): Sort order by creation time. One of: `asc`, `desc`. Default: `desc`.

**Outputs**

- `data` (list): Response List Videos V1 Videos Get

**Example output**

```json
{
  "data": []
}
```
