MiniMax Hailuo 03

This guide shows how to generate videos using the MiniMax Hailuo 03 model via the Leonardo.AI REST API.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v2/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "model": "hailuo-03",
  "public": false,
  "parameters": {
    "prompt": "A koala and a cat playing together in a sunlit meadow",
    "quantity": 1,
    "width": 2560,
    "height": 1440,
    "duration": 5,
    "motion_has_audio": true
  }
}
'

API Request Endpoint, Headers, Parameters

Endpoint

https://cloud.leonardo.ai/api/rest/v2/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
durationintegerOptional. Duration of the video in seconds. Accepts 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. Defaults to 5.
guidancesobjectOptional. Object defining guidance inputs (e.g. reference images, start/end frames, audio) that influence the result.
guidances.audio_referencearrayOptional. Specifies a list of audio references for guidance. Maximum 3 items. Each item includes audio.id and audio.type (UPLOADED, GENERATED).
guidances.end_framearrayOptional. Creative reinterpretation of vibe or structure from a reference image. Maximum 1 item. Each item includes image.id and image.type (INIT, GENERATION, UPLOADED, GENERATED, VARIATION).
guidances.image_referencearrayOptional. References images to guide your video generation. Maximum 5 items. Each item includes image.id and image.type (INIT, GENERATION, UPLOADED, GENERATED, VARIATION), strength (LOW, MID, HIGH).
guidances.start_framearrayOptional. Creative reinterpretation of vibe or structure from a reference image. Maximum 1 item. Each item includes image.id and image.type (INIT, GENERATION, UPLOADED, GENERATED, VARIATION).
heightintegerOptional. Height of the output in pixels. Accepts 1440, 1920, 2560, 0. Defaults to 1440.
modelstringRequired. Specifies the model used for generation. Set to hailuo-03.
motion_has_audiobooleanOptional. MiniMax Hailuo 03 always generates native audio; this cannot be disabled. Defaults to True.
promptstringRequired. The prompt to use for the generation. Maximum 2000 characters.
publicbooleanOptional. Controls whether the generation is public (true) or private (false).
quantityintegerRequired. The number of outputs to generate. Defaults to 1. Range 1-1.
widthintegerOptional. Width of the output in pixels. Accepts 1440, 1920, 2560, 3360, 0. Defaults to 2560.

Dimensions

The API accepts width and height parameters in the following combinations:

Aspect RatioPixel Values (Width x Height)
21:9 (Landscape)3360 x 1440
16:9 (Landscape)2560 x 1440
4:3 (Landscape)1920 x 1440
1:1 (Square)1440 x 1440
3:4 (Portrait)1440 x 1920
9:16 (Portrait)1440 x 2560
Auto0 x 0

Defaults to 2560 x 1440. Setting both width and height to 0 selects Auto, which matches the dimensions of a supplied reference image.


Did this page help you?