Minimax-M4 Coding Setup: Pricing, Benchmarks & Claude Code Guide

Build a fast MiniMax-M4 coding setup for Claude Code, Cursor, and OpenRouter using $0.05/M prompt caching, verified benchmarks, and routing.

DDeven Rathore 11 min read

MiniMax-M4 hit GitHub and climbed to 485 points and 162 comments on Hacker News in December 2026 as a 2.74-trillion-parameter, natively multimodal MoE model with a 1M context window. No solo developer is self-hosting 2.74T parameters on a desk workstation. The practical MiniMax-M4 coding setup routes Claude Code, Cursor, and OpenRouter through its hosted APIs at $0.80 per million input tokens, $3.10 per million output tokens, and $0.05 per million cached input tokens.

Key Takeaways

  • Skip local hosting for now: MiniMax-M4 activates 66B of its 2.74T parameters per token, and public weights roll out after safety evaluations—API endpoints are the realistic path for daily coding.
  • Caching transforms agent economics: Flat pricing across the full 1M window plus $0.05/M cached reads makes multi-turn repository loops dramatically cheaper than cold input billing.
  • Drop-in editor support: Anthropic- and OpenAI-compatible endpoints alongside OpenRouter's minimax/minimax-m4 ID let you wire it into Claude Code, Cursor, and OpenCode in minutes.
  • Strong multimodal coding scores: Reported marks of 58.5% on SWE-bench Multimodal, 76.4% on Vibe Code Bench v1.1.1, and 80.0% on OSWorld v2.1 suit visual debugging and large refactors.

What MiniMax-M4 Actually Ships Today

MiniMax-M4 pairs a massive 2.74T-parameter Mixture-of-Experts backbone with a 66B active parameter footprint and a native 1M-token context window. According to the MiniMax-AI/MiniMax-M4 GitHub repository, the model handles text, images, and video natively inside one unified architecture.

Under the hood, the network uses 384 routed experts with top-4 routing plus 1 shared expert. Keeping active parameters at 66B lets inference clusters serve long coding threads at usable speeds despite the 2.74T total weight count.

Two systems choices keep that 1M context window practical on the server side. MiniMax Sparse Attention 2 (MSA2) cuts attention overhead across huge prompts, while MFlashKV offloads KV-cache state to SSDs so long-lived sessions stay warm.

Before you clear disk space, check the open-weights caveat. Public weights are scheduled to roll out after safety evaluations finish, and hosting 2.74T total parameters still demands multi-node cluster hardware. Individual engineers and small teams should plan around hosted API access.

MiniMax-M4 API Pricing and Prompt Caching Math

MiniMax-M4 API pricing stays flat across the entire 1M context window at $0.80 per million input tokens, $3.10 per million output tokens, and $0.05 per million cached input tokens. You can verify current billing and endpoint details directly on the MiniMax platform.

Billing Component MiniMax-M4 Rate Practical Impact on Coding Agents
Standard Input $0.80 / 1M tokens Flat across the full 1M context with no long-context surcharge tier
Cached Input $0.05 / 1M tokens 16x cheaper than uncached input (93.75% savings on warm prefixes)
Output Tokens $3.10 / 1M tokens Covers both final code edits and always-on reasoning tokens
Subscription Tiers M Plan / MiniMax Code Predictable flat billing for heavy daily interactive use

Many competing frontier coding APIs pair higher base token rates with steep price jumps once a prompt crosses a long-context threshold. Flat pricing across the full 1M window removes the penalty for loading a full service directory into context.

How Prompt Caching Changes Multi-Turn Agent Loops

Coding agents resend the same system prompt, tool schemas, and core source files on every turn. That repetition turns the $0.05/M cached input rate into the most important line item on your bill.

Consider a realistic 15-turn debugging loop with 200,000 tokens of repository context, 2,000 fresh input tokens on each follow-up turn, and 1,500 output tokens per turn:

  • Turn 1 cold input (200K tokens): $0.16 at $0.80/M.
  • Turns 2–15 cached reads (2.8M tokens): $0.14 at $0.05/M.
  • Turns 2–15 new diffs and tool output (28K tokens): $0.02 at $0.80/M.
  • All 15 turns of output (22.5K tokens): $0.07 at $3.10/M.

