APIMart
APIMart

How to Use MiniMax Hailuo 02: Full Guide

Learn to use MiniMax Hailuo 02 on APIMart: generate an API key, structure text-to-video and image-to-video requests, and render cinematic 1080p clips.

Tutorial

MiniMax Hailuo 02 is a powerful AI model for creating cinematic-quality videos with precise control over visuals, motion, and effects. It is available on APIMart through the MiniMax Hailuo 02 API, and it supports text-to-video, image-to-video, and first-to-last-frame transitions, letting you generate short, high-quality clips in resolutions up to 1080p. Here's what you need to know:

  • Key Features: Create videos from text prompts, a first-frame image, or a first-and-last-frame pair, and describe camera movement directly in the prompt.
  • Pricing: As of October 2026, 1080p clips cost $0.08/second on APIMart; see the model page for current rates.
  • Setup: Generate an API key, structure your request with parameters, and use asynchronous polling to retrieve videos.
  • Applications: Ideal for ads, product showcases, storyboarding, and training videos.

To get started, create an APIMart account, secure your API key, and follow the step-by-step guide for generating videos. Use specific prompts and clear camera directions to maximize video quality. For longer projects, stitch multiple clips together using consistent frames or explore Kling V3 API for alternative cinematic generation.

Key Takeaways

  • MiniMax Hailuo 02 generates text-to-video, image-to-video, and first-to-last-frame transition clips up to 1080p via APIMart, using the model ID MiniMax-Hailuo-02.
  • The workflow is to create an APIMart account, generate a key that is shown only once in API Key Management, POST a JSON body to https://api.apimart.ai/v1/videos/generations, then poll /v1/tasks/{task_id} every 15–30 seconds until the status is completed.
  • Key parameters are prompt, duration of 5 or 10 seconds, resolution of 512p, 768p, or 1080p, first_frame_image and last_frame_image as a public URL or Base64, and prompt_optimizer defaulting to true.
  • As of October 2026, APIMart pricing is $0.0104 per second at 512p, $0.04 per second at 768p, and $0.08 per second at 1080p; finished videos are read from data.result.videos[0].url[0], and results are kept for 72 hours, so save files promptly.
  • On APIMart, 1080p supports only 5-second clips and there is no native audio; videos longer than 10 seconds chain the last frame as the next first_frame_image.

MiniMax Hailuo 02 at a Glance

SpecificationDetails
DeveloperMiniMax
InputsText prompt; optional first-frame and last-frame images as a public URL or Base64
Output512p, 768p, or 1080p video; 1080p supports 5-second clips only
Clip length5 or 10 seconds; 10-second clips require 768p or 512p
AudioNo native audio; pair with MiniMax Audio tools such as Speech 2.8 or Music 2.6
Key featuresCamera direction written in the prompt; prompt_optimizer defaults to true; fast_pretreatment option
Pricing on APIMart (as of Oct 2026)$0.0104/sec at 512p, $0.04/sec at 768p, $0.08/sec at 1080p
AvailabilityAPIMart, model ID MiniMax-Hailuo-02, POST https://api.apimart.ai/v1/videos/generations
Best forAds, product showcases, storyboarding, training videos, B-roll with water, fire, smoke, and fabric
LimitsAsynchronous task_id; results are kept for 72 hours

Getting Started with MiniMax Hailuo 02 on APIMart

APIMart

Account Setup and API Key Access

To get started, head over to apimart.ai and create an account. If you're part of a team, APIMart allows you to set up an organization. This feature makes collaboration easier by letting everyone share a central balance, eliminating the need to exchange personal credentials.

Once your account is ready, fund your shared balance. This balance applies across all models on APIMart, including other high-end options like Veo 3.1 API for professional-grade video generation. Next, go to the API Key Management section in the Console Dashboard and generate an API key.

Keep in mind: your API key is displayed only once. Be sure to copy it and store it securely, like in a password manager or a secrets vault. When using the key in your code, load it from an environment variable (e.g., APIMART_API_KEY) instead of embedding it directly. This reduces the risk of accidental exposure if your code is ever shared or uploaded to version control. Every API request you make will include this key in the authorization header:

