Back to Devoured - July 22, 2026
DEVOURED
opencodex (GitHub Repo)

opencodex (GitHub Repo)

AI GitHub
Opencodex is a new lightweight proxy that lets you swap out the default OpenAI backend in Codex and Claude Code for any other LLM provider.
What: Developed as an independent tool, opencodex acts as a local proxy that intercepts requests from the Codex CLI, SDK, or Claude Code and redirects them to models from providers like Anthropic, Google, Groq, or local Ollama instances.
Why it matters: It decouples AI-assisted coding tools from a single vendor, allowing developers to route complex tasks to reasoning-heavy models or simple ones to cheaper, faster alternatives.
Takeaway: Run 'npm install -g @bitkyc08/opencodex' and follow the 'ocx init' prompts to start routing your Codex requests to other providers.
Deep dive
  • Provides a unified interface for tools like Claude Code and the Codex CLI to access any OpenAI-compatible API.
  • Features automatic model routing, allowing users to switch models via provider/model syntax.
  • Includes a web dashboard for managing multiple ChatGPT/Codex accounts and monitoring usage quotas.
  • Supports OAuth authentication for Anthropic, xAI, and Kimi, removing the need for manual API key management.
  • Can be installed as a system service or an on-demand shim to handle background proxy tasks.
  • Implements failover logic, automatically switching to another healthy account if a quota limit (429 error) is reached.
Decoder
  • Proxy: An intermediary server that sits between a client and a service, used to modify, filter, or route requests.
  • Codex: Referring here to the AI coding agent ecosystems (like Claude Code) that leverage API-based models to automate software development tasks.
  • LLM provider: A company or service that hosts Large Language Models and exposes them via an API.
Original article

make codex open!

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM with Codex CLI, App, SDK, and Claude Code.

npm install -g @bitkyc08/opencodex · ocx start · localhost:10100

Use Claude, Gemini, Grok, GLM, DeepSeek, Kimi, Qwen, Ollama, or any other LLM with Codex — and with Claude Code — without waiting for anyone to add support.

opencodex is a lightweight local proxy that translates Codex's Responses API into whatever your provider speaks. Streaming, tool calls, reasoning tokens, images — everything works, in both directions.

Codex, running any model. Pick a provider and go — same Codex workflow, different brain.

It can also manage a ChatGPT account pool for Codex auth. Add multiple ChatGPT / Codex accounts, refresh their 5h / weekly / 30d quota in the dashboard, and let new sessions auto-route to the lowest-usage healthy account. Existing Codex threads stay pinned to the account that started them, so long SSH, tmux, or mobile-connected sessions do not jump accounts mid-conversation.

Codex CLI / App / SDK ──/v1/responses──▶ opencodex ──▶ Any provider
                                              │
              Anthropic · Google · xAI · Kimi · Ollama Cloud · Groq
              OpenRouter · Azure · DeepSeek · GLM · …and OpenAI itself

Supported platforms

OS Status Service manager
macOS (arm64 / x64) Fully supported launchd
Linux (x64 / arm64) Fully supported systemd (user unit)
Windows (x64) Fully supported Task Scheduler (hidden) / opt-in native service (--native, WinSW)

Requires Node 18+. The Bun runtime is bundled automatically on npm install — no separate Bun install needed. All three platforms work natively (no WSL needed on Windows).

Quick start

# Install (bundles the Bun runtime automatically — only Node 18+ required)
# Prefer a user-owned Node (nvm/fnm) — avoid `sudo npm install -g …`
npm install -g @bitkyc08/opencodex

# Interactive setup (writes config, injects into Codex, and offers autostart shim install)
ocx init

# Start the proxy
ocx start

# If you skipped it during init, install the on-demand autostart shim later
ocx codex-shim install

# Use Codex normally — it now routes through opencodex
codex "Write a hello world in Rust"

"bundled Bun runtime is missing" / npm blocked Bun install scripts?

