Skip to content

MiniMax-H3 Video API

MiniMax-H3 generates videos asynchronously from text, images, videos, and audio. Submit a task first, then poll the query endpoint with the returned task_id until the task reaches a terminal state.

API Overview

ItemValue
ModelMiniMax-H3
Base URLhttps://api.exchangetoken.ai
Create taskPOST /v2/video_generation
Query taskGET /v2/query/video_generation/{task_id}
AuthenticationAuthorization: Bearer YOUR_API_KEY
Content typeapplication/json (documented default; send it explicitly)

Callback URLs are not supported

Do not send callback_url. Poll the Exchange Token query endpoint with the returned platform task_id instead.

Create a Video Generation Task

http
POST https://api.exchangetoken.ai/v2/video_generation

Request Fields

FieldTypeRequiredDefaultDescription
modelstringYesNoneMust be MiniMax-H3
contentobject[]YesNoneMultimodal input array; every request must contain a non-empty text item
resolutionstringYesNone768P or 2K
durationintegerYesNoneGenerated video duration, from 4 to 15 seconds
ratiostringConditionaladaptive when optionaladaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16; see the scenario-specific behavior below

callback_url from the upstream MiniMax API is not accepted by Exchange Token.

Content Items

Every item in content has a type. Media items contain a nested object with a url field.

typeValue fieldSupported roleDefault behaviorDescription
texttextNonePrompt, up to 7,000 characters; at least one non-empty text item is required
image_urlimage_url.urlfirst_frame, last_frame, reference_imageWith exactly one image and no role, the role defaults to first_frameFirst/last frame or reference image
video_urlvideo_url.urlreference_videoNoneReference video
audio_urlaudio_url.urlreference_audioNoneReference audio

Media URLs can be public URLs or supported Base64 data URLs. Because the total JSON request body cannot exceed 64 MB and Base64 increases payload size, use public URLs for large media.

Supported Scenarios

Scenariocontent combinationratio rule
Text to videoOne text item onlyRequired; cannot be adaptive
First-frame image to videotext + one image_url with first_frame (or no role)Treated as adaptive
Last-frame image to videotext + one image_url with last_frameTreated as adaptive
First- and last-frame videotext + first_frame + last_frame imagesTreated as adaptive
Reference to videotext + any valid combination of reference image, video, and audioOptional; defaults to adaptive

First/last-frame inputs cannot be mixed with reference_image, reference_video, or reference_audio inputs in the same request.

For clarity, ratio=adaptive is not a valid default for text-to-video: text-to-video requests must explicitly select a concrete ratio. In image-to-video, the input image determines the aspect ratio and the API treats ratio as adaptive, even if another valid value is supplied. In reference-to-video, omitting ratio uses adaptive.

Media Limits

MediaLimits
ImageJPG, JPEG, PNG, WEBP, HEIC, or HEIF; up to 30 MB each; width and height 256–5760 px; aspect ratio 0.4–2.5; up to one first frame, one last frame, or nine reference images
VideoMP4 or MOV; H.264/H.265 video; up to 50 MB each; 2–15 seconds each and 15 seconds total; up to 3 clips; 256–5760 px; aspect ratio 0.4–2.5; 23.976–60 FPS
AudioWAV or MP3; up to 15 MB each; 2–15 seconds each and 15 seconds total; up to 3 clips

Text-to-Video Example

bash
curl -sS -X POST "https://api.exchangetoken.ai/v2/video_generation" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "content": [
      {
        "type": "text",
        "text": "A cinematic tracking shot of an astronaut walking through a neon-lit rainstorm, reflections shimmering on the street."
      }
    ],
    "resolution": "2K",
    "duration": 5,
    "ratio": "16:9"
  }'

Image-to-Video Example

bash
curl -sS -X POST "https://api.exchangetoken.ai/v2/video_generation" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "content": [
      {
        "type": "text",
        "text": "The camera slowly pushes in while steam rises from the cup."
      },
      {
        "type": "image_url",
        "image_url": {"url": "https://example.com/first-frame.png"},
        "role": "first_frame"
      }
    ],
    "resolution": "768P",
    "duration": 5,
    "ratio": "adaptive"
  }'

Reference-to-Video Example

bash
curl -sS -X POST "https://api.exchangetoken.ai/v2/video_generation" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "content": [
      {
        "type": "text",
        "text": "Keep the subject appearance and follow the movement and voice from the references."
      },
      {
        "type": "video_url",
        "video_url": {"url": "https://example.com/reference.mp4"},
        "role": "reference_video"
      },
      {
        "type": "audio_url",
        "audio_url": {"url": "https://example.com/reference.mp3"},
        "role": "reference_audio"
      }
    ],
    "resolution": "2K",
    "duration": 5,
    "ratio": "adaptive"
  }'

Create Response

json
{
  "task_id": "sg_vid_xxxxxxxxxxxxxxxx"
}

Save this Exchange Token task ID. It is the only ID you need for subsequent queries.

Query a Task

Replace {task_id} with the value returned by the create endpoint.

