OpenAI's Codex CLI quietly closed a door in 2026: the terminal agent stopped speaking Chat Completions, and every third-party model wired in the old way started failing on launch. A community proxy called OpenCodex reopened it.
How Codex CLI froze out community LLMs

Codex CLI now accepts only one wire format — wire_api = "responses", OpenAI's Responses API — after dropping wire_api = "chat" (Chat Completions) in 2026. Any custom provider still configured for chat mode fails on startup with a hard error . That is the problem, because most non-OpenAI hosts don't speak the Responses API natively, so the [model_providers] escape hatch that used to point Codex at Claude or a local model stopped working.
Quick Answer: Codex CLI now requires wire_api = "responses" and rejects old Chat Completions providers on startup. OpenCodex is a local proxy that keeps Codex talking to localhost:10100 and translates each request across five protocol adapters into whatever the target model speaks — 40+ providers as of v2.7.31 (July 21, 2026).
OpenCodex fills exactly that gap. Codex keeps emitting its native Responses API requests to http://localhost:10100/v1; OpenCodex translates each one — streaming, tool calls, reasoning tokens, and images — across five protocol adapters (Anthropic Messages, Google Gemini, Azure OpenAI, Responses passthrough, and any OpenAI-compatible Chat endpoint) into whatever the target provider actually uses .
| Scope (as of July 21, 2026) | Value |
|---|---|
| Latest version (npm) | @bitkyc08/opencodex 2.7.31 |
| Built-in providers | 40+ |
| GitHub stars / commits | ~2.4k / 1,643 |
| Repo / license | lidge-jun/opencodex / MIT |
Those figures come from the repository and release metadata . Note it is a translation proxy, not another open-codex fork that merely repackages the CLI.
Before ocx init: what to confirm

Four things need to be true before you run ocx init: a modern Node runtime, a working Codex CLI, at least one target credential, and a free proxy port. Get these in place and setup is a single interactive pass; miss one and init either stops or silently patches around you.
- Node 18+. The Bun runtime OpenCodex depends on is bundled and installed automatically during
npm install -g @bitkyc08/opencodex— you do not set up Bun separately. - Codex CLI already installed and operational. OpenCodex edits
$CODEX_HOME/config.tomlin place and expects that file structure to exist ; it does not scaffold Codex for you. - One credential for the target model. Anthropic, Google, xAI, Mistral, Groq, Ollama, OpenRouter, or any OpenAI-compatible endpoint works — via OAuth login (xAI, Anthropic, Kimi) or a raw API key .
- Port 10100 free. That is the default; if it is busy,
ocx initdetects the conflict, picks a free port, and patches Codex's config automatically .
How to put ocx between Codex CLI and any LLM