opencodex bundles the Bun runtime as a dependency and runs it via a Node launcher, so you do not need to install Bun yourself. If you see a "bundled Bun runtime is missing" error, the install skipped lifecycle scripts (including npm blocking bun's postinstall under allowScripts) or optional dependencies. Reinstall without those flags, allowing bun's install script:

npm install -g --allow-scripts=bun @bitkyc08/opencodex   # no --ignore-scripts, no --omit=optional

# if the original install used sudo, keep using sudo:
sudo npm install -g --allow-scripts=bun @bitkyc08/opencodex

npm's own warning suggests an abbreviated command without the package name — that would reinstall the current directory, so always pass @bitkyc08/opencodex explicitly.

If you installed with sudo into a root-owned prefix, the sudo reinstall above unblocks that prefix — but prefer migrating to a user-owned Node (nvm, fnm, or a user npm prefix) when you can.

Add a provider

The fastest way to add a provider is through the web dashboard:

ocx gui

This opens the dashboard at http://localhost:10100. From there:

  1. Click "Add Provider"
  2. Pick from 40+ built-in providers — or enter a custom OpenAI-compatible endpoint
  3. Paste your API key (or log in via OAuth for Anthropic, xAI, and Kimi)
  4. Models are auto-discovered from the provider's /v1/models endpoint

Your new provider is ready to use immediately. No restart needed.

You can also add providers through ocx init (interactive CLI) or by editing ~/.opencodex/config.json directly.

Model routing

Target any configured provider and model using the provider/model syntax:

Providers whose own model ids contain / (zenmux, openrouter, nvidia, …) are exposed to Codex with inner slashes aliased to - (e.g. zenmux/moonshotai-kimi-k3-free); the proxy transparently routes them back to the native id, and the raw full-slash form keeps working too.

# Use Claude Opus through Anthropic
codex -m "anthropic/claude-opus-4-8" "Explain this stack trace"

# Use Gemini through Google
codex -m "google/gemini-3-pro" "Write unit tests for auth.ts"

# Use GLM through Ollama Cloud
codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"

# Use a local model through Ollama
codex -m "ollama/llama3" "Refactor this function"

When you omit the provider/ prefix, opencodex routes to the default provider — or auto-matches based on the model name pattern (e.g., claude-* routes to Anthropic, gpt-* routes to OpenAI).

Routed models also appear in the Codex App model picker with per-model reasoning effort controls.

OpenAI provider account modes

Provider ID Route Credential Behavior
openai Codex login Main + added Codex accounts Pool by default; optional Direct mode
openai-apikey OpenAI API API key/key pool No Codex account routing
  • Pool includes the main Codex login and added accounts, with affinity, quota, cooldown, and failover.
  • Direct short-circuits pool state and uses only the current caller/main-login bearer.
  • Fresh installs and configs with no persisted mode default to Pool. Change the mode on the dashboard's Providers page; model ids stay bare in either mode.

Pool account behavior

Open Codex Auth in the dashboard to add accounts and choose which account should handle the next Codex session. opencodex keeps these behaviors:

  • Existing sessions keep affinity. A thread id is bound to the selected account and reused on later turns, so a long request or a mobile/SSH-attached session keeps using the same account.
  • New sessions can auto-route. When auto-switch is enabled, opencodex compares the hottest known quota window across 5h, weekly, and 30d usage, then picks a lower-usage eligible account for new sessions once the active account crosses the threshold.
  • Quota lookup is built in. The dashboard can refresh all account quotas in one click, and the request log labels pool traffic with non-PII account ordinals.
  • Failures fail closed. Token failures mark reauthentication instead of falling back to another credential silently; 429 quota responses put the account in cooldown and can fail over future work to another eligible pool account.

Highlights

  • Use any LLM with Codex. 5 protocol adapters cover Anthropic Messages, Google Gemini, Azure, OpenAI Responses passthrough, and every OpenAI-compatible Chat Completions endpoint.
  • Use any LLM with Claude Code too. The same daemon serves the Anthropic Messages API (/v1/messages + count_tokens): ocx claude launches Claude Code fully wired.
  • Pool ChatGPT accounts safely. Keep existing Codex threads on one account while new sessions can auto-pick a lower-usage account from the pool.
  • Log in once, skip the API key. OAuth support for xAI, Anthropic, and Kimi means you can authenticate with your existing account.
  • Works everywhere Codex does. Injects into Codex CLI, TUI, App, and SDK automatically.
  • History-safe injection. The proxy points Codex's own built-in openai provider at itself; new threads keep their native provider tag.
  • See what's happening. The web dashboard shows providers, OAuth status, model selection, and a live request log.
  • Runs in the background. Install as a system service (launchd / systemd / Task Scheduler) and forget about it.
  • Clean exit, zero residue. ocx stop shuts down the proxy and restores Codex to its original configuration.

Providers & adapters

Provider Adapter Auth
OpenAI (ChatGPT login) openai-responses forward (no key)
OpenAI (API key) openai-responses key
Anthropic Claude anthropic oauth / key
xAI Grok openai-chat oauth / key
Kimi (Moonshot) openai-chat oauth / key
Google Gemini google key
Azure OpenAI azure-openai key

CLI

ocx init                       # interactive setup
ocx start [--port 10100]       # start the proxy
ocx stop                       # stop + restore native Codex
ocx gui                        # open the web dashboard
ocx claude [args...]           # launch Claude Code wired to the proxy

Autostart: service vs shim

ocx service / ocx service install ocx codex-shim install
How OS service manager (launchd / systemd / schtasks) Wraps script launchers for codex
When Always running after login On-demand

Disclaimer

opencodex is an independent, community-maintained project and is not affiliated with or endorsed by OpenAI, Anthropic, or any other provider.

Some providers — notably Anthropic (Claude) — may suspend or restrict accounts that route API traffic through third-party proxies. Use at your own risk (UAYOR).

License

MIT

Explore all 55 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi