curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Lite",
"prompt": "The camera moves through a neon-lit street at night as rain runs down a car window.",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
MiniMax-H3
MiniMax-H3-Lite video generation
Generate video from text, a first frame, first and last frames, or multimodal references. Outputs are 480P or 768P and 4 to 15 seconds long.
POST
/
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-H3-Lite",
"prompt": "The camera moves through a neon-lit street at night as rain runs down a car window.",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Lite",
"prompt": "The camera moves through a neon-lit street at night as rain runs down a car window.",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
Output aspect ratio. You can also pass it as
size or ratio.- Text-to-video and multimodal reference generation accept
21:9,16:9,4:3,1:1,3:4, and9:16. The default is16:9. Passingadaptiveorautoreturns HTTP 400. - First-frame and first-and-last-frame generation follow the input frame aspect ratio. Omit the field or pass
adaptive. Other valid values leave the input frame ratio in effect.
Public HTTP(S) URL of the first frame. The platform also accepts and stores a Data URI for this field.
Public HTTP(S) URLs of reference images. You can provide up to 9 reference images across this field and
image_with_roles. All images in this array are references. To control the first or last frame, use frame fields or assign frame roles.Public HTTP(S) URLs of up to 3 reference videos, each 2 to 15 seconds long and at most 15 seconds combined. For one video, you can use the string field
video_url.Public HTTP(S) URLs of up to 3 reference audio clips, each 2 to 15 seconds long and at most 15 seconds combined. Include at least one reference image or video. For one clip, you can use the string field
audio_url.Whether to add an AIGC watermark. You can also pass it through
metadata.aigc_watermark.Input media requirements
Media URLs must be directly accessible over the public internet. Dimension limits apply to both width and height. Aspect ratio means width divided by height.| Media | Format and codec | File size limit | Dimensions, aspect ratio, and frame rate |
|---|---|---|---|
| Image | JPG / JPEG / PNG / WEBP / HEIC / HEIF | ≤ 30 MB | 256–5760 px, 0.4–2.5 |
| Reference video | MP4 / MOV (H.264 / H.265, AAC / MP3) | ≤ 50 MB | 256–5760 px, 0.4–2.5, 23.976–60 fps |
| Reference audio | WAV / MP3 | ≤ 15 MB | — |
Request examples
First frame
{
"model": "MiniMax-H3-Lite",
"prompt": "The camera slowly moves forward as morning light fills the room.",
"first_frame_image": "https://example.com/first.png",
"resolution": "480P",
"duration": 4
}
First and last frames
{
"model": "MiniMax-H3-Lite",
"prompt": "The scene transitions from morning to night as the lights inside come on.",
"image_with_roles": [
{
"url": "https://example.com/first.png",
"role": "first_frame"
},
{
"url": "https://example.com/last.png",
"role": "last_frame"
}
],
"resolution": "768P",
"duration": 5
}
Multimodal reference generation
{
"model": "MiniMax-H3-Lite",
"prompt": "Use the character from the reference image, follow the motion in the reference video, and deliver the dialogue in the reference voice.",
"image_urls": [
"https://example.com/character.png"
],
"video_urls": [
"https://example.com/motion.mp4"
],
"audio_urls": [
"https://example.com/voice.mp3"
],
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}
Check task status
After submission, read the task ID fromdata[0].task_id. Poll the task status endpoint every 5 to 10 seconds with a suggested client timeout of 15 minutes.
curl https://api.apimart.ai/v1/tasks/task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ \
--header 'Authorization: Bearer <token>'
data.status is completed, read the video links from the data.result.videos[0].url array. When the status is failed, check data.error.message.
The final charge is reported in data.cost.
Billing
Charges depend on the output resolution and the input media. See the model pricing endpoint for the rates that apply to your account.- The same per-second rate applies to output and reference videos at the selected resolution. For example, a 5-second output with 6 seconds of reference video is billed for 11 seconds.
- First frames, last frames, and reference images count toward the same allowance. The first 5 images are free, and each additional image incurs a charge.
- Reference audio is free.
Common parameter errors
These cases return HTTP 400 at submission and incur no charge.- The resolution or duration is out of range. Use
480Por768Pand setdurationto an integer from 4 to 15. - A last frame was sent alone, frame images were mixed with reference media, or reference audio was sent alone. Pair a last frame with a first frame and reference audio with an image or a video reference.
- A reference media count or reference video duration exceeds its limit. Check the limits for each media type and trim reference videos as needed.
- The service could not read a reference video duration. Check that its URL is publicly reachable and the video file is valid.
model_not_found, check that the model ID is exactly MiniMax-H3-Lite.