That entire 15-turn, 200K-context session lands around $0.39 with caching, compared to roughly $2.49 if every input turn billed at the uncached $0.80/M rate. Keep your tool declarations stable so you do not bust the cached prefix mid-session—our guide to lean MCP servers for Claude Code covers how bloated tool schemas quietly erode cache hit rates.

Pay-As-You-Go vs. M Plan and MiniMax Code Tiers

Pay-as-you-go API billing fits engineers who run bursty refactors, switch models through OpenRouter, or wire MiniMax-M4 into automated CI scripts. You pay strictly for tokens consumed and benefit immediately from prompt caching.

M Plan and MiniMax Code subscription tiers on the MiniMax platform make more sense when you live inside an agentic loop all day. If predictable monthly spend matters more than metered flexibility, start with a subscription tier and keep a small API balance for headless scripts.

How to Wire MiniMax-M4 Into Claude Code, Cursor, and OpenRouter

Because MiniMax provides both Anthropic- and OpenAI-compatible API endpoints alongside hosted access on OpenRouter, connecting your editor takes just a few configuration lines. You can test MiniMax-M4 inside your existing workflow without rebuilding your keybindings or agent rules.

Setting Up MiniMax-M4 in Claude Code

Your MiniMax-M4 Claude Code setup relies on MiniMax's Anthropic-compatible endpoint. Copy the exact regional Anthropic-compatible base URL and API key from your MiniMax console, then wrap Claude Code in a dedicated shell function in .zshrc or .bashrc.

claude-m4() {
  ANTHROPIC_BASE_URL="<your-minimax-anthropic-base-url>" \
  ANTHROPIC_AUTH_TOKEN="$MINIMAX_API_KEY" \
  ANTHROPIC_MODEL="MiniMax-M4" \
  claude "$@"
}

Wrapping the overrides in a shell function like claude-m4 keeps your default claude command untouched, so you can switch models per terminal tab without editing global config files.

Connecting Cursor and OpenCode via OpenRouter or Direct API

For editors that speak the OpenAI protocol, you have two clean paths: point directly at MiniMax's OpenAI-compatible endpoint or route through MiniMax M4 on OpenRouter using the model ID minimax/minimax-m4.

  • In Cursor: Open Settings, go to Models, add a custom OpenAI-compatible API key and base URL from either MiniMax or OpenRouter, and register minimax/minimax-m4 (for OpenRouter) or the direct model identifier from your MiniMax dashboard.
  • In OpenCode: Add an OpenAI-compatible provider block pointing to your OpenRouter or MiniMax base URL and select minimax/minimax-m4 when running a MiniMax-M4 OpenRouter session.
  • Switching across editors: If you are still deciding which client fits your daily rhythm, compare their workflows in our Cursor vs. Windsurf vs. Claude Code guide.

Here is a minimal provider entry you can adapt for OpenCode or any OpenAI-compatible CLI tool using OpenRouter:

{
  "provider": "openrouter",
  "baseUrl": "<your-openrouter-openai-base-url>",
  "apiKeyEnv": "OPENROUTER_API_KEY",
  "model": "minimax/minimax-m4"
}

Routing through OpenRouter adds a single billing dashboard and instant fallback to other hosted models when you want to cross-check a tricky patch.

Practical Gotchas: Always-On Reasoning and Tool Latency

MiniMax-M4 runs with always-on explicit reasoning enabled. That behavior improves multi-step planning, yet it directly shapes both latency and output cost during tight tool-calling loops.

Watch Out Always-on explicit reasoning tokens count as output tokens at $3.10/M and run before every tool call. Chaining twenty tiny single-file read calls burns extra seconds and extra reasoning tokens on each hop.

Give the agent concrete starting file paths, ask it to batch related reads, and keep prompts focused on the target module. Fewer round trips cut both wall-clock waiting and output token overhead.

Coding Benchmarks and Multimodal Workflows

Published MiniMax-M4 benchmarks highlight two clear strengths: visual UI debugging and broad codebase changes. The table below pulls the verified scores reported across MiniMax M4 on OpenRouter and official release notes.

