This is the most common swap on the entire channel. Three env vars in Claude Code's settings.json route Anthropic-compatible clients at a Minimax token plan:

  1. ANTHROPIC_AUTH_TOKEN — set to the Minimax token-plan API key (the one that resets, not a pay-as-you-go key).
  2. The base URL: https://api.minimax.io/anthropic. Never minimax.com, which is the slow China endpoint.
  3. The token-plan API key itself, in the appropriate settings slot.

You keep Claude Code's interface (MCPs, agent teams, repo context, plan mode) at Minimax's flat-subscription pricing. The same env-var swap works for Kilo Code, Open Claude, and Grok CLI. The mechanical gotcha: if your settings.json is non-empty, paste only the inner JSON object from the snippet and add a trailing comma. Pasting a fresh top-level object into a file that already has entries breaks the JSON parser and Claude Code will fail to start.

This article walks through the plan numbers, the env-var setup, the China-endpoint gotcha, the trailing-comma trap, the same-swap-works-elsewhere list, and the routing rule the swap implies. By the end you should be able to wire a Minimax token plan into Claude Code in under five minutes, smoke-test it, and know what to do if the first run fails.

What you'll learn

  • The Plus plan gives you 4,500 model requests every 5 hours, the Max plan gives you 15,000 — both on a rolling counter, not a daily reset, which is what makes overnight Claude Code runs viable.
  • The three env vars in settings.json: ANTHROPIC_AUTH_TOKEN, the token-plan API key, and the base URL https://api.minimax.io/anthropic. The China endpoint minimax.com is slow and degrades the experience for non-Chinese users.
  • The trailing-comma trap: if settings.json is non-empty, paste only the inner JSON object and add a trailing comma. A fresh top-level object into a non-empty file breaks the parser.
  • The same env-var swap works for Kilo Code, Open Claude, and Grok CLI — you don't have to reinstall Claude Code to test the model.
  • The "near Opus, not Opus" framing: keep Sonnet or Opus in reserve for the final review pass on security-sensitive or money-handling code.
  • The Discord / OpenClaw bridge: the same settings.json swap is what an OpenClaw agent injects when it hands coding work to Claude Code.

The plan numbers — and why the rolling window matters

The Claude Code + Minimax 2.7 video (6,532 views) is the canonical "how do I actually do this" reference. The pitch is simple: take Claude Code (the local Node CLI from Course 4 §4.1) and point it at a Minimax token plan instead of Anthropic's API. You keep Claude Code's interface, the repo-awareness, the MCP integration, the agent teams, and the headless overnight workflow. You swap who you pay.

The plan numbers are the contract:

  • Plus plan — 4,500 model requests every 5 hours.
  • Max plan — 15,000 model requests every 5 hours.

The 5-hour window is a rolling counter, not a daily reset, which is what makes the workflow viable. The creator frames it as effectively unlimited for overnight builds: "just run the tap, let it flow, let it develop, let it work." For the boxminingai.com site rebuild, the creator scheduled the work on a VPS that "runs 24 hours for me" and woke up to a finished build, calling this the normal workflow, not a stretch goal.

The off-plan cost reality is the second-load-bearing detail. On the token plan, you pay a fixed subscription, not per-token Anthropic pricing, so heavy overnight sessions don't rack up extra bills. Off-plan, Minimax 2.7 is still cheaper than Claude Sonnet / Opus, and the creator's claim is "near Opus level intelligence for programming." That's the working hypothesis of the whole article — but it isn't a guarantee, which is why the creator keeps Sonnet or Opus in reserve for the final review pass on security-sensitive or money-handling code.

The env-var setup — three vars, three rules

The config change is a settings.json edit with three env vars. The full recipe:

  1. The token-plan API key — specifically the one that resets, not a pay-as-you-go key. The reset behaviour is what keeps overnight runs from triggering overage charges. Pay-as-you-go keys don't reset, and they'll rack up overage charges on a long overnight run.
  2. ANTHROPIC_AUTH_TOKEN — set to the same token-plan API key. The bearer token and the auth token are the same value.
  3. The base URL: https://api.minimax.io/anthropic. Never minimax.com, which is the slow China endpoint. The international portal (minimax.com) is the China base URL and will degrade your experience if you're outside China. The creator flagged this as a recurring gotcha — international users must use the international portal.

