Skip to main content
POST
https://api.apimart.ai
/
v1
/
videos
/
generations
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"
    }
  ]
}
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

Authorization
string
required
All API requests require Bearer Token authenticationGet API Key:Visit API Key Management Page to get your API KeyAdd to request header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
Video generation model nameFixed value: MiniMax-Hailuo-02
prompt
string
required
Video content descriptionDescribe the scene, actions, style, etc. in detail for better generation resultsExample: "A cute cat running on the grass"
duration
integer
default:"5"
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
resolution
string
default:"768p"
Video resolutionOptions:
  • 512p - Standard definition
  • 768p - High definition
  • 1080p - Full HD (only supports 5 second duration)
Default: 768p
prompt_optimizer
boolean
default:"true"
Whether to automatically optimize the promptWhen enabled, the system will automatically optimize your prompt for better generation resultsDefault: true
fast_pretreatment
boolean
default:"false"
Whether to reduce prompt optimization timeEnabling this can speed up processing, but may slightly affect optimization qualityDefault: false
watermark
boolean
default:"false"
Whether to add watermarkDefault: false
first_frame_image
string
Video first frame imageSupports 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
last_frame_image
string
Video last frame imageSupports 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

LimitationDescription
DurationOnly supports 5 or 10 seconds
1080p ResolutionOnly supports 5 second duration
Image FormatSupports public URL or Base64 encoded (data:image/jpeg;base64,...)

Resolution and Duration Combinations

ResolutionSupported DurationNotes
512p5s, 10sAll supported
768p5s, 10sAll supported
1080p5s10s not supported

Response

code
integer
Response status code, 200 on success
data
array
Response data array

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 ResultsVideo generation is an asynchronous task that returns a task_id upon submission. Use the Get Task Status endpoint to query generation progress and results.