Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.infercom.ai/llms.txt

Use this file to discover all available pages before exploring further.

OpenCode is a terminal-based AI coding assistant with a rich TUI (text user interface). It provides an interactive coding experience with file management, reasoning visualization, and tool calling capabilities.
Verified working with MiniMax-M2.7 on Infercom.

Prerequisites

Installation

curl -fsSL https://opencode.ai/install | bash
Verify installation:
opencode --version

Configuration

OpenCode requires a configuration file to define the Infercom provider.

Step 1: Create Config File

Create ~/.config/opencode/opencode.json:
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "infercom": {
      "npm": "@ai-sdk/openai",
      "name": "Infercom (EU Sovereign)",
      "options": {
        "baseURL": "https://api.infercom.ai/v1"
      },
      "models": {
        "MiniMax-M2.7": {
          "name": "MiniMax M2.5 (EU Sovereign)"
        }
      }
    }
  },
  "model": "infercom/MiniMax-M2.7"
}
For complex tasks, OpenCode supports separate plan/build agents. You can use a frontier model (Claude, GPT, Gemini) for planning and MiniMax-M2.7 for execution. See OpenCode documentation for multi-provider configuration.

Step 2: Add API Key

Run the auth login command:
opencode auth login
Select the Infercom provider and paste your API key when prompted.
Credentials are stored in ~/.local/share/opencode/auth.json

Step 3: Verify Setup

Check that the provider is configured:
opencode providers list
Expected output:
+  Credentials ~/.local/share/opencode/auth.json
|
*  infercom api
|
-  1 credential
List available models:
opencode models infercom
Expected output:
infercom/MiniMax-M2.7

Model

Use infercom/MiniMax-M2.7 - optimized for agentic coding with 192K context, reasoning, and tool calling.

Usage

Interactive TUI

Launch the TUI:
opencode
Use /models to switch models if needed.

Non-Interactive Mode

For scripts and CI:
opencode run --model infercom/MiniMax-M2.7 "Your task description"
Example:
opencode run --model infercom/MiniMax-M2.7 \
  "Add input validation to the login function in auth.py"

Model Configuration Options

Customize model capabilities in opencode.json:
OptionDescriptionDefault
reasoningEnable reasoning/thinkingtrue for MiniMax
interleaved.fieldField for reasoning contextreasoning_content
tool_callEnable function callingtrue
temperatureTemperature parametertrue
limit.contextMax context tokensModel-specific
limit.outputMax output tokensModel-specific

Troubleshooting

Read-Before-Write Errors

OpenCode requires reading files before overwriting them (safety feature):
Error: You must read file /path/to/file.py before overwriting it.
This is expected behavior. OpenCode will automatically read the file and retry.

Provider Not Found

Ensure the config file is in the correct location:
ls ~/.config/opencode/opencode.json

Authentication Failed

Re-run the login command:
opencode providers login -p infercom
Or manually edit ~/.local/share/opencode/auth.json:
{
  "infercom": {
    "type": "api",
    "key": "your-infercom-api-key"
  }
}

Performance

  • Token throughput: 400+ tokens/sec with MiniMax-M2.7
  • Context window: 192K tokens
  • Tool calling: Fully supported for file operations

Next Steps