Video Projects

AI UGC Ad Generator

Changed on

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.

post/v1/ai-ugc-ad

Request

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

Request body

scriptstring 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_secondsnumber 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.

Example request

{
  "assets": {
    "image_file_path": "api-assets/id/image.jpg"
  },
  "script": "Meet your new everyday essential.",
  "end_seconds": 4
}

Response

Success

idstring required

Unique ID of the video. Use it with the Get video Project API to fetch status and downloads.

credits_chargedinteger 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.

Example response

{
  "id": "cuid-example",
  "credits_charged": 450
}

Changes