lidge-jun/opencodex
OpenCodex is a local proxy that sits between coding agent frontends — Codex, Claude Code, Claude Desktop, Grok Build — and whatever LLM backend you actually want to use. The core mechanism is protocol translation: it converts the Responses API that Codex speaks into the native format of whichever provider you've configured, handling streaming, tool calls, reasoning tokens, and images in both directions. Two commands get you running; the proxy and its web dashboard come up on port 10100.
The provider list is broad — over 40 built-ins including Anthropic, Google Gemini, xAI, Kimi, Azure OpenAI, Ollama, DeepSeek, Groq, OpenRouter, Mistral, Hugging Face, NVIDIA NIM, and any OpenAI-compatible endpoint. Model routing uses a provider/model syntax at the CLI, so you can point Codex at anthropic/claude-opus-5 or ollama/llama3 without touching any config file. A "combo" abstraction lets you define a virtual model ID that fans out to failover or weighted round-robin across providers.
The ChatGPT account pool feature is the most operationally specific part. You can register multiple ChatGPT or Codex accounts, and the proxy routes new sessions to the lowest-usage healthy account while keeping existing threads pinned to the account that started them — thread affinity that survives quota re-evaluation and 401/403 recovery. The dashboard exposes quota windows of 5 hours, weekly, and 30 days. Non-OpenAI models can also get web search and image understanding through a sidecar that runs over your ChatGPT login.
Memory management gets unusual attention for a proxy project. The README documents 36 categories of process-retained state, each with an explicit bound: 12 retained stores are byte-accounted against a default 256 MiB budget with eviction, 4 buffers are monitored without eviction, and 24 state-store registrations handle expiry sweeps every 60 seconds. A live inspection endpoint at GET /api/system/memory reports retained bytes and eviction counters. This level of accounting is rare in a community proxy and suggests the authors have run it under real load.
The disclaimer is honest and worth reading before you connect anything: Anthropic in particular may suspend accounts that route API traffic through third-party proxies. The project is explicit that this is use-at-your-own-risk territory. The proxy also includes a specific guard for agent-driven runs — the CLI suppresses a repository-star prompt for agents, and the API returns 403 agent_consent_required if an agent tries to trigger it, which is a thoughtful detail for anyone running this inside an automated workflow.
The architecture runs on Node 18+ with a bundled Bun runtime, so there's no separate Bun install required and no WSL dependency on Windows. Service management integrates with launchd on macOS, systemd on Linux, and Task Scheduler or WinSW on Windows. Remote binding beyond loopback requires a bearer token; the proxy refuses to start without one if you try to expose it beyond localhost.
A protocol-translation proxy that genuinely handles the plumbing between coding agent UIs and arbitrary LLM backends — useful, but read the ToS disclaimer before connecting Anthropic.