cURL
Python
JavaScript
Go
Java
PHP
Ruby
Swift
C#
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-Hailuo-02",
"prompt": "A cute cat running on the grass",
"duration": 5,
"resolution": "768p",
"prompt_optimizer": true,
"fast_pretreatment": false,
"watermark": false
}'
{
"code" : 200 ,
"data" : [
{
"status" : "submitted" ,
"task_id" : "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}
Authorization
All API requests require Bearer Token authentication Get API Key: Visit API Key Management Page to get your API Key Add to request header: Authorization: Bearer YOUR_API_KEY
Request Parameters
Video generation model name Fixed value: MiniMax-Hailuo-02
Video content description Describe the scene, actions, style, etc. in detail for better generation results Example: "A cute cat running on the grass"
Video duration (seconds) Options:
5 - 5 second video
10 - 10 second video
Default: 5 1080p Limitation : When using 1080p resolution, only 5 second duration is supported
Video resolution Options:
512p - Standard definition
768p - High definition
1080p - Full HD (only supports 5 second duration)
Default: 768p
Whether to automatically optimize the prompt When enabled, the system will automatically optimize your prompt for better generation results Default: true
Whether to reduce prompt optimization time Enabling this can speed up processing, but may slightly affect optimization quality Default: false
Whether to add watermark Default: false
Video first frame image Supports two formats:
Public URL : https://example.com/start.jpg
Base64 encoded : data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...
Used to specify the starting frame of the video
Video last frame image Supports two formats:
Public URL : https://example.com/end.jpg
Base64 encoded : data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...
Used to specify the ending frame of the video
Parameter Limitations
Limitation Description Duration Only supports 5 or 10 seconds 1080p Resolution Only supports 5 second duration Image Format Supports public URL or Base64 encoded (data:image/jpeg;base64,...)
Resolution and Duration Combinations
Resolution Supported Duration Notes 512p 5s, 10s All supported 768p 5s, 10s All supported 1080p 5s 10s not supported
Response
Response status code, 200 on success
Response data array Task status, submitted on initial submission
Unique task identifier for querying task status and results
Use Cases
Case 1: Quick Text-to-Video Generation
{
"model" : "MiniMax-Hailuo-02" ,
"prompt" : "A cute cat running on the grass in bright sunshine"
}
Case 2: Generate High-Quality 1080p Video
{
"model" : "MiniMax-Hailuo-02" ,
"prompt" : "City night scene, neon lights flashing, traffic flowing" ,
"duration" : 5 ,
"resolution" : "1080p" ,
"prompt_optimizer" : true ,
"watermark" : false
}
Case 3: Generate Video from First Frame Image
{
"model" : "MiniMax-Hailuo-02" ,
"prompt" : "Person slowly turning around with a smile" ,
"duration" : 5 ,
"resolution" : "768p" ,
"first_frame_image" : "https://example.com/portrait.jpg"
}
Case 4: Transition Video with First and Last Frame Control
{
"model" : "MiniMax-Hailuo-02" ,
"prompt" : "Scene gradually transitions from day to night, sky color changing" ,
"duration" : 10 ,
"resolution" : "768p" ,
"first_frame_image" : "https://example.com/day.jpg" ,
"last_frame_image" : "https://example.com/night.jpg" ,
"prompt_optimizer" : true
}
Case 5: Fast Preprocessing Mode
{
"model" : "MiniMax-Hailuo-02" ,
"prompt" : "Waves crashing on the beach at sunset" ,
"duration" : 5 ,
"resolution" : "768p" ,
"prompt_optimizer" : true ,
"fast_pretreatment" : true
}
Query Task Results Video generation is an asynchronous task that returns a task_id upon submission. Use the Get Task Status endpoint to query generation progress and results.