A local proxy that reroutes Codex to Claude, Gemini, or Ollama
It breaks the vendor lock on Codex and Claude Code by translating their API calls to any LLM backend you choose.

What it does
opencodex sits between your machine and the network, intercepting traffic from the Codex CLI, App, and SDK and rewriting it for non-OpenAI backends. It speaks the Responses API on the client side and translates requests into Anthropic Messages, Google Gemini, Azure, or generic OpenAI-compatible Chat Completions on the provider side. The same daemon also exposes an Anthropic Messages endpoint so Claude Code can route through it, and it can juggle multiple ChatGPT accounts to keep long-running sessions pinned while spreading quota load across a pool.
The interesting bit
Instead of patching the client, the proxy impersonates the expected upstream API so Codex and Claude Code need no awareness that they are talking to DeepSeek, Ollama, or Groq. It handles streaming, tool calls, reasoning tokens, and image I/O bidirectionally, and routed models surface inside the native model pickers with reasoning-effort controls where configured.
Key highlights
- Supports 40+ providers via five protocol adapters, with OAuth auto-refresh for xAI, Anthropic, and Kimi.
- Pools ChatGPT and Codex accounts, refreshes 5-hour, weekly, and 30-day quotas, and auto-routes new sessions to the healthiest account without breaking existing thread affinity.
- Auto-discovers models from provider endpoints and injects them into the Codex App and Claude Code model pickers as native-looking options.
- Bundles the Bun runtime automatically and runs natively on macOS, Linux, and Windows without WSL.
- Offers a local web dashboard for provider configuration, account-pool management, and Claude Code slot mapping.
Caveats
- The bundled Bun runtime can fail to install if npm blocks lifecycle scripts, requiring a reinstall with script permissions explicitly enabled.
- Catalog entries for upcoming OpenAI models (GPT-5.6 Sol/Terra/Luna) are pre-seeded but remain preview-gated by upstream availability, so they may not be usable yet.
Verdict
Grab it if you want to run Codex or Claude Code against local, private, or alternative cloud models without maintaining client patches. If you rarely stray from a single vendor and never bump against quota ceilings, you probably do not need another moving part.
Frequently asked
- What is lidge-jun/opencodex?
- It breaks the vendor lock on Codex and Claude Code by translating their API calls to any LLM backend you choose.
- Is opencodex open source?
- Yes — lidge-jun/opencodex is open source, released under the MIT license.
- What language is opencodex written in?
- lidge-jun/opencodex is primarily written in TypeScript.
- How popular is opencodex?
- lidge-jun/opencodex has 599 stars on GitHub.
- Where can I find opencodex?
- lidge-jun/opencodex is on GitHub at https://github.com/lidge-jun/opencodex.