OpenCodex

OpenCodex — Run Any LLM Inside Codex, Claude Code, OpenCode and More

🎬 AI Stack Engineer 📅 Aug 26, 2026 ⏱ 10:02
OpenCodex model routing local proxy multi-agent open-source

🎯 The Wall (Vendor Lock-in)

"Every coding agent locks you into one company's models. Claude Code only runs Claude. Codex only runs OpenAI. Your Claude subscription is useless inside Codex, and your ChatGPT subscription is useless inside Claude Code." You pay for both and still can't pick the best model for the job. 0:00

OpenCodex removes that wall. A small local proxy that lets you run any model inside any agent: Claude inside Codex, Gemini inside Claude Code, DeepSeek/Kimi/a-local-model inside either one. It translates between API formats — "Codex speaks one format, Anthropic another, Google a third, and OpenCodex sits in the middle and makes them agree."
Broader than Codex: the same proxy now serves Claude Code, OpenCode, Pi, AMP, Hermes, and many more — all from one port. "You set up your providers once in one place, then flip a switch for each agent."

⚙️ Install & Run

One NPM command. Only needs Node 18+ (the Bun runtime it runs on is bundled and self-installs). Then: ocx start → proxy up, dashboard at localhost:10100. 1:13

CommandWhat it does
ocx startStart the proxy + dashboard
ocx serviceInstall as a real system service (launchd/systemd/task scheduler) — starts on boot
ocx guiReopen the dashboard later
ocx stopShut down cleanly (restores config, no orphan processes)
Windows works natively — no WSL needed. "Which I was not expecting."

🖥️ The Dashboard

Everything lives on one page. On first open it showed the author's OpenAI account already there under Providers, marked ready with a green dot — it picked up the existing Codex login and forwarded it (no key pasting). 2:00

ElementWhat it shows
Rate limit panel30-day window, % used, reset date
Overview rowStatus, online, version, uptime, provider count, 30-day token total
Safety readout"Codex does not depend on the local proxy" — if the proxy dies, plain Codex still works (nothing permanent was rewritten)
Honest labeling: an amber warning said coverage was incomplete because one account was "excluded with an unknown plan" — "telling me the number might not be complete instead of pretending it's precise."

🔌 Providers & Adapters (40+ via 5 adapters)

Add Provider gives three tabs: Accounts, Free, Paid. 3:12

TabContents
AccountsLog in with an account you already pay for (OAuth for Anthropic, xAI, Kimi; tokens auto-refresh)
FreeCloudflare Workers AI (free tier), LM Studio (local, no key), Mimo Free (Xiaomi public tier, auto-bootstrapped token)
Paid~40+ built-in providers + custom OpenAI-compatible endpoint
The Mimo card honesty: a warning printed on the card says "the endpoint isn't publicly documented, Xiaomi can restrict it whenever they want, and prompts may be processed and retained." That kind of labeling is rare.
Only 5 adapters under the hood: Anthropic Messages, Google Gemini, Azure, OpenAI Responses (pass-through), and generic chat completions. Models auto-discover from each provider's /models endpoint — no restart.
codex-min
anthropic/claude-opus
google/gemini-3-pro
ollama/llama-3        # your own hardware

Drop the provider prefix and it routes to your default, or pattern-matches the name (anything starting "claude" → Anthropic). 4:33

🎛️ Models & Sub-agents

Models page: every model has a visibility toggle grouped by provider. Hidden models stay out of the picker but are still callable by exact ID. Changes take effect next turn (OpenCodex invalidates its 5-minute model cache). 4:52

Default context window setting — the author's was 350k — for providers that don't report their own window. "Some relays just don't send that field, and without this you get a wrong number and weird truncation."
Sub-agents page (the one to spend time on): pin up to 5 models in order — that order sets the top of the model picker and the default candidates for spawn-agent. "Heavy architecture goes to the expensive reasoning model; cheap repetitive work goes to the small fast one. You stop burning premium tokens on file renames."

🛰️ Sidecars — Restoring Search + Vision

Non-OpenAI models normally lose two things when routed into Codex: web search and image understanding (both OpenAI features). 6:00

The sidecar workaround: you pick a small model (default 5.4-mini) that handles search + image description on the side using your ChatGPT login, then feeds the result back to whatever model you're actually running. "So Claude or a local Qwen gets real search results and can describe a screenshot, even though it never had those capabilities in that pipeline."

🔗 Integrations & Rollback

The Integrations tab lists every coding agent detected on the machine with a status badge, the exact config file path, and a single switch. The author's detected 10 clients. 6:35

Flip the switch → it writes the OpenCodex provider block into the agent's config (e.g. config/opencode/opencode.json) → badge changes "not applied" → "applied" with a timestamp.
Rollback safety (the standout): before every write it takes a snapshot of your file, every single time. A rollback center below has undo on the newest change and "restore this point" on older ones — 10 backups per client. If you edited the file after OpenCodex wrote to it, restoring asks twice and backs up your newer edits too. "Even the restore is undoable."
Honest docs on formatting: formatting is generally not preserved (applying parses and rewrites — JSON5/TOML comments can be lost). Exceptions: AMP and DeepSeek Harness patch only their own byte range. And no real credentials ever get written into a client config — they use placeholders. A few agents (Kimi, Minimax Code, DeepSeek Harness) have no config field for the auth header a remote binds needs, so they're local-only unless you tunnel.

⌨️ CLI & Logs

Everything in the dashboard has a terminal equivalent — scales to scripted setups. 8:09

CommandPurpose
ocx initInteractive setup
ocx syncRefresh models
ocx statusStatus
ocx loginOAuth login
ocx integration <client> enableThe switches, scripted
Logs: recent requests with tokens, resolved model, provider, status, duration, error detail; filterable by session; token total + estimated cost. "That cost is list-price math from reported tokens, not a bill — and the docs say so directly."

⚠️ Caveats

Two things to be clear about: (1) it's an independent community project, not affiliated with OpenAI or Anthropic — and some providers restrict accounts that route through third-party proxies, so read the terms. (2) the repo is young — MIT-licensed, mostly TypeScript, moving fast. Expect rough edges.
The clean exit matters: ocx stop shuts down the proxy, stops the background service, and puts your Codex config back exactly as it was. "No leftovers. No orphan processes."
"The practical win is not novelty. It's that you stop paying twice for the same capability and stop maintaining the same provider config in six different places. One proxy, one dashboard, every agent reading from it."

🔗 github.com/lidge-jun/opencodex · opencodex.me (docs)

💡 Key Takeaways

  1. One proxy breaks vendor lock-in. Any model in any agent — Claude in Codex, Gemini in Claude Code, local models in both.
  2. 5 adapters, 40+ providers. Anthropic Messages, Google Gemini, Azure, OpenAI Responses, chat completions — everything else is a config.
  3. Accounts, not just API keys. OAuth login (Anthropic/xAI/Kimi) reuses subscriptions you already pay for.
  4. Sidecars restore search + vision for non-OpenAI models via a small helper model.
  5. Snapshot-before-write + rollback center (10 backups/client) make the integrations safe and fully undoable.
  6. Full CLI parity — scriptable setup via ocx init/sync/status/login/integration.
  7. Honest by default — incomplete coverage warnings, cost-is-estimate disclaimers, undocumented-endpoint labels.

📍 Timestamp Index

0:00 Vendor lock-in
1:13 Install & run
2:00 The dashboard
3:12 Providers & adapters
4:52 Models & sub-agents
6:00 Sidecars (search + vision)
6:35 Integrations & rollback
8:09 CLI & logs
8:51 Caveats
☰ View all