Mercury CLI
Documentation

Input

Video

The Video tool sends a prompt and optional project-local reference files to a configured MiniMax generator and saves the generated MP4 in your project. Video generation is billable and sends those inputs to the configured provider; for local image and video generation on your own computer without a paid API, see Local images and video.

Set up a video generator

  1. Run /logins minimax and connect a standard MiniMax Open Platform API key with pay-as-you-go access. An M Plan subscription alone does not establish H3 video access.
  2. Add a named generator under videoProvider.<name> in .mercury/settings.local.json in your project, or in settings.json in your Mercury config home:
{
  "videoProvider": {
    "studio": {
      "kind": "minimax",
      "model": "MiniMax-H3"
    }
  }
}
Key What it sets
videoProvider.<name>.kind The generator family: minimax.
videoProvider.<name>.model The generator model id: MiniMax-H3 or MiniMax-H3-Max.
videoProvider.<name>.baseUrl Optional. Defaults to api.minimax.io over HTTPS. An override must be an HTTPS origin without a path, query or credentials; HTTP is accepted only for a loopback provider.

API keys are stored through /logins minimax and never in videoProvider. Video appears in the tool roster when at least one generator is configured. When more than one generator is configured, calls must pass provider to select one; without a configured generator, the withheld-tool row points to /logins minimax and videoProvider.

Ask for a video

Generate a five-second, 16:9 video of a paper boat drifting across a quiet pond. Save it in renders/.

The model can call:

{
  "prompt": "A paper boat drifts across a quiet pond, soft afternoon light, slow camera movement.",
  "duration": 5,
  "aspect": "16:9",
  "outputDir": "renders"
}

The permission prompt lists the provider endpoint, model, prompt, reference paths and output directory. If your permission mode or an allow rule already covers the call, it runs without prompting.

Reference files and options

To animate a first-frame image, pass references: [{"path":"assets/boat.png","role":"first_frame"}] (and optional last_frame) with aspect: "adaptive". For reference-based creation, pass reference_image, reference_video or reference_audio; omitting role selects the matching reference role from the file type. Images, MP4/MOV clips and MP3/WAV audio must live inside the project, and reference paths and output directories cannot traverse symbolic links or leave the project. First/last-frame images cannot be mixed with reference-mode inputs. MiniMax's media count, file size, dimension, codec, duration and total request limits apply, and Base64 encoding increases the size of local references.

Option Meaning
duration Integer seconds, default 5. MiniMax-H3 accepts 4 to 15; MiniMax-H3-Max accepts 5 to 15.
aspect or ratio 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, or adaptive. Both must agree if supplied. Text-only defaults to 16:9; references default to adaptive. First/last frames use their image aspect.
resolution Default 768P. MiniMax-H3 accepts 768P and 2K; MiniMax-H3-Max accepts 480P and 768P.
extra.prompt_expansion_mode MiniMax-H3-Max option: disabled, balanced, or quality.
callback_url Optional MiniMax callback destination; task updates are also sent there, and the destination is disclosed in the permission request.
outputDir Project-local destination, default videos/, created when saving the first result.
timeoutSeconds Local waiting deadline, default 1200 seconds.

Results and preview frames

Mercury polls every 10 seconds and downloads the MP4 when the job succeeds. The result lists the local file path, duration and MiniMax job ID. MiniMax returns metered usage fields such as total_seconds and input_image_count instead of a dollar amount, and Mercury displays those fields without estimating a price.

When ffmpeg is on PATH, Mercury extracts a PNG preview frame at the 1-second mark beside the MP4 and links it in chat. Image-capable models receive that PNG preview, while the MP4 file itself stays out of model context. Without ffmpeg, the MP4 download still succeeds and the result notes that frame extraction was skipped.

A failed job returns MiniMax's error message verbatim. If a download URL expires, Mercury queries the same job ID for a fresh URL instead of submitting a new generation request. Cancelling locally or hitting the timeout does not cancel the job on MiniMax, so keep the returned job ID and avoid re-submitting the prompt automatically.

For a zero-code alternative, add MiniMax's MCP server through mercury mcp add using the vendor's setup instructions. See MiniMax's generation guide, V2 API, task query and pricing for current provider requirements and rates.