Authorization: Bearer YOUR_API_KEY

For teams, the Organizations feature is a great way to manage access centrally, avoiding the need to share individual account credentials [2]. With your API key ready, you can configure your request parameters and start generating videos. You can also explore Grok Imagine Video API for alternative high-quality outputs.

Key Parameters for MiniMax Hailuo 02 Requests

Once your API key is secured, you'll need to set up your request with the right parameters. The "model": "MiniMax-Hailuo-02" field is required, along with several others. Here's a quick overview of the most important ones:

ParameterTypeDescriptionNotes
modelstringIdentifies the modelMust be MiniMax-Hailuo-02
promptstringDescribes the scene, action, and styleRequired
durationintegerClip length in seconds5 (default) or 10; 1080p supports 5s only
resolutionstringOutput quality512p, 768p (default), or 1080p
first_frame_imagestringStarting frame for image-to-videoPublic URL or Base64 data URI
last_frame_imagestringEnding frame for start-and-end-frame modePublic URL or Base64 data URI
prompt_optimizerbooleanAuto-refines your promptDefaults to true; recommended

One important detail: video generation is asynchronous. When you send a request, the API responds with a task_id instead of the video itself. You'll need to poll /v1/tasks/{task_id} every 15–30 seconds until the status changes to "completed". Once it's ready, download the video promptly: results are kept for 72 hours [1].

With your parameters in place, you're ready to focus on crafting an effective prompt to fully utilize MiniMax Hailuo 02.

How to Write Effective Prompts

Creating a good prompt is key to generating high-quality videos. A well-structured prompt includes six elements: camera shot or motion, subject and description, action, scene, lighting, and style or mood. For example, instead of a vague description like "a woman walking in a city," try something more specific: "Tracking shot: a woman in a red coat walks briskly through a rain-soaked Manhattan street at dusk, neon signs reflecting on the wet pavement, cinematic noir style."

To make your videos dynamic, describe the camera movement in plain words at the start of the prompt, such as "slow push in", "tracking shot", or "static shot". APIMart's Hailuo 02 docs do not list a set of bracketed camera commands; the 15 bracketed Chinese commands covered later in this guide are documented for Hailuo 2.3.

When dealing with complex scenes, leave prompt_optimizer set to true. This feature automatically refines and expands your description, often leading to smoother and more coherent video output with minimal effort [1].

How to Create Cinematic AI Videos in Hailuo 02

Step-by-Step Guide: Generating Videos with MiniMax Hailuo 02

APIMart
MiniMax Hailuo 02: Video Generation Workflow on APIMart

How to Make a Basic Text-to-Video API Request

If you've got your API key and prompt ready, sending your first request is easy. Just make a POST call to https://api.apimart.ai/v1/videos/generations. Include your Bearer Token in the header and use a JSON body like this:

{
  "model": "MiniMax-Hailuo-02",
  "prompt": "Tracking shot: a lone astronaut walks across a red desert at golden hour, dust swirling around their boots, cinematic wide-angle style.",
  "duration": 5,
  "resolution": "1080p"
}

Important: 1080p resolution supports only 5-second clips. For a 10-second video, you'll need to lower the resolution to 768p or 512p. Pricing depends on both resolution and duration. As of October 2026, 768p costs $0.04 per second and 1080p costs $0.08 per second; see the model page for current rates.

When you submit the request, the API will return a task_id in data[0].task_id and a status of submitted. Render time depends on resolution, duration, and current load, so keep polling until the task finishes.

How to Use the Image-to-Video Feature

For image-to-video requests, you'll need to include an additional parameter: first_frame_image. This can be either a public URL (e.g., https://example.com/start.jpg) or a Base64-encoded Data URL string. Make sure the image meets the specified file type, size, and aspect ratio requirements.