The query endpoint has no optional request fields or default values. The task_id path parameter and Authorization header are required.

http
GET https://api.exchangetoken.ai/v2/query/video_generation/{task_id}
bash
curl -sS "https://api.exchangetoken.ai/v2/query/video_generation/sg_vid_xxxxxxxxxxxxxxxx" \
  -H "Authorization: Bearer YOUR_API_KEY"

Task Statuses

StatusMeaning
queuedWaiting to run
runningGeneration is in progress
succeededGeneration completed; read the video URL from task.content.url
failedGeneration failed; inspect task.error
cancelledTask was cancelled

Query Response Fields

The HTTP response body contains a top-level task object.

FieldTypeReturnedDescription
taskobjectAlwaysVideo generation task details

task object

FieldTypeReturnedDescription
idstringAlwaysExchange Token platform task ID. This is the same ID used in the query path; the upstream task ID is not exposed
modelstringAlwaysModel used by the task; MiniMax-H3 for this endpoint
statusstringAlwaysCurrent task status: queued, running, succeeded, failed, or cancelled
errorobjectOn failureFailure details. See the task.error table below
created_atintegerAlwaysTask creation time as a Unix timestamp in seconds
updated_atintegerAlwaysLast task update time as a Unix timestamp in seconds
contentobjectOn successGenerated output. See the task.content table below
resolutionstringAlwaysRequested/output resolution: 768P or 2K
durationintegerAlwaysRequested/output duration in seconds
usageobjectAlwaysMetered usage. Basic counters are 0 before usage is available; see the task.usage table below
ratiostringWhen availableActual output aspect ratio. For adaptive generation, use this value to learn the selected ratio
task_typestringAlwaysFixed to generation on this Exchange Token endpoint
modalitystringAlwaysFixed to video on this Exchange Token endpoint

task.content object

FieldTypeReturnedDescription
urlstringWhen status=succeededTime-limited URL of the generated video; download or store it promptly

task.error object

FieldTypeReturnedDescription
codestringOn an upstream-reported failureMiniMax failure code. It may be absent for a platform-side failure
messagestringWhen status=failedHuman-readable failure reason

task.usage object

FieldTypeReturnedDescription
total_secondsintegerAlwaysTotal metered video seconds: input_seconds + output_seconds; 0 while unavailable
input_secondsintegerAlwaysTotal input reference-video seconds; 0 when no reference video is used or while unavailable
output_secondsintegerAlwaysGenerated output video seconds; 0 while unavailable
input_image_countintegerAlwaysTotal input image count, including first frame, last frame, and reference images; 0 when none
input_audio_secondsintegerWhen reference audio usage is returnedSum of input reference-audio segment durations, rounded to seconds
total_tokensintegerWhen returned by MiniMaxTotal equivalent usage tokens: prompt_tokens + completion_tokens
prompt_tokensintegerWhen returned by MiniMaxEquivalent input tokens derived from reference video, images, and reference audio; 0 when there is no multimodal input usage
completion_tokensintegerWhen returned by MiniMaxEquivalent output tokens derived from the generated video

Fields marked “Always” refer to a successful HTTP query response, including tasks that are still queued/running or have failed. Optional usage fields may be omitted until MiniMax returns them.

Successful Query Response

json
{
  "task": {
    "id": "sg_vid_xxxxxxxxxxxxxxxx",
    "model": "MiniMax-H3",
    "status": "succeeded",
    "created_at": 1785125529,
    "updated_at": 1785125946,
    "content": {
      "url": "https://example.com/generated-video.mp4"
    },
    "resolution": "2K",
    "duration": 5,
    "usage": {
      "total_seconds": 5,
      "input_seconds": 0,
      "output_seconds": 5,
      "input_image_count": 1,
      "input_audio_seconds": 6,
      "total_tokens": 273890,
      "prompt_tokens": 13500,
      "completion_tokens": 260390
    },
    "ratio": "16:9",
    "task_type": "generation",
    "modality": "video"
  }
}

Generated video URLs are time-limited. Download or store the result promptly after the task succeeds.

Failed Query Response

json
{
  "task": {
    "id": "sg_vid_xxxxxxxxxxxxxxxx",
    "model": "MiniMax-H3",
    "status": "failed",
    "error": {
      "code": "1026",
      "message": "video description contains sensitive content"
    },
    "resolution": "2K",
    "duration": 5,
    "ratio": "16:9",
    "task_type": "generation",
    "modality": "video"
  }
}

Error Format

Gateway errors use the Exchange Token error envelope:

json
{
  "error": {
    "type": "invalid_request",
    "message": "content must include a non-empty text item"
  }
}
HTTP statusTypical meaning
400Invalid JSON, unsupported callback_url, missing prompt, or invalid model/resolution/duration
401 / 403Missing, invalid, disabled, or unauthorized API key
402Insufficient quota
404Task not found or not owned by the current API key
422Input rejected by content safety checks
429Rate limit exceeded
500Internal error
502Upstream request or response error
503No available channel or asynchronous task service unavailable