The mechanical gotcha: if your settings.json is non-empty, paste only the inner JSON object from the snippet and add a trailing comma. Pasting a fresh top-level object into a file that already has entries breaks the JSON parser and Claude Code will fail to start. The error you'll see is generic — Claude Code won't start, no specific complaint about the JSON. The fix is to re-open settings.json, check the trailing comma on the last entry before your pasted block, and verify the inner object's braces are balanced.

The smoke test: ask Claude Code to add a comment to an existing file. If the change lands, your config is correct. If Claude Code fails to start, you have a JSON parse error — re-check the trailing comma.

The China endpoint trap — and the rolling counter

The China-endpoint trap is the single most common failure mode in international support questions for the swap. The two URLs look almost identical:

  • https://api.minimax.io/anthropic — the international portal, fast for non-Chinese users.
  • https://minimax.com/... — the China endpoint, slow for non-Chinese users.

The creator flagged this as a recurring gotcha — the international portal is the one you want outside China. If you've copied the URL from a Chinese-language tutorial or a stale blog post, double-check the domain. The path is /anthropic (Anthropic-compatible), not /v1 (OpenAI-compatible) — Minimax supports both shapes, but Claude Code expects the Anthropic-compatible path.

The rolling counter is the second thing that surprises new users. The 5-hour window is a rolling reset, not a daily reset. That means: if you burn 4,500 requests in a single hour, you'll wait 5 hours from the first request for the counter to fully reset, not 5 hours from the moment you hit the limit. Plan heavy cron work around the window — don't start a 6-hour cron at 9pm if you've been hammering the API since 6pm.

The same env-var swap works for Kilo Code, Open Claude, Grok CLI, and other Anthropic-compatible clients. You don't have to reinstall Claude Code just to test whether the model is the right pick — point any of them at the same base URL and token. The Kilo Code gateway is the easiest way to A/B test M2.7 against M3 and other Chinese models without changing Claude Code's config.

The OpenClaw bridge — same swap, different client

The OpenClaw-specific video is in §5.3 because the routing logic is identical: you're paying for a model backend, not for the client. The Claude Code hack the creator used to keep his editor while swapping the backend: route Minimax's coding plan through Claude Code by replacing the Anthropic base URL with the Minimax Anthropic endpoint and using the coding-plan key as the token. That trick predates the M3 writeup and is the same pattern the next video formalises.

This is the bridge between Course 1: Picking Your Agent Harness and Course 4: Claude Code & AI Coding. An OpenClaw agent that wants to hand coding work to Claude Code makes the same settings.json swap — the three env vars (token-plan API key, ANTHROPIC_AUTH_TOKEN, base URL) — when it routes a coding task to Claude Code. The trailing-comma JSON gotcha applies whether you're editing settings.json by hand or whether an OpenClaw skill is editing it (an unguarded edit will break Claude Code at startup).

The "Minimax token plan resets" detail is the contract that makes overnight coding tracks safe. The "near Opus, not Opus" framing is the routing rule. The "use Minimax for the executor slot, Opus for the orchestrator slot" rule from §5.1 is the meta-frame.

The "near Opus, not Opus" framing

The "near Opus, not Opus" framing is the safe default for the §5.3 swap. The creator's claim is "near Opus level intelligence for programming," but the channel's own testing in Course 2 §2.2 showed that M2.7 / M3 lose to Opus 4.8 on 3D assemblies, lose to GLM 5.1 on space-shooter builds, and lose to GPT 5.4 on instruction-following suites. The Minimax family wins on cost-per-task and on the multi-agent executor pattern; it loses on the high-stakes "this code handles money or secrets" review pass.

The routing rule:

  • Minimax on the executor slot for iterative coding, multi-file refactors, long agentic loops, Go/Rust/TypeScript/Java work.
  • Sonnet or Opus in reserve for the final review pass on security-sensitive or money-handling code.
  • M3 in particular is the cheap daily-driver for code execution. M2.7 is the Kilo Code token-plan default until M3 lands on the token plan.

