opencode-proxy

by betri28Verified

A python proxy that lets you use OpenCode Go subscription with Claude Code

12
Stars
4
Forks
Python
Language
8/24/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/betri28/opencode-proxy

Getting Started

Guides for using skills like opencode-proxy.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

OpenCode-Proxy

A python proxy that lets you use OpenCode Go subscription with Claude Code.

image

Key Features

  • Anthropic-compatible Proxy — Acts as a drop-in replacement for the Anthropic API. Claude Code sends requests to the proxy, which translates and forwards them to the OpenCode Go upstream, then converts the response back to Anthropic format seamlessly.

  • Extended Thinking & Effort — Forwards thinking and budget_tokens parameters as-is to the upstream model. Also supports effort (low / medium / high) for models that use effort-based reasoning. Availability depends on the model.

  • Image & Document — Passes image, PDF, DOCX, and XLSX content blocks through to the upstream model. Whether these are actually processed depends on model support.

  • Web Search — Forwards web search tool calls to models that natively support it. Results are translated back to Anthropic's tool_result format for Claude Code compatibility.

Requirements

  • Python 3.11+

Installation

pip install -r requirements.txt

Docker

Build and run with Docker Compose:

docker compose up --build

Or with plain Docker:

docker build -t opencode-proxy .
docker run --rm -p 4000:4000 -p 8082:8082 --env-file .env -v ${PWD}/logs:/app/logs opencode-proxy

The container exposes both the API on 4000 and the dashboard on 8082, and persists the SQLite history database under logs/.

Configuration

Copy .env.example to .env and edit:

cp .env.example .env

Edit values in .env:

VariableDescriptionDefault
OPENCODE_PROXYProxy server``
OPENCODE_API_KEYAPI key for OpenCode``
OPUS_MAP_MODELModel for opus routekimi-k2.6
SONNET_MAP_MODELModel for sonnet routeglm-5.1
HAIKU_MAP_MODELModel for haiku routeminimax-m2.5

Claude Code Configuration

To use this proxy with Claude Code, add these environment variables to your shell configuration:

export ANTHROPIC_API_KEY="fake-key"
export ANTHROPIC_AUTH_TOKEN="fake"
export ANTHROPIC_BASE_URL="http://localhost:4000"

Or add them to your .env file:

ANTHROPIC_API_KEY=fake-key
ANTHROPIC_AUTH_TOKEN=fake
ANTHROPIC_BASE_URL=http://localhost:4000

Note: The proxy server must be running (python opencode.py) before using Claude Code.

Running

python opencode.py

Server will start:

Web Dashboard

The web interface has 2 tabs:

Token Stats

  • Overview: Input, Output, Cache, Success, Failed, Avg Duration
  • Charts: Token Distribution, Token % by Model, Requests % by Model
  • Detailed table by model image

Request History

  • Request logs with full info: time, model, duration, tokens, status
  • Filter by time: Today, 7 Days, 30 Days, Custom
  • Delete history: all or by date image

Common Features

  • Dark/Light theme (Dark by default)
  • Auto-refresh every 5 seconds
  • Time filter shared across both tabs

API Endpoints

MethodPathDescription
POST/v1/messagesProxy Anthropic format
POST/anthropic/v1/messagesProxy Anthropic format
POST/v1/messages/count_tokensEstimate token count for a request
GET/healthHealth check
GET/api/statsToken usage stats (supports from_date, to_date)
GET/api/logsTerminal logs
GET/api/historyRequest history from DB (supports from_date, to_date)
DELETE/api/historyDelete history (before or all=true)

Advanced Configuration

For other settings, edit config/settings.py:

  • PORT: API port (default 4000)
  • WEB_PORT: Web UI port (default 8082)
  • MODELS: Models and endpoints list, including per-model capability flags (supports_vision, supports_pdf, supports_office, web_search_tool, thinking_style)

Keyboard shortcuts (Terminal)

  • j/: Scroll down log
  • k/: Scroll up log
  • g: Go to top
  • G: Go to bottom
  • Ctrl+C: Exit

Project Structure

opencode.py              # Main FastAPI server
config/
  __init__.py            # Package exports
  settings.py            # Configuration (PROXY, API_KEY, MODELS, ROUTES)
dashboard/
  __init__.py            # Package exports
  api.py                 # Dashboard API endpoints (stats, logs, history)
  display.py             # Rich terminal display (token table, log panel)
static/
  index.html             # Dashboard UI
  styles.css             # Styling (dark/light theme)
  app.js                 # JavaScript
requirements.txt         # Python dependencies
.env.example             # Template environment configuration
.env                     # Environment configuration (gitignored)
.gitignore               # Git ignore rules
logs/                    # Runtime directory (auto-created)
  requests.db            # SQLite - request history

License

MIT

Frequently Asked Questions

What is opencode-proxy?

opencode-proxy is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by betri28. A python proxy that lets you use OpenCode Go subscription with Claude Code. It has 12 GitHub stars.

Is opencode-proxy safe to use?

Yes. opencode-proxy passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install opencode-proxy?

Clone the repository with "git clone https://github.com/betri28/opencode-proxy" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is opencode-proxy written in?

opencode-proxy is primarily written in Python. It is open-source under betri28 on GitHub, so you can review or fork the full source.

Are there alternatives to opencode-proxy?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh opencode-proxy against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details