MiniMax H3

MiniMax H3 is a native multimodal video model supporting text-to-video, first/last-frame animation, and reference-guided generation with images, videos, and audio. It generates 4–15 second videos at 768p or 2K through the standard AI Video API task interface.

Model

Use minimax-h3 with:

POST https://api.aivideoapi.ai/v1/videos/generations

Pricing

ResolutionOutput videoInput reference video
2k34 credits/second34 credits/second
768p22 credits/second22 credits/second
  • The first 5 input images are free. Each image after the fifth costs 9 credits.
  • Reference audio is free.
  • Reference video duration is detected by the server and rounded up after summing all reference videos.
  • Credits are pre-charged before submission and fully refunded if generation fails.

For example, a default 5-second 2K text-to-video request costs 170 credits. A 5-second 2K output with 12 seconds of reference video costs (5 + 12) × 34 = 578 credits.

Request Body

FieldTypeRequiredDescription
modelstringYesMust be minimax-h3
inputobjectYesGeneration parameters described below
callback_urlstringNoReceives the platform task completion or failure callback

Input Parameters

FieldTypeRequiredDescription
promptstringYesNon-empty video prompt, maximum 7000 characters
generation_typestringNoomni_reference (default) or first_and_last_frames
image_urlsstring[]NoPublic HTTP(S) image URLs; up to 9 references or 1–2 frame images
video_urlsstring[]NoUp to 3 public MP4/MOV URLs; each 2–15 seconds, total no more than 15 seconds
audio_urlsstring[]NoUp to 3 public MP3/WAV URLs; audio cannot be the only reference media
resolutionstringNo2k (default) or 768p
durationintegerNoOutput duration from 4 to 15 seconds; default 5
aspect_ratiostringNoadaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16
watermarkbooleanNoAdd the MiniMax AIGC watermark; default false

Only public HTTP(S) media URLs are accepted. mm_file:// references and Data URIs are not supported by this gateway.

Generation Modes

Text-to-video

Omit all media arrays. The aspect ratio defaults to 16:9; adaptive is not allowed for text-only requests.

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-h3",
    "input": {
      "prompt": "An epic space-opera trailer, a lone captain watches the final fleet jump away",
      "resolution": "2k",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'

First/last-frame video

Set generation_type to first_and_last_frames. image_urls[0] is the first frame and the optional image_urls[1] is the last frame. Video and audio references cannot be combined with this mode. The output ratio follows the frame images.

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-h3",
    "input": {
      "prompt": "The camera pushes forward as morning light fills the room",
      "generation_type": "first_and_last_frames",
      "image_urls": [
        "https://example.com/first.png",
        "https://example.com/last.png"
      ],
      "resolution": "2k",
      "duration": 5
    }
  }'

Multimodal reference video

Use omni_reference with any supported combination of images, videos, and audio. Audio requires at least one reference image or video. Omit aspect_ratio to use adaptive.

curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-h3",
    "callback_url": "https://your-server.com/webhook",
    "input": {
      "prompt": "The character says: Follow the wind and live free, using the reference voice",
      "generation_type": "omni_reference",
      "image_urls": ["https://example.com/character.png"],
      "video_urls": ["https://example.com/motion.mp4"],
      "audio_urls": ["https://example.com/voice.mp3"],
      "resolution": "2k",
      "duration": 5,
      "aspect_ratio": "adaptive"
    }
  }'

Estimate Cost

Use the same request body with the estimate endpoint. It probes reference video duration but does not create a task or charge credits.

curl -X POST https://api.aivideoapi.ai/v1/estimate \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-h3",
    "input": {
      "prompt": "Animate the reference material with cinematic camera motion",
      "video_urls": ["https://example.com/reference.mp4"],
      "resolution": "2k",
      "duration": 5
    }
  }'

Task Lifecycle

Creation returns the platform task ID:

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24"
  }
}

Query the task with:

curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
  -H "Authorization: Bearer sk-your-api-key"

Status transitions are pendingprocessingcompleted or failed. Completed output uses the standard output.urls array. MiniMax's temporary result URL is copied to platform storage before completion is published.

Cancel a Task

curl -X DELETE https://api.aivideoapi.ai/v1/tasks/{taskId} \
  -H "Authorization: Bearer sk-your-api-key"

Only a task that MiniMax still reports as queued can be cancelled and refunded. A running task returns HTTP 409 and remains active.


Error Codes

When a request fails, the API returns a JSON error response:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

Error Reference

HTTP StatusCodeTypeDescription
400invalid_requestinvalid_request_errorMissing or invalid parameters
401invalid_api_keyauthentication_errorAPI key is invalid, disabled, or deleted
402insufficient_creditsbilling_errorCredit balance too low, please top up
403ip_not_allowedpermission_errorRequest IP not in the key's allowlist
404model_not_foundinvalid_request_errorModel does not exist or is inactive
404task_not_foundinvalid_request_errorTask ID does not exist
429rate_limit_exceededrate_limit_errorToo many requests, please slow down
429spend_limit_exceededbilling_errorKey spend limit reached (hourly/daily/total)
500internal_errorapi_errorUnexpected server error
503upstream_errorupstream_errorUpstream AI provider returned an error

Common Scenarios

invalid_request (400)

Returned when required fields are missing or invalid.

{
  "error": {
    "code": "invalid_request",
    "message": "'model' is required.",
    "type": "invalid_request_error"
  }
}

insufficient_credits (402)

Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.

invalid_api_key (401)

Possible causes:

  • The key does not start with sk-
  • The key has been disabled or deleted
  • The user account has been banned

upstream_error (503)

The upstream AI provider returned an error. This may happen when:

  • The input contains sensitive or prohibited content
  • The provider is temporarily unavailable
  • The request parameters are not supported by the provider

Credits are automatically refunded when a task fails due to upstream errors.