The hard rule: always diff the overnight build before merging. The swap saves money on the executor; it doesn't save you from a security review.

Try it yourself

  1. Subscribe to the Minimax token plan. Start with the Plus tier (4,500 requests / 5 hours). Confirm the key is the rolling token-plan key, not a pay-as-you-go key.
  2. Locate Claude Code's settings.json. On a fresh install it's empty or has a single object. Back the file up before editing.
  3. Drop in the three env vars:
    • ANTHROPIC_AUTH_TOKEN — your token-plan API key.
    • The token-plan API key itself, in the appropriate settings slot.
    • Base URL: https://api.minimax.io/anthropic.
  4. Handle the trailing comma. If settings.json is non-empty, paste only the inner JSON object and add a trailing comma. If it's empty, paste the full block.
  5. Smoke-test with a one-line task. Ask Claude Code to add a comment to an existing file. If the change lands, your config is correct. If Claude Code fails to start, you have a JSON parse error — re-check the trailing comma.
  6. Run a real overnight build on a VPS. Pick a low-stakes feature — a new settings page, a content-inventory script, an integration test suite — and queue it before bed. Review the diff in the morning.
  7. A/B test on Kilo Code. Point Kilo Code at the same base URL and token. Don't reinstall Claude Code just to test the model — the swap is identical.
  8. Reserve Sonnet or Opus for the final review pass on security-sensitive or money-handling code. Diff the overnight build before merging.

Common pitfalls

  • Pointing at minimax.com instead of api.minimax.io. The minimax.com endpoint is the slow China base URL. International users must use the international portal. This is the most common failure mode in international support questions for the swap.
  • Pasting a fresh top-level object into a non-empty settings.json. Claude Code will fail to parse the file and refuse to start. Paste only the inner object and check the trailing comma. The error message is generic — the fix is to re-open settings.json and verify the JSON is well-formed.
  • Using a pay-as-you-go key instead of the token-plan key. Overnight runs will rack up overage charges. Use the key that resets.
  • Trusting "near Opus" output without diffing. Minimax 2.7 is near-Opus, not Opus. Always review the diff before merging, especially for security-sensitive or money-handling code.
  • Letting the agent update settings.json unsupervised. The trailing-comma gotcha still applies whether you're editing by hand or whether an OpenClaw skill is editing.
  • Starting a 6-hour cron when you've been hammering the API. The 5-hour counter is rolling, not daily. If you burned 4,500 requests in the last hour, you'll wait 5 hours from the first request for the counter to fully reset.
  • Routing everything through Minimax. Minimax is the executor. Use Opus / GPT / Gemini for the orchestrator slot. The "near Opus, not Opus" framing is the safe default.
  • Benching on Minimax 2.7 only. The channel's actual ranking for executor work is M3 (when on token plan) > M2.7 > GLM 5.1 > DeepSeek 3.2. Pick by task.
  • Bypassing the trailing-comma check with "it worked last time". A config that worked on an empty settings.json will break the moment another entry lands. Always re-check the trailing comma.

Sources

  • Claude Code + Minimax 2.7: Unlimited AI Coding on a Budget — 6,532 views · video_id: dURSH_Fwu6s · watch
  • Is Minimax the Best AI Model for OpenClaw? — 3,219 views · video_id: 258R3kzDRAQ · watch
  • Minimax M2.7 is INSANELY GOOD! (Full Review) — 31,049 views · video_id: --uxieT5J9Y · watch
  • Top AI Models for Hermes Agent (Tier List) — 8,107 views · video_id: Af7Fg1m7hRw · watch
  • Supabase querySELECT video_id, title, views, summary_content, summary_key_takeaways FROM public.videos WHERE video_id = ANY(ARRAY['dURSH_Fwu6s','258R3kzDRAQ','--uxieT5J9Y','Af7Fg1m7hRw']); against project ttxdssgydwyurwwnjogq.