1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/hailuo-2.3";
const reqBody = {
"prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background.",
"duration": 6,
"resolution": "768p",
"prompt_optimizer": true,
"first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/29539533-f96d-4d18-ad41-71a17f06d160-44c1380a-3513-40b6-b085-bc2cd3cc5477.png"
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();Customizes video content; use for creative scenarios or instructional content.
Controls video length; choose 6 for brief clips or 10 for longer videos.
Allowed values:
Determines video clarity; use 768p for standard quality, 1080p for high definition.
Allowed values:
Enhances prompt execution; true optimizes outputs, false for basic generation.
Sets video aspect ratio; link to an image with desired dimensions.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on October 28, 2025.
Hailuo 2.3 from MiniMax is an advanced text-to-video model that transforms text prompts into fluid videos that are highly realistic. It works exceptionally well in producing lively character movements enhanced by photorealistic lighting and shadows. It supports a rich variety of artistic styles, including detailed realism to anime and traditional ink wash painting. It is an invaluable creation tool for artists, content creators, and professionals who want to design highly expressive and visually stunning videos, making it the perfect option because it can effectively capture even subtle facial micro-expressions and precise motion control.
Hailuo 2.3 seamlessly adapts to various styles, from photorealistic to anime and ink wash painting, while maintaining consistency throughout the video generation.
Hailuo 2.3 supports 768p for standard quality and 1080p for high-definition output, suitable for different use cases and requirements.
For the best quality, enable the prompt_optimizer parameter, use detailed prompts, and select 1080p resolution. You can also guide the aspect ratio and composition by using a first frame image.
The model offers two duration options: 6 seconds for quick clips and 10 seconds for more elaborate sequences; you can select the desired length via the duration parameter.
Yes, the model generates the best visual outputs when it is provided with prompts that include detailed motion commands for precise control over character movements and transitions.
The prompt optimizer automatically refines the input for enhanced prompt execution to get better video generation; you can also disable it for more control over the creative process.