Skip to main content
OpenCode now supports major model families such as GPT, Claude, DeepSeek, Gemini, and Qwen. For OpenCode usage scenarios, the following models are recommended:
  • coding-minimax-m2.1-free
  • coding-glm-4.7-free
  • claude-sonnet-4-5
  • gpt-5
  • gpt-5-codex
This document explains how to install, configure, and launch OpenCode on different operating systems, and how to integrate the AiHubMix API.
Before installation, ensure that your system meets the following requirements:
  • Node.js ≥ 18.0.0
  • Optional package managers for your operating system:
    • macOS / Linux: brew
    • Arch Linux: paru
    • Windows: choco, winget, or scoop

1. Installing OpenCode

Choose any of the following installation methods based on your operating system and tooling preferences.

1. Install via Node.js

# Quick install using a CURL script
curl -fsSL https://opencode.ai/install | bash

# Using NPM
npm install -g opencode-ai

# Using Bun
bun install -g opencode-ai

# Using PNPM
pnpm install -g opencode-ai

# Using Yarn
yarn global add opencode-ai

2. Install via Homebrew (macOS / Linux)

brew install sst/tap/opencode

3. Install via Paru (Arch Linux)

paru -S opencode-bin

4. Windows Installation

# Chocolatey
choco install opencode

# WinGet
winget install opencode

# Scoop
scoop bucket add extras
scoop install extras/opencode

# Or install via NPM (Node.js required)
# Note: Administrator privileges are required
npm install -g opencode-ai

2. Launching and Logging in to OpenCode

After installation, follow the steps below to complete authentication and configuration.

1. Log in to OpenCode

Run the following command in your terminal:
opencode auth login

2. Select the AI Provider

On the login screen, select AiHubMix as the model provider. Opencode 1

3. API Key Authorization

Enter your AiHubMix API Key on the OpenCode login page to complete authorization. Opencode 2

3. Using Models

1. Installation Verification

Run the following command to verify that OpenCode is installed and configured correctly:
opencode
Opencode 3

2. Select a Model

Type /models, search for aihubmix, and select the desired model. Opencode 4

4. Using AiHubMix in the OpenCode Desktop Client

  1. Download the OpenCode desktop application: https://opencode.ai/download .
  2. Open OpenCode and follow the steps:/modelConnect provider → search for aihubmix → enter your API Key → Submit. Opencode 5
  3. In the model selection panel, search for aihubmix and select the model you want to use. Opencode 6

5. FAQ and Tips