6Kmfi6HP

Opencode2api — Development skill for Claude Code

Development community

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