Skip to main content

cc2go v0.8.0

Claude Code → OpenCode Go Adapter
A lightweight proxy that lets Claude Code use any OpenAI-compatible model

Python License Release Stars CI PyPI

cc2go Web UI
Web admin page — switch models, add endpoints, view logs

Features

  • 🔄 Protocol translation — Converts Anthropic Messages API to OpenAI Chat Completions
  • 🌐 Web UI — Built-in admin page at http://localhost:4001, click to switch models
  • 🎯 Model switching — Click to switch models, auto-syncs to Claude Code settings
  • ➕ Custom models — Add your own endpoints with independent API keys and URLs
  • 🖼️ Image support — Converts Anthropic image blocks to OpenAI image_url format
  • ⚡ Streaming — Real-time SSE streaming conversion (OpenAI → Anthropic format)
  • 🔁 Adaptive retry — Error classification with exponential backoff, max 3 retries
  • 📋 Log management — Built-in log viewer with rotation (5MB per file, 3 backups)
  • 🖥️ System tray — Tray icon for opening admin page and quitting; auto-opens admin on start
  • 💰 Token saving — Strips <system-reminder>, [思考过程] reasoning, and thinking blocks before forwarding upstream
  • 💾 Config backup — Auto-backup original Claude Code config on first model switch; one-click restore from admin UI
  • 🔑 Security — Defaults to 127.0.0.1 (local-only), Bearer Token authentication on proxy endpoints
  • 🔧 Tool name sanitization — Replaces special characters in tool names to prevent 400 errors
  • 🧹 Schema cleaning — Recursively removes incompatible JSON Schema fields for broader model compatibility
  • 🔄 Model switching compatibility — Auto-completes missing tool results when switching between strict (DeepSeek) and lenient (MiniMax) models
  • ⚡ Web search bypass — Intercepts web_search tool calls at the response level, runs mmx search locally, returns results immediately without extra round-trips

Getting Started (For Non-Technical Users)

Step 1: Download

Download the latest release from GitHub Releases. Extract the ZIP file to any folder (not Program Files).

Step 2: Configure API Key

  1. Open the extracted folder
  2. Copy .env.example to .env (or create a new file named .env)
  3. Open .env with a text editor (like Notepad) and add your OpenCode Go API key:
    OPENCODE_API_KEY=your_api_key_here
    

Step 3: Run

Double-click start_bg.bat in the folder.

A system tray icon will appear. The admin page will open automatically in your browser.

Step 4: Open in Claude Code

In Claude Code's settings, configure:

Setting Value
Base URL http://localhost:4001
API Key sk-cc2go-local

That's it! Use Claude Code as normal — select models from the web admin page at http://localhost:4001.

How to Quit

Right-click the system tray icon → click "Exit".


For Developers

pip install -r requirements.txt
cp .env.example .env   # Edit .env with your API key
python src/router.py

Scripts (Windows)

scripts\start_bg.bat    # Background mode (system tray, no terminal)
scripts\stop.bat        # Stop background process

Docker

docker build -t cc2go .
docker run -d -p 4001:4001 --env-file .env cc2go

Access at http://localhost:4001.

Linux Service (systemd)

For permanent deployment on Linux:

# Copy service file
sudo cp cc2go.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable cc2go
sudo systemctl start cc2go

Requires a cc2go user and /opt/cc2go installation directory.


API Endpoints

Endpoint Method Description
/ GET Web admin UI
/v1/messages POST Claude format entry (Anthropic → OpenAI)
/v1/chat/completions POST OpenAI format passthrough
/v1/models GET List available models
/health GET Health check
/api/config GET/PUT Configuration management
/api/custom-models GET/PUT Custom model management
/api/logs GET Recent log entries

Custom Model Routing

Endpoint Behavior
/v1/messages Anthropic format passthrough (no conversion, thinking blocks preserved)
/v1/chat/completions OpenAI format conversion (tool_calls gets reasoning_content="" if missing)

Configuration

All configuration via Web UI (http://localhost:4001):

  • Connection — OpenCode Go base URL and API key
  • Service — Host, port, master key (auto-syncs to Claude Code)
  • Custom Models — Add/edit/remove custom model endpoints
  • Logs — View logs, set log level, toggle detailed logging

License

MIT

Technical details in ARCHITECTURE.md

Metadata

Release files for cc2go 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cc2go 0.8.0
File Size Uploaded Provenance Actions
cc2go-0.8.0.tar.gz 27.4 kB Without provenance Details for cc2go-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cc2go 0.8.0
File Interpreter ABI Platform Actions
cc2go-0.8.0-py3-none-any.whl Python 3 none any Details for cc2go-0.8.0-py3-none-any.whl

Total release size: 57.4 kB

Release files / cc2go-0.8.0.tar.gz

Download URL cc2go-0.8.0.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c0633c34d71d658fb4a2239fb65808947710d33503141b6e732b7d061cd5c5aa
BLAKE2b-256 checksum
How to use checksums
84c00170824403dd93ce8374cf77534edbefdce88cf4a65ae8e05193abaf13f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / cc2go-0.8.0-py3-none-any.whl

Download URL cc2go-0.8.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2090c5ab8a393dcb53383eacba9d835eda1f443bb9b760ab3d336af0fb3a814f
BLAKE2b-256 checksum
How to use checksums
67b212142355b8ea900c481a1f600e2e3cea579670fce4d328a88d36e887432c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for cc2go 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page