Your prompt should describe the movement, not the visual details of the scene, since the image already provides that context. For instance, if your starting image is a product on a table, a prompt like "Slow zoom in. Product rotates gently, soft studio lighting, clean white background" tells the model how to animate it. The resolution of the output will match the dimensions of your input image, so using a high-quality source is essential for sharp results.

For more advanced effects, you can include a last_frame_image along with your first_frame_image. This creates a transition video between two images, which is perfect for things like product reveals, before-and-after comparisons, or scene transitions in larger projects.

Once your request is set up, monitor the API response to retrieve your animated video. For projects requiring integrated audio, consider exploring the Veo 3.1 API which supports synchronized sound generation.

Reading API Responses and Downloading Outputs

Poll GET https://api.apimart.ai/v1/tasks/{task_id}. When the task status changes to completed, the video URL is in data.result.videos[0].url[0]. There is no separate file ID or download endpoint. Here's how the status flow works:

StatusMeaningWhat to Do
submitted / pendingTask received or queuedWait and poll again
processingVideo is renderingWait and poll again
completedGeneration completeRead data.result.videos[0].url[0] and download
failedGeneration failedCheck the error field, retry

Poll the /v1/tasks/{task_id} endpoint every 15–30 seconds until the status changes to completed. Once it does, download the video from the returned URL. Results are kept for 72 hours, so save your file to your own storage promptly [1].

If you're working in Python, you can use requests.get(video_url).content to download the video and save it as an .mp4 file, where video_url is data["result"]["videos"][0]["url"][0] from the task response.

Finally, always check the code field in the API response. A value of 200 means the request was successful, but you'll still need to monitor the task status for potential rendering errors [1].

Improving Video Quality and Workflow Integration

Refining Prompts and Parameter Settings

To enhance video quality, try structuring prompts with this format: [Subject & action], [physical/environmental element], [camera movement], [lighting/atmosphere], [quality descriptor] [7]. Here's an example: "A barista pours steaming milk into espresso, liquid swirling in slow motion, slow zoom in, warm café lighting, cinematic quality." This approach helps the model simulate realistic motion and atmosphere more effectively.

If you need explicit camera tags, MiniMax Hailuo 2.3 API on APIMart supports 15 bracketed Chinese camera commands, placed at the start of the prompt with the exact labels [3]. Use the table below for quick reference:

CategoryCommands
Horizontal[左移] / [右移] pan left / right, [左摇] / [右摇] rotate left / right
Vertical[上升] / [下降] rise / descend, [上摇] / [下摇] tilt up / down
Depth[推进] / [拉远] push in / pull out, [变焦推近] / [变焦拉远] zoom in / out
Special[晃动] shake, [跟随] follow, [固定] static

By default, the prompt_optimizer feature is enabled, which generally improves the output quality. Keep it on unless you need the model to follow a highly specific script. If speed is your priority and you're okay with less polish, set fast_pretreatment: true to reduce preprocessing time [1][6].

Once your prompts and settings are fine-tuned, integrate them into a broader pipeline to elevate your production quality.

Building Multi-Model Pipelines with APIMart

Hailuo 02 works best when paired with complementary tools for audio and extended sequences. While it excels at creating visually dynamic B-roll footage - like water, fire, or fabric - it doesn't generate audio. To fill this gap, pair it with MiniMax Audio tools, such as Speech 2.8 for voiceovers or Music 2.6 for soundtracks, during post-production [8]. For brand or commercial projects, start with an image model to generate a base frame, then feed it into Hailuo 02 as the first_frame_image for precise control over composition [7].

For videos longer than 10 seconds, take a screenshot of the last frame from a finished clip and use it as the first_frame_image for the next request. This technique helps keep character details and environmental lighting consistent across multiple clips [8].

Error Handling and API Best Practices

Even with refined prompts and pipelines, issues can arise. Follow these best practices to troubleshoot and optimize API responses effectively.

The two most common failures with Hailuo 02 involve unsupported resolution/duration combinations and invalid image inputs. Always check that your resolution and duration settings are compatible [1][6]. For image-to-video tasks, MiniMax's own docs recommend a source image under 20MB, with a short edge greater than 300px and an aspect ratio between 2:5 and 5:2, in JPG, PNG, or WebP format [5].

