MiniMax M4 API
Coming SoonMiniMax M4 is a massive multimodal MoE LLM (2.74T params, 66B active) with 1M context, advanced sparse attention, and strong code/agentic capabilities.
MiniMax M4 API Background
Overview
MiniMax M4 is a natively multimodal mixture-of-experts (MoE) large language model developed by MiniMax, designed for long-horizon reasoning, complex agentic workflows, and code-driven creative production. Released on December 4, 2026, it processes text, image, and video inputs while generating text output, including executable code. With 2.74 trillion total parameters and 66 billion active parameters per token, it achieves a balance between massive knowledge capacity and inference efficiency. Its 1 million token context window enables entire codebases or multi-hour video analyses in a single pass. The MiniMax M4 API is particularly suited for professional finance, multi-step agent systems, and 3D creative tasks that require sustained reasoning and tool orchestration.
Development History
MiniMax M4 was developed through a rigorous training pipeline that incorporated Reinforcement Learning from Chain-of-Thought (RLCISP) and multi-teacher on-policy distillation. The model consolidates 28 domain experts into a unified architecture, allowing it to match or exceed specialized models across diverse fields. Research and development focused on overcoming long-context memory bottlenecks, leading to the creation of MiniMax Sparse Attention 2 (MSA2) and MFlashKV storage optimizations. As of launch, weights have not yet been released; the team plans to open-source them following additional safety evaluations within the coming weeks, aligning with responsible AI practices.
Key Innovations
- MiniMax Sparse Attention 2 (MSA2) with 68 attention layers using block sparse attention, compressed indexing, and lookahead mechanisms for efficient long-context processing
- MFlashKV SSD-based key-value offloading that keeps hot blocks and indices in high-bandwidth memory (HBM), enabling 1M token context with dramatically reduced memory overhead
- Native multimodal input processing for text, images, and video combined with code output for external tool integration, enabling sophisticated agentic and creative workflows
- RLCISP and multi-teacher on-policy distillation that consolidate 28 domain experts into a single model, maintaining specialist-level performance while unifying architectural complexity
MiniMax M4 API Technical Specifications
Architecture
MiniMax M4 is a native multimodal mixture-of-experts transformer with 68 attention layers employing MiniMax Sparse Attention 2 (MSA2). It uses key-value sharing via Multi-Query Attention (MQA) and block sparse attention patterns to reduce computation. The architecture includes compressed indexing and lookahead mechanisms to preserve relevant information across long contexts. MFlashKV offloads key-value tensors to solid-state drives (SSDs) while keeping frequently accessed blocks and indices in HBM, facilitating a 1 million token context window. The model processes text, image, and video inputs through a shared encoder framework, and generates text including code. The MiniMax M4 API operates with thinking always enabled, offering effort levels from low to max (defaulting to max), and supports tool use with streaming.
Parameters
2.74 trillion total parameters with 66 billion active per token, leveraging MoE to activate only a subset of parameters for each token, thereby controlling computational cost.
Capabilities
- Processes text, image, and video inputs; outputs text and generated code (e.g., Python, JavaScript) for external orchestration
- Supports a 1,000,000 token context window, suitable for analyzing entire large code repositories, long-form financial reports, or hour-long video content
- Native tool use with tool results and streaming via the Anthropic-compatible API, enabling multi-step agent workflows like computer use and autonomous code execution
- Reasoning with adjustable effort (low, medium, high, xhigh, max), allowing users to trade latency for depth of thought
Limitations
- Weights are not yet released as of launch; open-sourcing is planned only after safety evaluations, so no local deployment or custom fine-tuning is available immediately
- Does not natively generate images, video, or audio; such outputs are achieved via generating code that calls external tools, but not as direct model outputs
- The API cannot process audio-only files; inputs must be text, image, or video
- Fixed parameters: temperature (1.0), top_p (0.95), and top_k are ignored, so users cannot adjust randomness
- Thinking is always enabled; disabling it returns a 400 error, and since max_tokens includes both reasoning and answer, users must set sufficiently high caps to avoid truncated responses
MiniMax M4 API Performance
Strengths
- Vendor-reported 4x reduction in key-value cache size, 4.48x faster prefill, and 8x faster decode compared to a reference baseline, enabling cost-effective handling of extremely long contexts (these are comparative improvements, not absolute guarantees)
- Excels in long-horizon engineering tasks such as understanding and modifying entire legacy codebases, generating comprehensive unit tests, and debugging complex distributed systems
- Demonstrates robust multi-step agent performance, coordinating tool calls, web searches, and file operations without losing context or task focus
- Superior in professional finance and analysis, parsing earnings calls, financial statements, and market data to produce detailed investment memos or risk assessments
Real-world Effectiveness
In practice, MiniMax M4 is designed to outperform smaller or less complex models in tasks requiring sustained reasoning and memory. For instance, it can review a multi-terabyte software monorepo to identify security vulnerabilities, or follow a 100,000-word research paper to extract methodology and propose extensions. In agentic settings, it maintains state across dozens of tool interactions, making it suitable for automating complex desktop workflows. However, its performance is best realized when using the MiniMax M4 API with appropriate effort settings and sufficient tokens for both thinking and final output, as lower effort levels may reduce depth for extremely challenging problems. The model's multimodal input allows it to analyze schematic diagrams or video demonstrations, which it then translates into code for further processing.
MiniMax M4 API When to Use
Scenarios
- You have a large enterprise software codebase with millions of lines and need to refactor, migrate, or document it. MiniMax M4's 1M token context and code generation enable it to process entire modules at once, identifying dependencies and suggesting changes with full awareness, reducing manual analysis time from weeks to days.
- You are building a multi-step autonomous agent that must perform tasks like browser automation, file manipulation, or API orchestration. The MiniMax M4 API's strong tool-use support, streaming responses, and long context allow it to maintain goals across many interactions without losing state, making it ideal for advanced computer use and workflow automation.
- You work in professional finance or research analysis, needing to process video earnings calls, financial filings, and market data. M4's multimodal input and long horizon reasoning let it synthesize these diverse sources into coherent forecasts or risk models, outputting structured text and code for quantitative analysis, saving substantial analyst hours.
- You are a creative professional or game developer generating 3D assets or film pre-visualizations. While M4 cannot natively produce imagery, its code generation capabilities enable it to write scripts for external 3D engines or procedural generation tools, translating natural language briefs into executable logic for complex scenes or game mechanics.
Best Practices
- Set the thinking effort appropriately: use 'low' or 'medium' for straightforward tasks with shorter contexts to reduce latency, and 'high' or 'max' for complex reasoning, multi-step planning, or coding challenges where deeper analysis is crucial.
- Always allocate a generous max_tokens value because it includes both the model's thinking and the final answer; a cap too low can truncate the response mid-reasoning. For long outputs, plan for at least 20,000 tokens.
- Use tool_choice 'auto' only, as forced tool selection is not supported, and preserve the full assistant thinking, text, and tool-use history across turns to maintain coherence.
- Leverage the cache read feature to reduce costs when repeatedly sending similar long prompts (e.g., a fixed codebase context) across multiple API calls, but note that cache pricing is separate and must be configured properly.
- For video or image inputs, ensure the files are clear and appropriately sized; the model cannot process audio-only files, so pair audio with video or transcript text if needed.