Benchmark Reported Score What It Measures for Developers
SWE-bench Multimodal 58.5% Resolving real GitHub issues that combine codebases with visual UI artifacts
Vibe Code Bench v1.1.1 76.4% End-to-end interactive app building and frontend execution quality
Code Migration v1.1 56.5% Translating and upgrading code across frameworks or versions
OSWorld v2.1 80.0% Autonomous multi-step computer-use and desktop workflow tasks

Treat vendor-reported numbers as a directional filter rather than a guarantee on your own repository. Run a quick trial on two recent pull requests from your own stack before migrating a team workflow.

Where Native Image and Video Input Actually Helps

Most coding setups still strip screenshots down to clumsy text descriptions. MiniMax-M4's native text, image, and video intake changes three everyday engineering tasks:

  • UI bug repro from screen recordings: Drop a short clip of a janky dropdown, layout shift, or flickering modal directly into context so the model sees timing and state transitions instead of guessing from prose.
  • Design-to-code visual diffs: Pass a design screenshot alongside a rendered browser capture and ask the agent to pinpoint spacing, contrast, or responsive breakpoint mismatches in CSS.
  • Multi-file framework migrations: Pair the 1M context window with Code Migration v1.1-style tasks—such as upgrading a router or state library across dozens of files—while keeping shared types and tests loaded in one cached session.

When to Use MiniMax-M4 vs. Local Models and Flagship APIs

No single model wins every engineering task on cost, privacy, and accuracy at once. Most productive setups pair MiniMax-M4 with a fast local model and keep a flagship frontier API on standby for high-stakes design calls.

Dimension MiniMax-M4 API Local Qwen4-35B-A3B Flagship Claude / GPT APIs
Best Fit Large-repo refactors, UI/video bug fixes, long agent loops Autocomplete, private snippets, offline boilerplate Subtle architecture reviews, hardest edge-case bugs
Context & Modality 1M context; native text, image, and video Hardware-bound context; local text workflows Large context; strong reasoning and tool polish
Hosting & Privacy Hosted API (2.74T too large for solo GPUs) 100% local on workstation VRAM Hosted API
Cost Profile $0.80/$3.10 per 1M; $0.05/M cached input Zero marginal token cost after hardware Higher per-token spend on heavy agent loops

A Practical Hybrid Routing Setup

Keep sensitive internal snippets, quick regex edits, and inline completions on a local model so those requests cost nothing and never leave your machine. If you have workstation VRAM available, follow our Qwen4-35B-A3B local coding setup guide to stand up a fast local endpoint.

Send multi-file migrations, 200K+ token codebase investigations, and screenshot or video frontend bugs to MiniMax-M4, where the $0.05/M cached input rate keeps long loops affordable. Reserve flagship frontier APIs for final security reviews or ambiguous architectural decisions where a second perspective pays for itself.

Pro Tip Keep three explicit terminal aliases—one for your local model, claude-m4 for MiniMax-M4, and your default flagship command—so choosing the right tier takes two seconds instead of a settings hunt.

Frequently Asked Questions

Can You Run MiniMax-M4 Locally on a Consumer GPU?

No. MiniMax-M4 has 2.74T total parameters (with 66B active per token), and public weights are rolling out after safety evaluations—putting self-hosting firmly in multi-node cluster territory. Solo developers should access it through the MiniMax API or OpenRouter.

How Do You Connect MiniMax-M4 to Claude Code and Cursor?

For Claude Code, point ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL to MiniMax's Anthropic-compatible endpoint using a shell wrapper function. For Cursor, add an OpenAI-compatible custom model using either MiniMax's OpenAI-compatible base URL or OpenRouter with the model ID minimax/minimax-m4.

How Much Does MiniMax-M4 Cost per Million Tokens With Prompt Caching?

MiniMax-M4 charges a flat $0.80 per million standard input tokens, $3.10 per million output tokens, and $0.05 per million cached input tokens across the full 1M context window. In multi-turn coding sessions with stable repository context, cached reads cut input token costs by 16x.

Does MiniMax-M4 Support Screenshots and Video Inputs for Frontend Debugging?

Yes. MiniMax-M4 is natively multimodal across text, images, and video, which lets you attach UI screenshots or short screen recordings of rendering bugs alongside source files—matching its 58.5% SWE-bench Multimodal and 76.4% Vibe Code Bench v1.1.1 scores.

Deven Rathore

Engineering workflows, AI coding tools, and developer guides published on DuneBook.