OpenCode Installation and Configuration Guide

This guide will help you install OpenCode and configure it to use CC Club’s Claude models.

Why Is Special Configuration Needed?

Compatibility Notes

  1. Different model ID formats: OpenCode defaults to using Anthropic model IDs without dates (e.g. claude-sonnet-4-5), while CC Club uses model IDs with dates (e.g. claude-sonnet-4-5-20250929).
  2. Model mapping required: To allow OpenCode to correctly call CC Club’s models, you need to resolve this compatibility issue through configuration tools or a proxy service.
  3. Avoiding client restrictions: Proper configuration can help avoid restrictions that warn against using OpenCode clients.

We offer three configuration methods:

  • Method 1 (Recommended): Edit the configuration file directly — the simplest and fastest approach
  • Method 2: Use the CC Switch desktop app for visual configuration management with one-click switching
  • Method 3 (Advanced): Use the New API proxy service — suitable for scenarios requiring more custom configuration

This is the simplest configuration method — just edit OpenCode’s configuration file.

Install OpenCode

go install github.com/anomalyco/opencode@latest

Get Your CC Club API Key

Visit the Get API Key page to learn how to obtain a CC Club API key.

Edit the Configuration File

Edit ~/.config/opencode/opencode.json (create it if it does not exist):

cat ~/.config/opencode/opencode.json
{
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://claude-code.club/api/v1",
        "apiKey": "cr_your-api-key-here"
      },
      "npm": "@ai-sdk/anthropic",
      "name": "cc-club(Claude)"
    }
  },
  "$schema": "https://opencode.ai/config.json"
}
⚠️

Note: Replace cr_your-api-key-here with your actual CC Club API key.

CC Club API Addresses

Based on your network environment, you can choose from different API addresses:

AddressDescription
https://claude-code.club/api/v1Default address (fastest when direct connection latency < 100ms)
https://jp.claude-code.club/api/v1Japan node (Alibaba Cloud, optimized for China)
https://hk.claude-code.club/api/v1Hong Kong node (Alibaba Cloud, optimized for China)

Verify the Configuration

Launch OpenCode to verify the configuration is working:

opencode

Verification success indicator: OpenCode starts normally and you can have a conversation


Method 2: Configure Using CC Switch

CC Switch is an open-source cross-platform desktop app designed specifically for unified visual configuration management of AI coding assistant tools. It supports visual configuration management for Claude Code, Codex, OpenCode, and Gemini CLI.

Why use CC Switch

  • Visual interface — no need to manually edit configuration files
  • One-click switching between multiple API providers
  • Built-in latency testing to select the fastest node
  • Automatically handles model ID mapping issues
  • Supports configuration backup and cloud sync

Install CC Switch

Choose the installation method for your operating system:

Option 1: MSI installer (recommended)

  1. Visit CC Switch Releases
  2. Download the latest .msi file
  3. Double-click the installer and follow the prompts to complete installation

Option 2: Portable version

  1. Download the .zip portable version
  2. Extract to any directory
  3. Run cc-switch.exe directly

Install OpenCode

go install github.com/anomalyco/opencode@latest

Get Your CC Club API Key

Visit the Get API Key page to learn how to obtain a CC Club API key.

Configure CC Switch

After launching the CC Switch app, follow these steps to add a CC Club provider:

  1. Click the “Add Provider” button

  2. Select “Custom” for custom configuration

  3. Fill in the configuration details:

    • Name: CC Club (or a custom name)
    • Base URL: select the appropriate API address (see the address table below)
    • API Key: enter your CC Club API key
    • Model mapping (important): configure model ID mapping
  4. Example model mapping configuration:

    {
      "claude-opus-4-5": "claude-opus-4-5-20251101",
      "claude-sonnet-4-5": "claude-sonnet-4-5-20250929",
      "claude-opus-4-5-20251101": "claude-opus-4-5-20251101",
      "claude-sonnet-4-5-20250929": "claude-sonnet-4-5-20250929"
    }

About model mapping: The left side is the model ID used by OpenCode (without a date), and the right side is the actual model ID in CC Club (with a date). With this configuration, OpenCode can correctly call CC Club’s models.

CC Club API Addresses

Choose the appropriate address based on your network environment:

AddressDescription
https://claude-code.club/apiDefault address (fastest when direct connection latency < 100ms)
https://jp.claude-code.club/apiJapan node (Alibaba Cloud, optimized for China)
https://hk.claude-code.club/apiHong Kong node (Alibaba Cloud, optimized for China)

Switch to the CC Club Provider

After saving the configuration:

  1. Find “CC Club” in the provider list on the CC Switch main screen
  2. Click the “Switch” button or click directly on that provider
  3. CC Switch will automatically update OpenCode’s configuration file

Test the Connection

  1. Use CC Switch’s speed test feature:

    • Click the “Test” button next to the provider
    • Wait for the latency test to complete
    • Check the response time and status indicator
  2. Launch OpenCode to verify:

    opencode

Verification success indicator: OpenCode starts normally and you can have a conversation

Detailed tutorial: CC Switch Complete Guide


Method 3: Use New API Proxy (Advanced)

If you need more custom configuration or the first two methods do not meet your needs, you can use a New API proxy service.

Why use a proxy?

  1. OpenCode’s default Anthropic model IDs use a format without dates (e.g. claude-sonnet-4-5), while CC Club uses model IDs with dates (e.g. claude-sonnet-4-5-20250929). A New API proxy can resolve this compatibility issue.
  2. Using a proxy can also help avoid restrictions that warn against using OpenCode clients.

Deploy the New API Proxy Service

New API is an open-source API management and proxy service that supports unified management of multiple AI models.

Deployment reference

New API supports Docker, 1Panel, and other deployment methods. For detailed deployment steps, refer to:

Configure the New API Channel

After deployment, configure the CC Club channel in New API.

Add a channel

Go to the New API admin interface, click “Channel Management” → “Add Channel.”

Fill in the channel information

Enter the following:

  • Channel type: select Anthropic Claude
  • Channel name: CC Club (or a custom name)
  • Proxy address: enter the CC Club API address (refer to CC Club API Address)
  • Key: enter your CC Club API key

Test the channel

Click the “Test” button to confirm the channel is configured correctly. A success message will appear when the test passes.

Install OpenCode

go install github.com/anomalyco/opencode@latest

Configure OpenCode

Locate OpenCode’s configuration file and edit it. The configuration file is typically at ~/.config/opencode/config.json.

⚠️

Important notes:

  • The API address suffix must include /v1
  • You must add a models parameter for model renaming, because OpenCode defaults to using model IDs without dates

Configuration example

{
  "anthropic": {
    "options": {
      "baseURL": "http://your-newapi-address/v1"
    },
    "models": {
      "claude-opus-4-5-20251101": {
        "name": "claude-opus-4-5-20251101"
      },
      "claude-sonnet-4-5-20250929": {
        "name": "claude-sonnet-4-5-20250929"
      }
    }
  }
}

Configuration notes

Config keyDescription
options.baseURLNew API address — must end with /v1
modelsModel configuration — defines the available models and their names

Verify the Configuration

After completing the configuration, launch OpenCode to verify:

opencode

Verification success indicators:

  • OpenCode starts normally and you can have a conversation
  • Call records are visible in New API’s logs

View call logs

In the “Logs” page of the New API admin interface, you can view OpenCode’s call records and confirm that requests are being correctly forwarded to CC Club.


Frequently Asked Questions

Q: Which method should I choose?

A: It is recommended to start with Method 1 (direct configuration) — it is the simplest and fastest. If you need visual management of multiple providers, use Method 2 (CC Switch). Only consider Method 3 (New API) if you need more custom configuration.

Q: Getting a “model not found” error?

A:

  • Method 1: Check that baseURL in the configuration file is correct and ends with /v1
  • Method 2: Check that the Base URL configured in CC Switch is correct
  • Method 3: Check that the models configuration is correct and the model IDs are configured properly

Q: Request failing or timing out?

A: Check the following:

  1. Is the network connection working?
  2. Is the API key correct?
  3. Is the Base URL correct (must end with /v1)?
  4. If using Method 3, is the New API service running properly?

Q: How do I get a CC Club API key?

A: Visit the Get API Key page to learn how to obtain a key.


MIT 2026 © Nextra.
加入社群CC Club返回官网