Generate Text, Image, Video, Speech, and Music via CLI – MiniMax CLI

Generate text, video, speech, and music from the terminal with MiniMax CLI. Built for AI agents in Cursor, Claude Code, and OpenClaw.

MiniMax CLI (mmx) is an open-source command-line tool for accessing MiniMax’s multimodal AI platform. A single installation covers text generation, image creation and editing, video generation, speech synthesis and transcription, vision analysis, and web search.

It’s designed for developers who build AI agent pipelines in environments like Claude Code, Codex, or OpenClaw. You can call MiniMax’s models from shell scripts or add the CLI as a skill to your agent without writing custom API wrappers or setting up MCP servers.

The CLI works with MiniMax M4 and M3.1 Flash for text and reasoning, H3 for video generation up to 2K, and H3 Image for image creation and editing. Use the commands below to connect M4 to your coding agent and generate media directly from your terminal.

Features

  • Generates text responses in multi-turn conversations with streaming, system prompts, and JSON output.
  • Creates images from prompts and edits existing images with H3 Image, using up to 16 reference images.
  • Creates H3 videos from prompts, start and end frames, or reference media and tracks generation jobs by task ID.
  • Synthesizes speech with Speech 2.8 across 40 languages and 30+ voices, with speed control and streaming playback.
  • Transcribes recordings into text or subtitle files, with speaker information and timestamps in detailed JSON output.
  • Analyzes images and returns natural-language descriptions.
  • Searches the web and returns results in plain text or JSON.
  • Authenticates with an API key or browser-based OAuth login.
  • Configures MiniMax models for coding agents such as Claude Code, Codex, Grok Build, and DeepSeek Harness.

Use Cases

  • Extend a coding agent so it can inspect screenshots, search the web, and generate media through shell commands.
  • Automate content production by gathering sources and generating images, voiceovers, and short video clips from a script.
  • Create narrated product demos with mmx speech and mmx video.
  • Add AI actions to CI jobs or agent frameworks with JSON output and non-interactive flags.
  • Turn meeting recordings into searchable transcripts or subtitles for recorded presentations.

How to Use It

Installation

MiniMax CLI requires Node.js 18 or later. Install the CLI for direct terminal use:

npm install -g mmx-cli

To add the MiniMax skill to an AI agent such as Claude Code or OpenClaw, run:

npx skills add MiniMax-AI/cli -y -g

After installation, sign in to the MiniMax API Platform. Get an M Plan subscription key from Billing > M Plan, or create a standard pay-as-you-go key under API Keys. Authenticate with your key:

mmx auth login --api-key sk-xxxxx

For interactive login, choose OAuth or enter your API key when prompted:

mmx auth login

Verify the active session:

mmx auth status

Check your remaining M Plan quota:

mmx quota

If you already have MiniMax CLI installed, update it to access M4 and the latest media commands:

mmx update

Connect MiniMax to Coding Agents

The setup wizard configures MiniMax as a model provider in Claude Code, Codex, Grok Build, OpenCode, Hermes, Pi, Oh my Pi, Zed, and DeepSeek Harness. It can also install missing agents and backs up existing configuration files before changing them.

mmx agent setup

Choose your coding agent, API key, region, and the MiniMax-M4 model in the setup wizard. M4 accepts text and image input and has a 1-million-token context window. M3.1 Flash is the default model.


Available CLI Commands

Text

Text commands use MiniMax-M3.1-Flash by default. To send a prompt to M4, select it with --model:

mmx text chat --model MiniMax-M4 --message "Write a Python function to validate an email address" --stream
Command / FlagPurpose
mmx text chat --message "..."Single-turn chat
mmx text replStart an interactive text session
--model MiniMax-M4Use M4 for text generation
--model MiniMax-M3.1-FlashSelect M3.1 Flash
--streamEnable streaming output
--system "..."Set a system prompt
--message "user:Hi" --message "assistant:Hey!" --message "How are you?"Supply previous turns and a new user message
--messages-file -Read conversation JSON from stdin
--output jsonReturn structured JSON response

Image

Use MiniMax-H3-Image to generate high-resolution images or edit images from a prompt. Pass image paths with --image in the order you refer to them in your prompt.

mmx image generate --model MiniMax-H3-Image --prompt "Change the background to a beach" --image photo.jpg --out-dir ./out/
Command / FlagPurpose
mmx image "prompt"Shorthand image generation
mmx image generate --prompt "..."Full command form
--model MiniMax-H3-ImageUse H3 Image
--image photo.jpgEdit with an image reference
--n 3Generate multiple images
--aspect-ratio 16:9Set output aspect ratio
--area 2KSet the H3 Image output tier (1K, 2K, or 4K)
--out-dir ./out/Write all images to a directory

Video

Hailuo 2.3 is the default video model. For H3, authenticate with a standard pay-as-you-go API key. Select MiniMax-H3 to generate 4- to 15-second clips at 768P or 2K.

