POST
javascript
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-02-fast"; const reqBody = { "prompt": "sA 3D animated cartoon-style young boy sitting in a cozy recording studio, singing passionately into a professional podcast microphone. He is wearing large headphones, eyes expressive and wide, mouth open mid-song, showing emotion. One hand is lifted slightly as if feeling the music. There is a laptop, a sound mixer, and a coffee mug on the desk. Warm lighting and acoustic foam panels in the background. The scene feels lively, joyful, and full of musical energy.", "go_fast": true, "duration": 6, "prompt_optimizer": true, "first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/b372ccd3-7844-4c21-b1cb-4fc3c2e68db6-9d88374d-77b3-45d0-9bde-17d039e1bf7a.jpeg" }; (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); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

Provides the text scenario for video generation. Use creative or specific prompts to tailor outputs.


go_fastbool ( default: 1 )

Toggle to generate videos faster with slightly less quality. Use 'true' for quick drafts, 'false' for quality.


durationenum:str ( default: 6 )

Defines the length of the video. Choose 6 for shorter and 10 for longer scenarios.

Allowed values:


prompt_optimizerbool ( default: true )

Enhance the prompt's effectiveness. Use 'true' for better quality prompts.


first_frame_imagestr *

Sets the starting image and aspect ratio for the video. Select a high-quality URL for better results.

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.

What is MiniMax Hailuo 02?

MiniMax Hailuo 02 is an advanced generative AI model that transforms a single static image into a smooth, high-quality video clip. Designed for professional image-to-video workflows, it supports both 720p output at a consistent 25 frames per second. Whether you’re a developer building interactive apps, a creator crafting social media content, or a product manager prototyping marketing materials, MiniMax Hailuo 02 delivers fluid animations with controllable motion and seamless API integration.

Key Features

  • 720p Resolutions
  • 25 FPS Output: Ensures natural, flicker-free motion
  • Prompt-Driven Animation: Define scene dynamics via text prompts
  • Motion Customization: Adjust speed, direction, and intensity
  • Flexible Duration: Choose 6-second or 10-second clips
  • Fast-Draft Mode (go_fast=true): Accelerated generation with minimal quality trade-off
  • Prompt Optimizer (prompt_optimizer=true): Enhances prompt clarity and output relevance

Best Use Cases

  • Social Media Content: Eye-catching reels and stories with realistic camera pans or character movement
  • Interactive Apps & Games: Dynamic NPC animations and environment loops from concept art
  • Marketing & Advertising: Animated banners, product teasers, and hero visuals
  • Prototyping & Storyboarding: Rapid scene drafts for pitches and design reviews
  • Educational & Training: Visual explainers that bring diagrams and illustrations to life

Prompt Tips and Output Quality

  1. First_Frame_Image
    • Supply a high-resolution URL (ideally 16:9 ratio for 1080p).
    • Use clear, well-lit images to maximize texture detail.
  2. Prompt
    • Be descriptive: “A vintage car cruises along a coastal road at sunset.”
    • Highlight motion attributes like direction, speed, and focal points.
  3. Duration
    • Default: 6 seconds. For longer storytelling, set duration=10.
  4. Go_Fast Mode
    • For quick iterations, enable go_fast=true. For final assets, keep it false.
  5. Prompt_Optimizer
    • Use prompt_optimizer=true to automatically refine prompt language for better quality.

FAQs

Q: What resolutions and frame rates are supported?
A: MiniMax Hailuo 02 outputs at 720p at 25 fps for smooth, cinematic motion.

Q: Which image formats can I use?
A: Accepts PNG, JPEG, and WebP—just provide a valid URL in first_frame_image.

Q: How do I integrate the model into my app?
A: Use the REST-based API endpoint. Send a JSON payload with prompt, first_frame_image, and optional flags (go_fast, duration, prompt_optimizer).

Q: Can I customize the length of the video?
A: Yes. Set duration=6 for standard clips or duration=10 for extended sequences.

Q: How do I control motion style?
A: Describe desired motion in your prompt (e.g., “slow zoom out to reveal a mountain range”) and leverage prompt_optimizer for clarity.