ApiframeApiframe Docs
Video GenerationHailuo

Hailuo 03

Generate native 2K video with synchronized audio from text, frames, or reference media using MiniMax H3.

POST /v2/videos/generatemodel: "hailuo-03"

MiniMax H3 generates 4 to 15 second clips at native 2K with stereo audio produced in the same pass, so dialogue, effects, and ambience are synchronized to the picture rather than dubbed on afterwards. It accepts three kinds of input: a text prompt on its own, first and last frames, or a set of reference images, videos, and audio clips that carry a subject, style, or voice into the result.

See Video Generation overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeRequiredDefaultDescription
hailuoParams.durationnumberNo5Output length in seconds, any integer from 4 to 15
hailuoParams.resolutionstringNo"2K"Video resolution. "2K" is the only tier available today
hailuoParams.aspect_ratiostringNo"16:9"One of "auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"
hailuoParams.imagestringNoImage URL used as the first frame
hailuoParams.end_imagestringNoImage URL used as the last frame
hailuoParams.reference_imagesstring[]NoUp to 9 image URLs describing subjects or style
hailuoParams.reference_videosstring[]NoUp to 3 video URLs, 15s total across all clips
hailuoParams.reference_audiosstring[]NoUp to 3 audio URLs used as a voice reference

The prompt field accepts up to 7,000 characters for this model.

Constraints:

  • Frame inputs (image, end_image) and reference inputs (reference_images, reference_videos, reference_audios) cannot be combined in one request.
  • reference_audios requires at least one reference_images or reference_videos entry.
  • aspect_ratio: "auto" needs at least one media input. Text-only requests must pick a concrete ratio.
  • Reference videos must be 2 to 15 seconds each and 15 seconds in total.

Credit cost

Billed per second, on the output duration plus the total duration of any reference videos.

VariantCredits / second
2k22

Each reference image past the first five adds a flat surcharge:

VariantCredits
extra-image7

A 6 second clip costs 132 credits. The same clip with a 4 second reference video costs 220 credits (10 billed seconds). Add 7 reference images and it costs 234 credits (2 images past the free 5).

Example result

Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:

{
  "videoUrl": "https://cdn2.apiframe.ai/videos/b2c3d4e5-f6a7-8901-bcde-f23456789012.mp4"
}

The audio track is muxed into the mp4. See Result format for field details.

Code examples

curl -X POST https://api.apiframe.ai/v2/videos/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a chef plates a dish in a busy kitchen, steam rising, ambient clatter and low chatter",
    "model": "hailuo-03",
    "hailuoParams": {
      "duration": 6,
      "aspect_ratio": "16:9"
    }
  }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/videos/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a chef plates a dish in a busy kitchen, steam rising, ambient clatter and low chatter",
        "model": "hailuo-03",
        "hailuoParams": {
            "duration": 6,
            "aspect_ratio": "16:9",
        },
    },
)
print(response.json())
const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "a chef plates a dish in a busy kitchen, steam rising, ambient clatter and low chatter",
    model: "hailuo-03",
    hailuoParams: {
      duration: 6,
      aspect_ratio: "16:9",
    },
  }),
});
console.log(await response.json());
body := `{
  "prompt": "a chef plates a dish in a busy kitchen, steam rising, ambient clatter and low chatter",
  "model": "hailuo-03",
  "hailuoParams": {
    "duration": 6,
    "aspect_ratio": "16:9"
  }
}`
req, _ := http.NewRequest("POST", "https://api.apiframe.ai/v2/videos/generate",
    strings.NewReader(body))
req.Header.Set("X-API-Key", "afk_your_api_key_here")
req.Header.Set("Content-Type", "application/json")

resp, err := http.DefaultClient.Do(req)

Reference-driven generation

Pass reference media instead of frames to carry a subject, setting, or voice into a new scene. The references describe what appears; the prompt describes what happens.

curl -X POST https://api.apiframe.ai/v2/videos/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "she walks through the market at golden hour, greeting a vendor",
    "model": "hailuo-03",
    "hailuoParams": {
      "duration": 8,
      "aspect_ratio": "auto",
      "reference_images": [
        "https://example.com/character-front.jpg",
        "https://example.com/character-side.jpg"
      ],
      "reference_audios": ["https://example.com/voice-sample.mp3"]
    }
  }'

Try it

POST/v2/videos/generateTry it

On this page