Opencode2api — Development skill for Claude Code
OpenCode zen/go to OpenAI Codex/Anthropic Claude Code API proxy.
How to install Opencode2api
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open 6Kmfi6HP/opencode2api and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Opencode2api does
OpenCode zen/go to OpenAI Codex/Anthropic Claude Code API proxy.
Alternatives in Development
- Imagegen — Generate and edit images using OpenAI's Image API for projects 14.6k ★
- Gcli2api — 将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口 4.6k ★
- Claude Code Proxy — Run Claude Code on OpenAI models 3.3k ★
README
opencode2api
[English](README.md) · [简体中文](README.zh-CN.md)
`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
cmd/opencode2api/ # executable entrypoint
internal/app/ # proxy core: handlers, protocol conversion, upstream calls, admin panel
internal/domain/ # protocol DTOs
internal/ids/ # response ID normalization
internal/random/ # random ID helpers
Build locally:
go build ./cmd/opencode2api
One-click install
macOS, Linux, FreeBSD:
curl -fsSL https://raw.githubusercontent.com/6Kmfi6HP/opencode2api/main/scripts/install.sh | bash
opencode2api launch claude
Windows PowerShell:
irm https://raw.githubusercon
Related Skills
Openapis
Free Claude API + free OpenAI API in one unified proxy. Drop-in compatible with Anthropic SDK, OpenAI SDK, Cla
Agrout Bridge
Local HTTP proxy that routes OpenAI-/Anthropic-compatible clients (OpenCode, Claude Desktop, Cursor) through A
Antigravity Reverseproxy API
A proxy server that exposes both Anthropic-compatible and OpenAI-compatible APIs backed by Antigravity's Cloud
Picc
a local proxy/router works with claude code and Pi coding agent and sets up a local router with both openai ap
Codebuddy2api
Proxy CodeBuddy with OpenAI-compatible and Anthropic-compatible APIs for Codex, Claude Code, and standard SDK
Codex OpenAI Proxy
Proxy server to use ChatGPT Plus tokens with CLINE/Claude Code extensions via OpenAI API compatibility
Related Agents
Session Error Analyzer
Analyzes specific AI IDE sessions (Claude Code, OpenAI Codex, OpenCode) for LLM behavior errors and returns a
LLM Orchestrator
Use this agent for LLM integration work — prompt engineering, multi-provider abstraction (OpenRouter, Gemini,
AI ML
AI/ML 통합 전문가 + LLM API 최신 모델/SDK 코딩 가이드. RAG 시스템, 문서 분석, OpenAI/Anthropic/Gemini/Ollama 최신 API 보장. "AI integra