Overview
OpenCodex is a lightweight proxy you run on your own machine that sits between a coding-agent client and a model provider. It translates the Codex Responses API into whatever protocol the target provider speaks — carrying streaming, tool calls, reasoning tokens and images across the boundary — so clients that were built against one vendor can be pointed at another without patching them.
On the client side it supports Codex CLI, the Codex app and SDK, Claude Code, Claude Desktop and Grok Build. On the provider side it covers OpenAI, Anthropic, Google Gemini, xAI, Kimi, DeepSeek, Azure OpenAI, Ollama, Groq, OpenRouter, Together, Fireworks, Mistral, Hugging Face and NVIDIA NIM, plus any OpenAI-compatible endpoint — 40+ in total.
Beyond plain translation it does routing work: `provider/model` syntax targets a specific backend, "combos" define virtual models that fail over or round-robin across several providers by weight, and ChatGPT account pooling switches between accounts with quota awareness and thread affinity. A web dashboard handles provider configuration, account management and request monitoring, and the project documents finite caps with eviction policies on every cache and buffer so memory stays bounded.
What it does
- Translates the Codex Responses API to 40+ providers, preserving streaming, tool calls, reasoning tokens and images
- Works with Codex CLI / app / SDK, Claude Code, Claude Desktop and Grok Build as clients
- `provider/model` routing syntax to pin a request to a specific backend
- Combos: virtual models with failover or weighted round-robin across multiple providers
- ChatGPT account pooling with quota-aware auto-switching and thread affinity
- Web dashboard for provider config, account management and request monitoring
Getting started
OpenCodex installs as a global npm package and runs a proxy on localhost:10100. Node 18+ is required; the Bun runtime is bundled automatically.
Install and start
Install the CLI globally, then start the proxy.
npm install -g @bitkyc08/opencodex
ocx startRun interactive setup
ocx init walks through provider and credential configuration.
ocx initCheck which providers are wired up
List the configured providers before pointing a client at the proxy.
ocx provider listOpen the dashboard
The web UI covers provider configuration, account pooling and live request monitoring.
ocx guiRun it as a background service
Install it as a service to keep the proxy up; ocx stop shuts it down and restores native Codex behaviour, and ocx uninstall removes it entirely.
ocx service install
ocx stop
ocx uninstallCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Drive Codex CLI or Claude Code with a local Ollama model, or with a cheaper hosted provider, without changing the client
- Define a failover combo so an agent session survives one provider rate-limiting or erroring out
- Pool several ChatGPT accounts and let quota-aware switching keep long sessions running
- Inspect exactly what requests an agent client is issuing, and to which model, from one dashboard
How OpenCodex compares
OpenCodex alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| OmniRoute | ★ 67.7k | A local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression. |
| LiteLLM | ★ 59.1k | A Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI. |
| Free Claude Code | ★ 55.4k | A local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI. |
| Kong Gateway | ★ 44.1k | A Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance. |
| 9Router | ★ 29.2k | Local OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens. |
| Apache APISIX | ★ 17.1k | A cloud-native API gateway whose AI plugins add multi-provider LLM proxying, load balancing, retries and fallbacks, token-based rate limiting, and content moderation. |
| OpenCodex | ★ 15.3k | Local proxy that points Codex and Claude Code at any LLM provider |
| Portkey AI Gateway | ★ 13k | An LLM gateway that routes calls to 100+ providers through one API and adds logging, tracing, caching, and fallbacks for production AI traffic. |