---
title: "AI UGC Ad Generator"
method: POST
path: "/v1/ai-ugc-ad"
tags: ["Video Projects"]
---

# AI UGC Ad Generator

`POST /v1/ai-ugc-ad`

## Request

- Base URL: `https://api.magichour.ai`
- URL: `https://api.magichour.ai/v1/ai-ugc-ad`
- Auth: HTTP bearer

Create a spoken UGC video from a prepared image and script. Returns a project ID; poll GET /v1/video-projects/{id} for status and downloads. To compose an image, generate the image separately with the Image Editor API and supply its download URL.

## Request body

- object
  - `assets` object, required
    - `image_file_path` string, required: Prepared image to animate. This value is either - a direct URL to the file. The URL path must end in a supported file extension. - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
  - `script` string, required: The words the actor should speak. Character limits apply after trimming: * kling-3.0: 2304 characters. * ltx-2.5: 1804 characters. * veo3.1: 2500 characters. LTX and Kling dialogue wrappers count toward their model prompt limit.
  - `end_seconds` number, required: Video duration in seconds. Supported values by model: * kling-3.0: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 seconds. * ltx-2.5: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 seconds. * veo3.1: 4, 6, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 106, 113, 120, 127, 134, 141 seconds. Free plans are limited to 5 seconds unless a credit pack has been purchased.
  - `model` 'kling-3.0' | 'ltx-2.5' | 'veo3.1': Defaults to kling-3.0 on paid plans and ltx-2.5 on free plans.
  - `resolution` '480p' | '720p' | '1080p': Defaults to 720p on paid plans and 480p on free plans. Unsupported model/resolution combinations and resolutions unavailable for your plan are rejected.

## Response `200`

Success

- object: Success
  - `id` string, required: Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.
  - `credits_charged` integer, required: The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video. If video generation fails, credits will be refunded, and this field will be updated to include the refund.

## Other responses

- `400`: Invalid Request
- `401`: Unauthorized
- `402`: Payment Required
- `404`: Not Found
- `422`: 422
- `500`: Internal Server Error

## Changes

- **2026-10-14** `e4d79f475b55`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/magichourhq/apis/magic-hour-api/changes/v1/ai-ugc-ad/post.md)

---

[API](https://skmtc.dev/magichourhq/apis/magic-hour-api.md) - [All operations](https://skmtc.dev/magichourhq/apis/magic-hour-api/llms.txt) - [OpenAPI document](https://skmtc.dev/magichourhq/apis/magic-hour-api/revisions/2ee5927306a9?raw)
