Video GenerationHailuo
Hailuo 02
Generate videos from text or images using MiniMax's Hailuo 02 model with support for end-frame interpolation.
POST /v2/videos/generate — model: "hailuo-02"
Generate high-quality videos from text prompts or input images. Supports an optional end image for start-to-end frame interpolation. Available at 768p and 1080p resolution.
See Video Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
hailuoParams.duration | number | No | 6 | Video duration in seconds: 6 or 10 |
hailuoParams.resolution | string | No | "768p" | Video resolution: "768p" or "1080p" |
hailuoParams.image | string | No | — | Image URL for image-to-video generation |
hailuoParams.end_image | string | No | — | Image URL for the last frame (video interpolates from start to end) |
hailuoParams.prompt_optimizer | boolean | No | — | Enable the model's built-in prompt optimizer |
Constraint: 1080p resolution does not support 10s duration.
Credit cost
| Variant | Credits |
|---|---|
768p-6s | 5 |
768p-10s | 8 |
1080p-6s | 10 |
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 golden retriever running through autumn leaves in slow motion",
"model": "hailuo-02",
"hailuoParams": {
"duration": 6,
"resolution": "768p"
}
}'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 golden retriever running through autumn leaves in slow motion",
"model": "hailuo-02",
"hailuoParams": {
"duration": 6,
"resolution": "768p",
},
},
)
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 golden retriever running through autumn leaves in slow motion",
model: "hailuo-02",
hailuoParams: {
duration: 6,
resolution: "768p",
},
}),
});
console.log(await response.json());body := `{
"prompt": "a golden retriever running through autumn leaves in slow motion",
"model": "hailuo-02",
"hailuoParams": {
"duration": 6,
"resolution": "768p"
}
}`
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)Image-to-video with end frame
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": "smooth transition between two scenes",
"model": "hailuo-02",
"hailuoParams": {
"image": "https://example.com/start.jpg",
"end_image": "https://example.com/end.jpg"
}
}'Try it
POST
/v2/videos/generateTry it