Agentic coding is moving beyond autocomplete: modern tools can plan tasks, edit multiple files, run commands, and iterate until the result works.
OpenCode is an open-source, model-agnostic coding agent that runs in the terminal (and also supports desktop/IDE). In this guide, you’ll connect MiniMax M2.1 to OpenCode via Novita AI’s API, then build a small demo project to showcase an end-to-end agent workflow.
What is OpenCode?
OpenCode is an open-source AI coding agent that you can run in multiple developer environments—most commonly as a terminal-based interface (CLI + TUI), but also as a desktop app or an IDE extension.
What is the difference between OpenCode and Claude Code
OpenCode and Claude Code are both terminal-based AI coding agents, but they take different paths.
- OpenCode is an open-source, provider-agnostic agent: it highlights support for “75+ LLM providers through Models.dev (including local models)” and positions itself as a flexible tool you can wire to different model backends.
- Claude Code, by contrast, is Anthropic’s official Claude-first CLI—a command-line tool to access Claude models in the terminal—plus an official ecosystem for extensions (plugins) and tool/data connections via MCP.
Quick comparison table
| Aspect | OpenCode | Claude Code |
| Positioning | Open-source, multi-model terminal coding agent | Anthropic’s official Claude-first terminal coding agent |
| Model / provider choice | 75+ LLM providers through Models.dev, incl. local models | Built around Claude; extends via MCP + plugins |
| GitHub automation | /opencode or /oc comment triggers; runs on GitHub Actions runner | Extensions focus on plugins/MCP (official ecosystem) |
| Pricing entry point | Tool is open-source; cost depends on your chosen model backend | Claude plans (Pro/Max/Team/Enterprise) |
Why MiniMax M2.1?
MiniMax M2.1 fits OpenCode’s agent loop (plan → edit → run → fix). The benchmark scores show clear gains in repo-level coding and tool/terminal workflows.

💡 Practical takeaways
- Better at real repo fixing (SWE-bench).SWE-bench Verified: 74.0 vs 69.4 (+4.6), and SWE-bench Multilingual: 72.5 vs 56.5 (+16.0) — strong for multi-file patches and multilingual repos.
- Strong on multi-issue agent work.Multi-SWE-bench: 49.4, ahead of Claude 44.3 and GPT-5.2 42.7 — useful when tasks require multiple coordinated edits.
- Much improved for terminal/tool loops.Terminal-bench 2.0: 47.9 vs 30.0 (+17.9) — a good match for OpenCode’s command-running, build/test iteration.
- High end-to-end app building scores.VIBE Avg: 88.6 (also Web 91.5, Android 89.7, Backend 86.7) — supports building complete, demo-ready projects rather than isolated snippets.
How to Install OpenCode
OpenCode provides a few installation options. The quickest is the one-line install script, and the most portable is installing the npm package.
macOS / Linux
Recommended:
curl -fsSL https://opencode.ai/install | bash
Or (cross-platform):
npm install -g opencode-ai # or bun add -g opencode-ai
Start:
opencode
Windows
Recommended:
npm install -g opencode-ai # or bun add -g opencode-ai
curl | bashrequires a bash environment (WSL or Git Bash). In PowerShell/CMD, use npm/bun.
Start:
opencode
How to Use MiniMax M2.1 in OpenCode
Getting Your API Key on Novita AI
- Step 1: Create or Login to Your Account: Visit
https://novita.aiand sign up or log in. - Step 2: Navigate to Key Management: After logging in, find “API Keys”.
- Step 3: Create a New Key: Click the “Add New Key” button.
- Step 4: Save Your Key Immediately: Copy and store the key as soon as it is generated; it is shown only once.

Add your Novita API key to OpenCode
- Launch OpenCode:
opencode
- In the OpenCode prompt, run:
/connect
- Search and select Novita AI, then paste your Novita API key.
- Select MiniMax M2.1 (model id:
minimax/minimax-m2.1).
That’s it—OpenCode will route agent requests through Novita AI’s OpenAI-compatible API using the model you selected.
Switch to Build mode and execute
In OpenCode, switch to Build mode (tools enabled), then paste the prompt below.
Prompt
Build a lightweight browser maze game called “Clean Maze Runner” and run it locally.
Requirements:
- Use Vite + vanilla JavaScript (no TypeScript to keep it simple). Single-page app. No React.
- Render with HTML5 Canvas (2D).
- Maze generation:
- generate a perfect maze using iterative DFS backtracking
- default size 25×17 cells, with presets: Small (19×13), Medium (25×17), Large (33×23)
- provide a “New Maze” button
- Gameplay:
- start at top-left cell, goal at bottom-right
- move with arrow keys or WASD (one cell per keypress)
- prevent moving through walls
- track steps and elapsed time; show best time per size in localStorage
- Helpers:
- “Hint” button: highlight the next 3 steps on the shortest path (BFS)
- “Show Path” toggle: draw the full shortest path polyline (BFS) from player to goal
- compute BFS only when the player moves or when toggles change
- UI:
- HUD above canvas: size, time, steps, best time
- buttons: New Maze, Reset, Hint, Show Path, Size selector
- Deliverables:
- minimal Vite project with README.md run instructions
- Verification:
- run
npm installandnpm run devonce to confirm it starts.- Keep the project compact, readable, and stable across browsers.

Run locally
After OpenCode generates the project:
npm install npm run dev
Open the local URL printed by Vite (usually http://localhost:5173) and confirm:
- The maze renders with a clear start and goal
- Movement works via WASD / Arrow keys
- The HUD updates time and steps
- Hint and Show Path work as expected
- New Maze regenerates a fresh layout

OpenCode Beyond the Terminal: Desktop App + IDE Integrations
OpenCode is often used in the terminal, but you can also run it as a Desktop app (Beta) or inside your IDE—and in both cases, you can keep using Novita AI’s OpenAI-compatible API. The interface changes, but the model/provider setup stays the same: select minimax/minimax-m2.1.
Desktop app
OpenCode’s Desktop build is available for macOS, Windows, and Linux. If you prefer a standalone UI for longer agent sessions, the Desktop app is a great fit—and it can use the same provider configuration you already created for Novita AI.

IDE integrations
OpenCode provides official integration flows for:
- VS Code
- Cursor
- Zed
- Windsurf
- VSCodium
Conclusion
OpenCode makes agentic coding easy to adopt, and MiniMax M2.1 on Novita AI is a practical model choice for multi-step development workflows. With strong benchmark performance and a large context window, it works well for repo-level tasks like implementing features, running checks, and iterating quickly—directly from your terminal, desktop app, or IDE
Novita AI is an AI cloud platform that offers developers an easy way to deploy AI models using our simple API, while also providing affordable and reliable GPU cloud for building and scaling.
Frequently Asked Questions
OpenCode is an open-source AI coding agent framework that lets LLMs write, run, and debug code inside a real development environment, speeding up end-to-end builds.
Yes, OpenCode does not store any of your code or context data, so that it can operate in privacy sensitive environments.
Yes, OpenCode can integrate with custom APIs, so you can point it to your own model endpoints—for example, using Novita AI’s API to run LLM-powered coding agents with scalable GPU infrastructure.
Discover more from Novita
Subscribe to get the latest posts sent to your email.