Once the prerequisites are in place, wiring OpenCodex into Codex is four commands: install, initialize, start, and invoke. OpenCodex runs as a local translation proxy — Codex keeps speaking its native Responses API to localhost while ocx converts each request into whatever the target model actually understands (source: OpenCodex repo). You never patch Codex's binary; ocx only edits config Codex already reads.
1. Install. A single global npm command installs the package and its two interchangeable aliases, ocx and opencodex, which are available immediately (source: npm, 2026-07):
npm install -g @bitkyc08/opencodex2. Configure. Run ocx init. The interactive wizard collects your provider choice and credential, sets the proxy port — default 10100 — and asks permission before injecting routing into $CODEX_HOME/config.toml and optionally installing an autostart shim. It writes its own settings to ~/.opencodex/config.json (source: OpenCodex quickstart).
3. Launch. ocx start binds to http://localhost:<port>/v1, writes ~/.opencodex/ocx.pid, and syncs the routed models into Codex's own model catalog so they appear in the picker (source: OpenCodex docs).
4. Invoke. Use the explicit provider/model form — it is deterministic and recommended (source: OpenRouter tutorial):
codex -m "anthropic/claude-opus-4-8"
codex -m "ollama-cloud/glm-5.2"Built-in family prefixes (claude-*, gpt-*, llama-*, gemma-*) resolve automatically as a fallback when you omit the provider prefix (source: OpenRouter). Conceptually, Codex stops owning the chat-wire transport and simply emits intent that ocx routes — the illustrative model below (not part of the install) shows that single hop:
class CodexCLI:
def __init__(self, router):
self.router = router
def send(self, prompt):
# Codex CLI no longer owns a chat-wire transport; it just emits intent.
return self.router.route({"source": "codex-cli", "prompt": prompt})
class OpenCodexRouter:
def route(self, message):
model = "opencodex-chat"
return f"{message['source']} -> {model}: {message['prompt']}"
if __name__ == "__main__":
cli = CodexCLI(OpenCodexRouter())
print(cli.send("dropped chat-wire; route this"))5. Restore. ocx stop reverses every config.toml edit and removes the pid file, so native Codex behavior returns with no residual patches — the low switching cost that makes ocx safe to trial (source: OpenCodex site).
What could go sideways when proxying any LLM
Low switching cost does not mean low legal or operational risk. OpenCodex is a community project that explicitly states it is "not affiliated with or endorsed by OpenAI, Anthropic, or any other provider," and it warns that some providers may restrict accounts routed through a proxy relay . Before you point production credentials at ocx, read your provider's terms of service — a proxy that translates the Responses API into a vendor's native surface is exactly the pattern some vendors flag.
The sharpest boundary is Anthropic OAuth. Anthropic's Claude Code legal docs state that OAuth login is for native Anthropic apps, and that third-party developers may not offer Claude.ai login or route requests through Free, Pro, or Max plan credentials on a user's behalf . If you want Claude behind Codex, a raw Anthropic API key is the lower-risk transport; forwarding a consumer plan login is the path most likely to get an account restricted.
"OpenCodex is independent and not affiliated with or endorsed by OpenAI, Anthropic, or any other provider." — OpenCodex project README (source: lidge-jun/opencodex)
Two functional limits round out the risk surface. Cross-boundary sub-agent hand-off is a known open issue as of v2.7.31 : when a native Codex parent spawns a routed OpenCodex child, the task body can arrive encrypted and unreadable, so the delegated work silently drops . And syncing a model into Codex's catalog does not grant access to it — rollout-gated upstream models, account tier, and regional availability still govern whether a call actually resolves . Treat the catalog as a routing table, not an entitlement.
Once it translates: pooling, sidecars, and the dashboard
Once OpenCodex is translating, its extras become useful. Account pooling manages a set of ChatGPT/Codex credentials and tracks three quota windows — 5-hour, weekly, and 30-day — auto-routing each new session to the lowest-usage healthy account while pinning existing threads to their original account via session affinity . It fails closed: an HTTP 429 triggers cooldown and failover, and token failures are flagged for re-auth rather than silently swapped .
The same instance serves more than Codex. Running ocx claude launches Claude Code against the shared proxy port, so Codex CLI and Claude Code translate through one OpenCodex process at once . Search and vision sidecars attach to the translation path without pushing full context through the primary model, and up to five routed or native models run as sub-agents . Finally, ocx gui opens a browser dashboard for translation health, per-account quota consumption, and per-session usage . The takeaway: treat pooling and the dashboard as observability, install once, and route deliberately.
Frequently asked questions
What is the exact npm package name to install OpenCodex?
The package is @bitkyc08/opencodex — note that the npm scope differs from the GitHub repo, which lives at lidge-jun/opencodex. Install it globally with npm install -g @bitkyc08/opencodex, which exposes both the ocx and opencodex aliases. It needs Node 18+, and the Bun runtime is bundled automatically during install, so you do not install it separately .
Does OpenCodex work with Claude Code as well as Codex CLI?
Yes. Running ocx claude launches Claude Code pointed at the same localhost port that Codex uses, so both clients share a single OpenCodex instance through the shared proxy binding . That means you can drive Codex CLI, the Codex App, the Codex SDK, and Claude Code against the same routed models without running separate proxies .
What does ocx init actually write to my Codex config?
It depends on the bind address. On a loopback bind, it injects a top-level openai_base_url = "http://127.0.0.1:10100/v1" into $CODEX_HOME/config.toml and keeps Codex's built-in openai provider. On a non-loopback bind, it instead adds a dedicated [model_providers.opencodex] block with wire_api = "responses" and an x-opencodex-api-key header . Both edits are fully reversed by ocx stop, which restores native Codex cleanly .
Is it safe to route Anthropic OAuth credentials through OpenCodex?
It is legally ambiguous, so treat it as a real risk. Anthropic's Claude Code terms restrict OAuth login to native Anthropic apps and state that third-party developers may not offer Claude.ai login or route requests through Free, Pro, or Max plan credentials on a user's behalf . Routing plan-tier OAuth through a proxy likely violates that policy; a raw API key is the lower-risk path. OpenCodex itself states it is independent and not affiliated with or endorsed by any provider, and warns that some providers may restrict proxy-routed accounts .
Which wire protocol adapters does OpenCodex ship?
Five protocol adapters: the Anthropic Messages API (Claude), Google Gemini, Azure OpenAI, an OpenAI Responses passthrough, and any OpenAI-compatible Chat Completions endpoint . That last adapter is what unlocks the long tail — DeepSeek, Ollama (local and cloud), Groq, Mistral, xAI/Grok, vLLM, and LM Studio all speak Chat Completions — which is how OpenCodex advertises 40+ built-in providers on top of the five adapters .
Enjoyed this article? Subscribe to get new stories by email whenever they're published.