Warning
Deprecated — superseded by the Go rewrite,
commandcode-proxy-go.
The Go port ships as a single static binary (no Python, virtualenv, or
dependencies to install) with the same OpenAI + Anthropic surfaces and verified
behavior parity. New deployments should use it; this repository still works but
is no longer actively developed.
An OpenAI Chat Completions- and Anthropic Messages-compatible proxy for
the Command Code API. Run it locally, point any
OpenAI- or Anthropic-compatible client (Hermes Agent, the openai/anthropic
SDKs, Claude Code, curl, …) at it, and use your Command Code subscription's
models.
It is a Python port of the translation logic in the community
pi-commandcode-provider
extension — but instead of plugging into one agent, it exposes standard
OpenAI and Anthropic endpoints that any tool can consume.
Unofficial and community-maintained. Not affiliated with Command Code. It forwards requests to the public Command Code API using your own key.
Command Code exposes two surfaces:
| Surface | Protocol | Plan required |
|---|---|---|
/provider/v1/chat/completions |
OpenAI-compatible | Provider tier (paid add-on) |
/alpha/generate |
Custom (Vercel-AI-SDK stream) | Your normal subscription (Go / Pro / …) |
If you only point an OpenAI client at /provider/v1, a non-Provider key gets
upgrade_required. The Command Code CLI (and the pi extension) actually use the
custom /alpha/generate endpoint, which your subscription does cover. This
proxy speaks /alpha/generate upstream and OpenAI downstream — so your existing
plan works from any OpenAI-compatible tool.
POST /v1/chat/completions— streaming and non-streaming, with tool calling and reasoning (reasoning_content) passthrough.POST /v1/messages— an Anthropic Messages-compatible surface, so Claude Code and the Anthropic SDK can drive Command Code too.GET /v1/models— proxies Command Code's live model catalog.GET /health, plus a minimal status + request-log dashboard atGET /admin.
Translation highlights (see commandcode_proxy/translate.py):
- System/developer turns → Command Code
params.system. - OpenAI
tools→ Command Codeinput_schematools;tool_calls/toolresults → typedtool-call/tool-resultparts (with dangling-call pruning, matching the upstream extension). - Upstream
text-delta/reasoning-delta/tool-call/finishevents → OpenAIchat.completion.chunkdeltas;finish.totalUsage→ OpenAIusage. - Transient (
isRetryable) upstream errors before the first token are retried.
- Install & usage — install/run, Docker, the systemd
service, the
/admindashboard, authentication, model aliases, and connecting Hermes / the OpenAI SDK / Claude Code, plus tests. - Architecture — design rationale and key decisions.
- Text in, text/tools/reasoning out. Multimodal (image) inputs are flattened to their text parts — the upstream extension is text-only too. Adding image parts is a future enhancement.
- Model availability follows your plan. A model in
/v1/modelscan still return402 MODEL_NOT_IN_PLANif your subscription doesn't include it. - No browser
/loginflow (the extension's OAuth callback server). Each caller passes its own key in theAuthorizationheader instead. - Pricing/cost accounting is left to the client; the proxy passes through
Command Code's token
usage.
Translation logic ported from
patlux/pi-commandcode-provider
(MIT). Licensed under MIT — see LICENSE.