# Magic Hour

> Generate videos, images and audio and check the resulting projects.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/magic-hour

## Actions

### Estimate audio credits

Preview the credit cost for an audio operation.

**Inputs**

- Tool (`tool`, text, required): The create endpoint to price, named by its path. For example `ai-voice-generator` for `POST /v1/ai-voice-generator`. One of: `ai-voice-generator`, `ai-voice-cloner`, `ai-music-generator`.
- Character count (`character_count`, number): The number of characters in the `style.prompt` of the create request. Used by `ai-voice-generator`, `ai-voice-cloner`.
- Duration (`duration`, number): The `duration` of the create request. Used by `ai-music-generator`.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "estimated_credits": 1
  }
}
```

### Estimate image credits

Preview the credit cost for an image operation.

**Inputs**

- Tool (`tool`, text, required): The create endpoint to price, named by its path. For example `ai-image-editor` for `POST /v1/ai-image-editor`. One of: `ai-image-generator`, `ai-image-editor`, `ai-image-upscaler`, `body-swap`, `head-swap`, `face-swap-photo`, `ai-clothes-changer`, `ai-face-editor`, `ai-gif-generator`, `ai-headshot-generator`, and 4 more.
- Model (`model`, text): The `model` of the create request. Used by `ai-image-generator`, `ai-image-editor`.
- Resolution (`resolution`, text): The `resolution` of the create request. Used by `ai-image-generator`, `ai-image-editor`, `body-swap`. One of `640px`, `1k`, `2k`, `4k`.
- Image count (`image_count`, number): The `image_count` of the create request. Used by `ai-image-generator`, `ai-image-editor`. Defaults to 1.
- Scale factor (`scale_factor`, number): The `scale_factor` of the create request. Used by `ai-image-upscaler`. One of `2`, `4`.
- Mode (`mode`, text): The `style.mode` of the create request. Used by `ai-image-upscaler`. One of `preserve`, `balanced`, `creative`. Defaults to `balanced`.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "estimated_credits": 1
  }
}
```

### Estimate video credits

Preview the credit cost for a video operation.

**Inputs**

- Tool (`tool`, text, required): The create endpoint to price, named by its path. For example `image-to-video` for `POST /v1/image-to-video`. One of: `image-to-video`, `text-to-video`, `ai-ugc-ad`, `ai-video-editor`, `character-replace`, `audio-to-video`, `ai-video-translator`, `ai-video-upscaler`, `face-swap`, `auto-subtitle-generator`.
- End seconds (`end_seconds`, number, required): The `end_seconds` of the create request. Used by every tool.
- Start seconds (`start_seconds`, number): The `start_seconds` of the create request, for tools whose create request has it. Defaults to 0.
- Model (`model`, text): Model.
- Resolution (`resolution`, text): Resolution.
- Audio (`audio`, true/false): The `audio` of the create request. Used by `image-to-video`, `text-to-video`. Defaults to `false`.
- Has video reference (`has_video_reference`, true/false): Whether any of the create request's `references` is a video. Used by `text-to-video`. Defaults to `false`.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "estimated_credits": 1
  }
}
```

### Generate a video

Create a video from a written prompt.

**Inputs**

- Idempotency key (`idempotency_key`, text): Idempotency key.
- Name (`name`, text): Give your video a custom name for easy identification.
- End seconds (`end_seconds`, number, required): The total duration of the output video in seconds. Supported durations depend on the chosen model:. From 1 to 60.
- Aspect ratio (`aspect_ratio`, text): Determines the aspect ratio of the output video. One of: `16:9`, `9:16`, `1:1`.
- Resolution (`resolution`, text): Resolution. One of: `360p`, `480p`, `720p`, `1080p`, `4k`.
- Model (`model`, text): The AI model to use for video generation. One of: `default`, `minimax-h3`, `kling-4.0`, `kling-3.0`, `ltx-2.5`, `wan-2.2`, `seedance-2.5`, `wan-3.0`, `seedance-2.0-mini`, `veo3.1`, and 15 more.
- Audio (`audio`, true/false): Whether to include audio in the video. Defaults to `false` if not specified.
- Prompt (`prompt`, text, required): Describe what you want to generate.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "credits_charged": 1,
    "id": "example"
  }
}
```

### Generate an image

Create an image from a written prompt.

**Inputs**