Error TypeDetectionSolution
Unsupported configRequest rejected or task returns failedVerify resolution and duration compatibility [1]
Invalid imageAPI error on first_frame_imageCheck format (JPG/PNG/WebP), size, and aspect ratio [5]
Insufficient balanceHTTP 402Top up your APIMart balance [1]
Rate limit / timeoutHTTP 429 or connection dropBack off and lengthen the polling interval [4]

When a task fails, always check the error field in the task response. It provides details to help resolve issues quickly. For production setups, keep a modest polling interval and retry with exponential backoff, which reduces unnecessary API calls and keeps your workflow responsive.

Conclusion: Key Takeaways

Here's a quick rundown of what makes MiniMax Hailuo 02 a standout tool for video generation.

MiniMax Hailuo 02 offers cinematic-quality video creation with incredible precision. Thanks to its NCR architecture, which features 3x the parameters and 4x the training data compared to earlier models [7], it produces highly realistic effects for complex elements like water, fire, smoke, and fabric.

Through APIMart, 768p costs $0.04 per second and 1080p costs $0.08 per second as of October 2026 [2], making it a practical choice for everything from professional production to creative experimentation.

The model's standout features include:

  • Image-to-Video tools for precise control.
  • Prompt-level camera direction (e.g., "tracking shot", "slow zoom in") for professional-looking cinematography.
  • Last-frame continuity, ensuring smooth transitions for extended sequences.

Keep in mind, on APIMart 1080p clips are limited to 5 seconds (MiniMax's own announcement lists 6 seconds). For longer videos, 768p is a great alternative, offering 10-second clips at a lower price [1].

With these features, MiniMax Hailuo 02 is ready to elevate your video production workflow to the next level.

FAQs

How do I make clips longer than 10 seconds?

MiniMax Hailuo 02 has a maximum clip duration of 10 seconds, and 10-second clips need 768p or 512p (1080p supports 5 seconds only). For longer videos, generate several 10-second clips and chain them, using the last frame of one clip as the first_frame_image of the next.

For a 10-second text-to-video clip, include the following parameters in your request:

  • duration: 10
  • resolution: "768p"
  • model: "MiniMax-Hailuo-02"

After submitting the request, poll the task until it is completed, then download the video from data.result.videos[0].url[0].

What should I do if my task fails?

If your video generation task doesn't go through, start by reviewing the HTTP status and the error object in the response to pinpoint the issue. Here are the common ones to watch for:

  • 400: Invalid parameters, such as an unsupported resolution and duration combination.
  • 401: Authentication problems with your API key.
  • 402: Insufficient balance in your account.
  • 429: You've hit rate limits.

For rate limit errors (HTTP 429) or server-related issues (HTTP 5xx), try implementing exponential backoff - this means adding progressively longer delays between retries. Also, double-check your input parameters and ensure your prompts steer clear of sensitive content to avoid validation errors.

How can I keep characters consistent across clips?

To keep character consistency in MiniMax Hailuo 02, start each clip from a clear, well-lit first_frame_image of the character, and reuse the last frame of one clip as the first frame of the next. If you're working with multiple clips, include matching lighting details in your prompts. For a smoother visual flow, align camera angles across shots and consider subtle transitions like crossfades or match-cuts during post-production. These techniques help create a cohesive and polished narrative.

Tags#MiniMax Hailuo 02#AI video#text-to-video#image-to-video

About APIMart Team

APIMart Team writes model guides, side-by-side comparisons and pricing breakdowns for developers building with AI. APIMart gives you one API for chat, image and video models from multiple providers, so you can test the models covered here against each other before you ship.

Ready to build?

Choose the model you want in the model marketplace

Try chat, image and video models in the APIMart model marketplace, and experience model capabilities quickly with one unified API.

Chat modelsImage modelsVideo models
Explore model marketplace