CLI for MiniMax AI Platform

raw JSON →
1.0.11 verified Thu Apr 23 auth: no javascript

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.

error mmx: command not found
cause The `mmx-cli` package is not installed globally or is not in your system's PATH, or you are trying to run it without `npx`.
fix
Install globally with npm install -g mmx-cli or execute on demand using npx mmx <command>.
error Error: Unauthorized - Invalid API Key or missing authentication.
cause The MiniMax API key is either not set, incorrect, or expired. The CLI could not authenticate with the MiniMax platform.
fix
Authenticate using 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]
cause The `--model` flag was used with a model name that is not supported by the MiniMax API or the specified command.
fix
Consult the MiniMax documentation or use mmx text chat --help to find available models for the specific command, or use a default model.
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.
fix Upgrade Node.js to version 18 or newer. Use a Node.js version manager like `nvm` (e.g., `nvm install 18 && nvm use 18`).
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.
fix Obtain an API key from the MiniMax platform and authenticate using `mmx auth login --api-key sk-xxxxx`. Ensure your token plan is active.
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.
fix For project-specific use or to avoid global pollution, prefer `npx mmx <command>` instead of global installation. If global installation is desired, periodically update with `npm update -g mmx-cli`.
npm install mmx-cli
yarn add mmx-cli
pnpm add mmx-cli

Demonstrates authentication, text, image, speech, video, music, search, and vision generation, plus quota checking using the `mmx` CLI, showcasing its core functionalities.

# 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