CLI for MiniMax AI Platform
raw JSON →The `mmx-cli` package provides the official command-line interface for interacting with the MiniMax AI Platform, enabling users and AI agents to programmatically access various AI capabilities. This robust CLI, currently at version 1.0.11, supports a wide array of generative AI tasks including multi-turn text chat with streaming and JSON output, text-to-image generation with aspect ratio controls, asynchronous video generation with progress tracking, text-to-speech with over 30 voices, and text-to-music generation including lyrical and instrumental modes. It also features image understanding (vision) and web search integration. Designed for both direct terminal use and integration into AI agents (e.g., OpenClaw, Cursor, Claude Code), it emphasizes ease of use for rapid prototyping and deployment of AI-powered workflows. The CLI offers seamless support for both Global (`api.minimax.io`) and CN (`api.minimaxi.com`) platform regions. While a specific release cadence isn't published, the frequent updates to generative AI models suggest active development and maintenance.
Common errors
error mmx: command not found ↓
npm install -g mmx-cli or execute on demand using npx mmx <command>. error Error: Unauthorized - Invalid API Key or missing authentication. ↓
mmx auth login --api-key sk-xxxxx with a valid and active API key. Ensure your token plan has sufficient quota. error Error: Invalid model specified. Available models are: [list of models] ↓
mmx text chat --help to find available models for the specific command, or use a default model. Warnings
gotcha The `mmx-cli` requires Node.js version 18 or higher to function correctly. Older Node.js versions may lead to installation failures or runtime errors. ↓
gotcha A MiniMax API key is mandatory for using any of the AI capabilities provided by the CLI. Attempts to use commands without prior authentication will result in authorization errors. ↓
gotcha While `npm install -g mmx-cli` makes the `mmx` command globally available, it can lead to versioning conflicts if multiple projects require different CLI versions. Using `npx mmx ...` ensures you always run the latest or a project-specific version without global installation. ↓
Install
npm install mmx-cli yarn add mmx-cli pnpm add mmx-cli Imports
- mmx wrong
import { mmx } from 'mmx-cli'correctnpm install -g mmx-cli - npx mmx wrong
const mmx = require('mmx-cli')correctnpx mmx text chat --message "Hello" - skills add MiniMax-AI/cli
npx skills add MiniMax-AI/cli -y -g
Quickstart
# Authenticate with your API key
mmx auth login --api-key sk-xxxxx-YOUR_API_KEY_HERE
# Generate text: What is MiniMax?
mmx text chat --message "What is MiniMax?"
# Generate an image: A cat in a spacesuit
mmx image "A cat in a spacesuit"
# Synthesize speech: "Hello!" to an MP3 file
mmx speech synthesize --text "Hello!" --out hello.mp3
# Generate video: Ocean waves at sunset
mmx video generate --prompt "Ocean waves at sunset"
# Generate music: Upbeat pop with lyrics
mmx music generate --prompt "Upbeat pop" --lyrics "[verse] La da dee, sunny day"
# Perform a web search: MiniMax AI latest news
mmx search "MiniMax AI latest news"
# Analyze an image (replace photo.jpg with your image path)
mmx vision photo.jpg
# Check your current quota usage
mmx quota