mmx video generate --model MiniMax-H3 --prompt "Clouds moving over mountains" --duration 5 --download mountains.mp4
Command / FlagPurpose
mmx video generate --prompt "..."Submit a generation job
--model MiniMax-H3Select H3 for text-to-video or reference-based video
--reference-image character.pngUse a reference image with H3
--reference-video motion.mp4Guide H3 with a video clip
--reference-audio rhythm.mp3Add audio to an H3 reference image or video
--resolution 768PSet H3 output to 768P (default: 2K)
--download filename.mp4Download result on completion
--asyncReturn task ID without waiting
mmx video task get --task-id IDPoll job status
mmx video task get --task-id ID --model MiniMax-H3Check an H3 job
mmx video download --file-id ID --out file.mp4Download by file ID

Speech

The CLI uses speech-2.8-hd for text-to-speech by default.

Command / FlagPurpose
mmx speech synthesize --text "..."Basic TTS
--out hello.mp3Write audio to file
--streamStream audio to stdout
--voice English_magnetic_voiced_manSelect a specific voice
--speed 1.2Set playback speed (default: 1.0)
--text-file -Read text from stdin
mmx speech voicesList all available voices

Speech-to-Text

Transcribe audio files up to 50 MB and 500 seconds with asr-1.0. The CLI handles common audio formats such as MP3, WAV, FLAC, and M4A.

Command / FlagPurpose
mmx speech transcribe --file meeting.mp3Transcribe an audio file
--language enSet a language hint
--response-format verbose_json --output jsonReturn speaker information and timestamps
--response-format srt --out meeting.srtSave subtitles as SRT (or use vtt for WebVTT)
--stream --output textStream recognized text to stdout

Vision

Command / FlagPurpose
mmx vision photo.jpgDescribe a local image
mmx vision describe --image URLDescribe an image by URL
mmx vision describe --file-id IDDescribe by MiniMax file ID
--prompt "What breed?"Add a specific question to the analysis

Search

Command / FlagPurpose
mmx search "query"Run a web search
mmx search query --q "..." --output jsonReturn results as JSON

Config and Maintenance

CommandPurpose
mmx config showDisplay current configuration
mmx config set --key region --value cnSwitch to CN region
mmx config set --key default-text-model --value MiniMax-M3.1-FlashSet default text model
mmx config export-schemaExport command schemas for AI agents
mmx updateUpdate the CLI to the latest version

Pricing and Quotas

MiniMax CLI is free to install. Model usage is billed through the M Plan subscription, purchased credits, or pay-as-you-go API access. The M4 launch offer starts at $22 per month with Go, followed by Explore ($55), Build ($132), and Scale ($200). Annual billing costs the equivalent of ten monthly payments.

All four plans include M4, M3.1 Flash, image and speech generation, web search, and image understanding. Explore, Build, and Scale also include H3 video in the subscription, along with 3, 7.5, and 11.5 times Go’s usage allowance, respectively.

All models included in M Plan draw from a shared weekly quota. On Go, Explore, and Build, requests to M4, H3, and image models count toward the weekly limit only. Other models also count toward a five-hour limit. Scale has a weekly limit for all models.

If you use a pay-as-you-go API key, M4 costs $0.80 per million input tokens, $0.05 per million cached input tokens, and $3.10 per million output tokens. M3.1 Flash costs $0.15 for input, $0.015 for cached input, and $0.60 for output per million tokens.

AI LLM API Pricing

Pros

  • Free, MIT-licensed CLI.
  • Designed for both human terminal users and autonomous AI agents in coding environments.
  • Machine-readable JSON output for scripts and AI agents.
  • Automatic backups of agent configuration files.

Cons

  • Paid model access is required.
  • Text-to-speech requests have a 10,000-character input limit.

Related Resources

FAQs

Is MiniMax CLI free to use?

The CLI itself is free and open source. You need an M Plan subscription key with an active allowance or purchased credits, or a funded pay-as-you-go API key for model calls.

Can I use MiniMax CLI in automated workflows?

Yes. After installation and authentication, agents can call mmx commands directly. Add --non-interactive to prevent input prompts and --output json to return data your scripts can parse.

Does the CLI support multi-turn conversations?

Yes. The mmx text chat command accepts repeated --message flags or a conversation in JSON format via --messages-file. For a continuous terminal conversation, use mmx text repl.

How does asynchronous video generation work?

Use --async to get a task ID immediately and poll with mmx video task get --task-id ID. For H3 tasks, include --model MiniMax-H3 when polling. To wait for a finished video and download it, use --download filename.mp4 without --async.

Can MiniMax CLI still generate music?

Music generation and cover commands were removed from the CLI in August 2026. For standalone song generation, use MiniMax Audio or download the MiniMax Music 3 model.

What happens when the quota runs out?

If you have purchased credits and enabled their automatic use, the CLI can continue using those credits after your plan quota is exhausted. Otherwise, wait for the relevant usage window to reset, upgrade your plan, or authenticate with a standard pay-as-you-go API key.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!