Repolode
jasonxu114514

jasonxu114514/opencode2api

A Go gateway that exposes OpenCode Zen and Zen Go models through Chat Completions, Responses and Anthropic Messages APIs, with key and proxy pooling and a WebUI.

Estrelas
1,099
Forks
192
Issues abertas
25
Último commit
há 13 horas

O que é?

opencode2api is a self-hosted gateway for OpenCode Zen and Zen Go. It accepts requests in Chat Completions, Responses, or Anthropic Messages format and translates them into each upstream's native protocol, so clients built for one API style can reach models served under another. The project ships as a single Go binary with the WebUI embedded, and needs no Node.js runtime or database.

Upstream Zen and Go keys are managed in separate pools, with configurable tier preference, retries, session affinity, and direct, HTTP, HTTPS, SOCKS5, or SOCKS5H proxy routing. Model discovery refreshes from OpenCode's catalog, and a separate management port offers configuration editing, a Playground, diagnostics, token statistics, live logs, and a Go subscription quota dashboard.

The gateway supports text, images, reasoning, function tools, and tool results where the target protocol can represent them. It does not implement embeddings, file uploads, image generation, or conversation storage.

Recursos principais

  • 01Converts between Chat Completions, Responses and Anthropic Messages protocols, with JSON and SSE output.
  • 02Separate Zen and Go key pools with tier preference, retries and session affinity.
  • 03Routes through direct, HTTP, HTTPS, SOCKS5 or SOCKS5H proxies, including proxy files.
  • 04Includes a WebUI on a separate port for configuration, Playground, diagnostics and live logs.
  • 05Hot-reloads configuration, validating changes before new requests use them.
  • 06Creates and manages local API keys for clients.

Casos de uso

  • Pointing an OpenAI- or Anthropic-compatible coding tool at OpenCode Zen or Zen Go models.
  • Sharing a pool of upstream keys and proxies across several local clients.
  • Monitoring token usage and Go subscription quota from a single dashboard.

Tópicos

Perguntas frequentes

O que é opencode2api?
A Go gateway that exposes OpenCode Zen and Zen Go models through Chat Completions, Responses and Anthropic Messages APIs, with key and proxy pooling and a WebUI. opencode2api is a self-hosted gateway for OpenCode Zen and Zen Go. It accepts requests in Chat Completions, Responses, or Anthropic Messages format and translates them into each upstream's native protocol, so clients built for one API style can reach models served under another. The project ships as a single Go binary with the WebUI embedded, and needs no Node.js runtime or database.
opencode2api é gratuito? Qual é a licença?
opencode2api é open source sob a licença GPL-3.0. Confira os termos da licença antes de usá-lo em produtos comerciais.
opencode2api ainda é mantido?
Manutenção ativa. O último commit de opencode2api foi em 19 de out. de 2026.
Para que posso usar opencode2api?
Pointing an OpenAI- or Anthropic-compatible coding tool at OpenCode Zen or Zen Go models. Sharing a pool of upstream keys and proxies across several local clients. Monitoring token usage and Go subscription quota from a single dashboard.
Onde consigo opencode2api?
O código-fonte e as instruções de instalação estão no GitHub: https://github.com/jasonxu114514/opencode2api

Resumo gerado por IA a partir do README do projeto. As estatísticas do GitHub são atualizadas diariamente.

Projetos relacionados