- Idempotency key (`idempotency_key`, text): Idempotency key.
- Name (`name`, text): Give your image a custom name for easy identification.
- Image count (`image_count`, number, required): Number of images to generate. Maximum varies by model. From 1 to 16.
- Model (`model`, text): The AI model to use for image generation. Each model has different capabilities and costs. One of: `default`, `z-image-turbo`, `gpt-image-2`, `qwen-image-2.1`, `flux-2-klein`, `flux-3-klein`, `nano-banana-2.1`, `nano-banana-pro`, `krea-2`, `seedream-v5-pro`, and 9 more.
- Aspect ratio (`aspect_ratio`, text): The aspect ratio of the output image(s). If not specified, defaults to `1:1` (square). One of: `1:1`, `16:9`, `9:16`.
- Resolution (`resolution`, text): Maximum resolution (longest edge) for the output image. One of: `auto`, `640px`, `1k`, `2k`, `4k`.
- Prompt (`prompt`, text, required): Describe what you want to generate.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "credits_charged": 1,
    "id": "example"
  }
}
```

### Generate music

Create a music track from a written prompt.

**Inputs**

- Idempotency key (`idempotency_key`, text): Idempotency key.
- Name (`name`, text): Give your audio a custom name for easy identification.
- Duration (`duration`, number, required): Requested track duration in seconds, from 15 to 300. Determines credits charged. From 15 to 300.
- Prompt (`prompt`, text, required): Describe what you want to generate.
- Instrumental (`instrumental`, true/false): Create a track without vocals.
- Lyrics (`lyrics`, text): Lyrics for the new track.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "credits_charged": 1,
    "id": "example"
  }
}
```

### Get a video project

Check video generation status and retrieve available downloads.

**Inputs**

- Project ID (`project_id`, text, required): Unique ID of the video project. This value is returned by all of the POST APIs that create a video.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "credits_charged": 1,
    "downloads": [
      {
        "expires_at": "example",
        "url": "example"
      }
    ],
    "enabled": true,
    "end_seconds": 1,
    "error": {
      "code": "example",
      "message": "example"
    },
    "fps": 1,
    "height": 1,
    "id": "example",
    "name": "example",
    "start_seconds": 1,
    "status": "draft",
    "type": "example",
    "width": 1
  }
}
```

### Get an account

Read your plan and credit balance.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "auto_reload": {
      "status": "disabled"
    },
    "credits": 1,
    "email": "example",
    "id": "example",
    "subscription": {
      "billing_interval": "month",
      "cancel_at_period_end": true,
      "current_period_end": "example",
      "discount": {},
      "name": "example",
      "price": {},
      "status": "active"
    },
    "tier": "free"
  }
}
```

### Get an audio project

Check audio generation status and retrieve available downloads.

**Inputs**

- Project ID (`project_id`, text, required): Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "credits_charged": 1,
    "downloads": [
      {
        "expires_at": "example",
        "url": "example"
      }
    ],
    "enabled": true,
    "error": {
      "code": "example",
      "message": "example"
    },
    "id": "example",
    "name": "example",
    "status": "draft",
    "type": "example"
  }
}
```

### Get an image project

Check image generation status and retrieve available downloads.

**Inputs**

- Project ID (`project_id`, text, required): Unique ID of the image project. This value is returned by all of the POST APIs that create an image.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "credits_charged": 1,
    "downloads": [
      {
        "expires_at": "example",
        "url": "example"
      }
    ],
    "enabled": true,
    "error": {
      "code": "example",
      "message": "example"
    },
    "id": "example",
    "image_count": 1,
    "name": "example",
    "status": "draft",
    "type": "example"
  }
}
```

### List saved items

Browse saved Magic Hour items.

**Inputs**

- Type (`type`, text): Only return saved items of this type. One of: `character`, `reference`, `voice`, `moodboard`, `brand_kit` (Brand kit).
- Limit (`limit`, number): Maximum number of saved items to return. Defaults to 20. From 1 to 100.
- Cursor (`cursor`, text): Opaque pagination cursor from the previous response's next_cursor.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "assets": [
          {}
        ],
        "id": "example",
        "name": "example",
        "type": "character"
      }
    ],
    "next_cursor": "example"
  }
}
```

### List voices

Read the available voice catalog.

**Inputs**

- Limit (`limit`, number): Maximum number of voices to return. Defaults to 20. From 1 to 100.
- Cursor (`cursor`, text): Opaque pagination cursor from the previous response's next_cursor.

**Outputs**

- `data` (object): The response from Magic Hour.

**Example output**

```json
{
  "data": {
    "next_cursor": "example",
    "voices": [
      {
        "avatar_url": "example",
        "id": "example",
        "name": "example",
        "preview_url": "example"
      }
    ]
  }
}
```
