Claude Code model router

Opencode2api

OpenCode zen/go to OpenAI Codex/Anthropic Claude Code API proxy

Install

From source
git clone https://github.com/6Kmfi6HP/opencode2api.git

From the README

opencode2api

English · 简体中文

opencode2api is a local-first HTTP proxy that forwards OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages–style requests to the OpenCode upstream. It adds model aliases, reasoning/thinking compatibility, SOCKS5 proxying, token usage accounting, and a lightweight admin panel — so any OpenAI/Anthropic-compatible client can talk to OpenCode without changes.
This project is not affiliated with OpenAI, Anthropic, or OpenCode. Respect the upstream terms of service and only run it in environments you are authorized to use.

Features

- OpenAI-compatible endpoints: /v1/chat/completions, /v1/models
- OpenAI Responses compatible endpoint: /v1/responses
- Anthropic Messages compatible endpoint: /v1/messages
- Streaming SSE conversion with token usage accounting
- Model aliases, reasoning-effort mapping, and force-disable-thinking
- Multi-tier auth routing: public / auto / zen: / go: prefixes
- SOCKS5 support: direct, fixed proxy, or round-robin
- Web admin panel: edit config, view stats, reload upstream sessions
- GitHub Actions: multi-platform release binaries (Linux / macOS / Windows / FreeBSD)
- GitHub Actions: multi-arch Docker image published to GHCR (linux/amd64, linux/arm64)
- Single Go dependency (lumberjack); ships as one static binary

Project layout

Build locally:

One-click install

macOS, Linux, FreeBSD:

Windows PowerShell:

The installer downloads the latest release, verifies its SHA256 checksum, and installs the CLI into ~/.opencode2api/bin (or ~\.opencode2api\bin on Windows). launch claude / launch codex still require the corresponding local CLI. For version pinning, install directories, supported platforms, and manual install, see docs/INSTALL.md (安装 / installation).

Quick start

Health check:

List…
Read the full README on GitHub

Details

Language
Go
Last updated
23 October 2026
Topics
claudeclaude-codecodexopenaiopencode

FAQ

What is Opencode2api?

OpenCode zen/go to OpenAI Codex/Anthropic Claude Code API proxy It is a model router for Claude Code, from 6Kmfi6HP/opencode2api on GitHub.

How do I install Opencode2api?

Clone 6Kmfi6HP/opencode2api from GitHub and follow the setup steps in its README.

Is Opencode2api popular?

6Kmfi6HP/opencode2api has 148 GitHub stars and 54 forks. It was last updated on 23 October 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.