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 speechandmmx 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-cliTo add the MiniMax skill to an AI agent such as Claude Code or OpenClaw, run:
npx skills add MiniMax-AI/cli -y -gAfter 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-xxxxxFor interactive login, choose OAuth or enter your API key when prompted:
mmx auth loginVerify the active session:
mmx auth statusCheck your remaining M Plan quota:
mmx quotaIf you already have MiniMax CLI installed, update it to access M4 and the latest media commands:
mmx updateConnect 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 setupChoose 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 / Flag | Purpose |
|---|---|
mmx text chat --message "..." | Single-turn chat |
mmx text repl | Start an interactive text session |
--model MiniMax-M4 | Use M4 for text generation |
--model MiniMax-M3.1-Flash | Select M3.1 Flash |
--stream | Enable 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 json | Return 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 / Flag | Purpose |
|---|---|
mmx image "prompt" | Shorthand image generation |
mmx image generate --prompt "..." | Full command form |
--model MiniMax-H3-Image | Use H3 Image |
--image photo.jpg | Edit with an image reference |
--n 3 | Generate multiple images |
--aspect-ratio 16:9 | Set output aspect ratio |
--area 2K | Set 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 / Flag | Purpose |
|---|---|
mmx video generate --prompt "..." | Submit a generation job |
--model MiniMax-H3 | Select H3 for text-to-video or reference-based video |
--reference-image character.png | Use a reference image with H3 |
--reference-video motion.mp4 | Guide H3 with a video clip |
--reference-audio rhythm.mp3 | Add audio to an H3 reference image or video |
--resolution 768P | Set H3 output to 768P (default: 2K) |
--download filename.mp4 | Download result on completion |
--async | Return task ID without waiting |
mmx video task get --task-id ID | Poll job status |
mmx video task get --task-id ID --model MiniMax-H3 | Check an H3 job |
mmx video download --file-id ID --out file.mp4 | Download by file ID |
Speech
The CLI uses speech-2.8-hd for text-to-speech by default.
| Command / Flag | Purpose |
|---|---|
mmx speech synthesize --text "..." | Basic TTS |
--out hello.mp3 | Write audio to file |
--stream | Stream audio to stdout |
--voice English_magnetic_voiced_man | Select a specific voice |
--speed 1.2 | Set playback speed (default: 1.0) |
--text-file - | Read text from stdin |
mmx speech voices | List 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 / Flag | Purpose |
|---|---|
mmx speech transcribe --file meeting.mp3 | Transcribe an audio file |
--language en | Set a language hint |
--response-format verbose_json --output json | Return speaker information and timestamps |
--response-format srt --out meeting.srt | Save subtitles as SRT (or use vtt for WebVTT) |
--stream --output text | Stream recognized text to stdout |
Vision
| Command / Flag | Purpose |
|---|---|
mmx vision photo.jpg | Describe a local image |
mmx vision describe --image URL | Describe an image by URL |
mmx vision describe --file-id ID | Describe by MiniMax file ID |
--prompt "What breed?" | Add a specific question to the analysis |
Search
| Command / Flag | Purpose |
|---|---|
mmx search "query" | Run a web search |
mmx search query --q "..." --output json | Return results as JSON |
Config and Maintenance
| Command | Purpose |
|---|---|
mmx config show | Display current configuration |
mmx config set --key region --value cn | Switch to CN region |
mmx config set --key default-text-model --value MiniMax-M3.1-Flash | Set default text model |
mmx config export-schema | Export command schemas for AI agents |
mmx update | Update 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.
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
- MiniMax Platform: Account management, API key generation, and usage dashboard.
- MiniMax M Plan: Subscription options and model access.
- MiniMax Company: Background on MiniMax’s model research and product portfolio.
- MiniMax Code: MiniMax’s coding agent for repository work and multi-step tasks.
- Best CLI AI Coding Agents: Discover more CLI AI coding agents.
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.










