Skip to content

Connect MiniMax (M2.7)

Estimated time: 10-15 minutes

MiniMax M2.7 is a top-tier domestic model, optimized for code and Agent tasks, supporting model self-evolution.

Recommended: Token Plan

Tutorial users get 10% off. We recommend the Max or Pro plan for best value.

If you haven't read "What is an API Key", we recommend going back to 1.4 Overview.


What You'll Be Able to Do

  • Get MiniMax API Key
  • Connect MiniMax in OpenCode
  • Select a model and complete your first conversation

🎒 Before You Start

  • [ ] Completed 1.2 Installation and can run opencode
  • [ ] Have access to MiniMax console and obtained API Key

Follow Along

Step 1: Register and Get API Key

Visit MiniMax platform (10% off for tutorial users):

https://platform.minimaxi.com/subscribe/token-plan?code=2OOzWR9jAE&source=link

Recommended Plans

We recommend Token Plan Max or Pro plans:

  • Max: Best for heavy users, great value for high volume
  • Pro: Suitable for daily development, cost-effective

After subscribing, copy your exclusive API Key from the "Plan Management" page:

MiniMax Token Plan - Copy API Key

💡 The screenshot shows the Token Plan page. Select "Token Plan" in the left navigation, then click the "Copy" button in the API Key section to get your key.

Why recommend MiniMax M2.7?

  • 🏆 Top-tier domestic model: Ranked top 5 globally on Artificial Analysis, #1 in open source
  • 🚀 Self-evolution capability: Can build complex Agent Harness, participate in model iteration
  • 💻 Software engineering expertise: SWE-Pro 56.22%, close to Opus level
  • 📦 End-to-end delivery: VIBE-Pro 55.6%, supports complete project development
  • 🤝 Agent Teams: Native multi-agent collaboration support
  • 💰 High cost-effectiveness: Maintains consistent price advantages

Step 2: Connect MiniMax in OpenCode

Method A (Recommended to try first):

  1. Start OpenCode:
    bash
    opencode
  2. Enter:
    /connect
  3. Search MiniMax, select MiniMax Coding Plan (minimaxi.com), then paste your API Key

💡 China users should select the option with (minimaxi.com) suffix.

Step 3: Select Model and Verify

Enter:

/models

Select MiniMax-M2.7 or MiniMax-M2.7-highspeed (or other models in your configuration/list), then send a test message:

Hello, please introduce yourself

Checklist ✅

  • [ ] Can see and select MiniMax models in /models
  • [ ] Can receive AI responses after sending messages

Common Issues

SymptomCauseSolution
Cannot read properties of undefinedIncomplete configuration or wrong KeyCheck baseURL and apiKey configuration
No responseEnvironment variable conflictClear ANTHROPIC_AUTH_TOKEN and other environment variables

Next Steps