# OpenCodex

> Local proxy that points Codex and Claude Code at any LLM provider

- Category: Evaluation & Production Ops / Gateways & Routing
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/lidge-jun/opencodex
- Website: https://opencodex.me/
- Canonical page: https://ai-tldr.dev/tools/opencodex/

## In short

OpenCodex is a lightweight proxy you run on your own machine that sits between a coding-agent client and a model provider. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in TypeScript and licensed MIT. To get started: install and start.

## 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.

1. Install and start

   Install the CLI globally, then start the proxy.

```bash
npm install -g @bitkyc08/opencodex
ocx start
```

2. Run interactive setup

   ocx init walks through provider and credential configuration.

```bash
ocx init
```

3. Check which providers are wired up

   List the configured providers before pointing a client at the proxy.

```bash
ocx provider list
```

4. Open the dashboard

   The web UI covers provider configuration, account pooling and live request monitoring.

```bash
ocx gui
```

5. Run 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.

```bash
ocx service install
ocx stop
ocx uninstall
```

## 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
