Model or dataset
bman654/clodex avatar
bman654/clodex

clodex: A Selective MITM Proxy That Lets Claude Code Run OpenAI Models on Your Existing Plan

Bridge Claude Code to OpenAI models — OpenAI API key or ChatGPT/Codex-plan OAuth

105 stars33 forksTypeScriptMIT

At a glance

What is it?
clodex bridges Claude Code to OpenAI and OpenCode Go models without duplicating Anthropic's OAuth flow. It works as a proxy or endpoint gateway, and it patches Claude Code so routed models behave like first-class citizens.
Who is it for?
Adopt clodex if you have a ChatGPT/Codex plan or an OpenAI API key and want those models inside Claude Code without abandoning your Anthropic subscription. Skip it if you cannot trust a man-in-the-middle proxy with your HTTPS traffic or if your workspace blocks device-code OAuth and you refuse the browser fallback.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • bman654/clodex105 ★ · +63
Star history
Repository2026-08-272026-10-22
bman654/clodex42105

63 Stars in the last 56 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What clodex actually solves

The intended audience is a developer who already lives in Claude Code and does not want to switch terminals or learn a separate agent framework. The README also mentions a local OpenAI-compatible endpoint mode, so any OpenAI-compatible client can consume the Codex plan through clodex. That broadens the reach slightly, but the core value is still the Claude Code integration.

How the proxy mode avoids the ToS trap

The README spends real space on Anthropic's Terms of Service. The argument is that duplicating Claude Code's OAuth flow from outside the app violates the ToS and risks account bans. clodex claims to avoid that by intercepting requests bound for api.anthropic.com with an HTTP proxy. Requests for Anthropic models pass through unmodified, carrying Claude Code's own auth token. Requests for models named clodex:<provider-id>:<model-id> are routed to the configured provider using clodex-managed credentials. That design means your Anthropic login is never copied or replaced. Whether that interpretation holds up legally is not something this review can judge, but the technical mechanism is clear: a selective man-in-the-middle proxy, not a credential relay. The README also warns that any tool requiring ANTHROPIC_BASE_URL to a custom value likely duplicates the OAuth flow, which is a useful heuristic for evaluating alternatives.

Two bridge modes: proxy and endpoint

clodex ships two bridge modes, and the flag applies to a single run unless you persist it with --save-mode. The default is --proxy. In that mode, Claude Code keeps its normal Anthropic login, and only clodex-prefixed models are diverted. You switch models with /model clodex:openai-oauth:gpt-5.6-sol or, after patching, with a short alias like /model sol. The other mode is --endpoint. Here clodex runs a local Anthropic-format gateway and launches Claude Code with ANTHROPIC_BASE_URL pointing at it. All traffic goes through the gateway, and with saved favorites the gateway becomes multi-route, so Claude Code's /model menu lists your starting model plus favorites for live switching. The endpoint mode is simpler to reason about but it funnels everything through one local server. Proxy mode is more selective and keeps Anthropic traffic untouched. The README's flowchart shows the decision point: if the model is clodex-routed, it goes to the provider; otherwise it passes through to api.anthropic.com with the original credentials.

Getting started: install, auth, models, patch, launch

The quick start is a five-step sequence. First, install globally with npm install -g @bman654/clodex, which requires Node 22 or newer. Second, sign in with your ChatGPT or Codex plan using clodex providers auth openai, which triggers a device-code OAuth flow. The token is stored in your OS credential store. If your workspace admin disabled device-code authorization, you add --browser to sign in through a browser instead. API-key users run clodex providers add instead. Third, pick models with clodex models, an interactive manager that supports up to 20 favorites and short aliases. The README shows aliases like sol, luna, and terra mapped to long model IDs. Fourth, optionally run clodex patch so those models pass Claude Code's model validation, appear in /model, and report their real context windows. The patch step is required for using routed models as subagents via the Agent tool. You must re-run it after each claude update, and clodex patch --restore undoes it. Fifth, launch with clodex claude, which starts Claude Code bridged to the chosen model.

The patcher is the hidden dependency

The patch step is not optional if you want full integration. Without it, Claude Code may reject clodex model names during validation, and the /model menu will not show them. The patcher bakes your favorites and aliases into the Claude Code binary so they pass validation and report correct context windows. That is a binary modification, and the README warns you to re-run it after every claude update. This is a real maintenance cost. If you update Claude Code frequently, you will be re-patching often. The restore command exists, but it depends on the patch being reversible. The README does not describe what the patcher changes internally or whether it survives a Claude Code uninstall. If you are in a managed environment that verifies binary integrity, this step could break. The project's own documentation frames the patch as recommended but not mandatory for basic use, which is honest, but the Agent tool requirement makes it effectively mandatory for anyone using subagents.

Provider support and the community tier

The README lists three providers: OpenAI with API key, OpenAI with ChatGPT/Codex plan OAuth, and OpenCode Go with API key. The first two are fully supported by the maintainer, meaning they can be exercised against live APIs. OpenCode Go is community-supported, which the README defines as the maintainer holding no account for that service. That means it cannot be debugged when the vendor changes something. The maintainer still reviews and tests it, but it depends on the contributor when upstream moves. New providers land under this tier by default. This is a practical distinction. If you rely on OpenCode Go, you accept that fixes may lag. The README also claims support for OpenAI prompt caching and the use of websockets to talk to the OpenAI API, both of which are listed as features in the comparison table. Those are concrete technical claims, but the README does not explain how caching is configured or whether it is automatic.

What the comparison table claims

The README includes a feature matrix comparing clodex to relay-ai, CLIProxyAPI, and various process-based solutions. The claims are specific: clodex and relay-ai work with Claude Code plans without violating ToS, while CLIProxyAPI does not. clodex is the only one that makes Claude Code aware of the true model context window size. clodex supports the Agent tool, dynamic workflows, and skill/agent frontmatter, while relay-ai does not support the Agent tool. The table also says clodex uses websockets to talk to the OpenAI API, while relay-ai does not. These are strong claims, and they come from the project's own README, not from independent testing. The table is useful for understanding the design intent, but you should treat it as marketing material. The actual behavior depends on how well the proxy handles edge cases like streaming, tool calls, and rate limits, none of which the README covers in detail.

Limitations and wrong-tool cases

The most obvious limitation is the man-in-the-middle proxy itself. Claude Code must trust the clodex CA certificate for proxy mode to work. That is a significant trust decision. If you are in a corporate environment that locks down certificate stores, this may be a non-starter. The README does not explain how the CA is installed or whether it is scoped to the system or per-user. Another limitation is the reliance on device-code OAuth. If your workspace admin disabled device-code authorization, you need --browser, which may still fail in a headless CI environment. The patch step is also fragile across Claude Code updates, as noted. clodex is the wrong tool if you want a neutral API gateway that works with any Anthropic-compatible client, because it is tightly coupled to Claude Code's internals. It is also not a good fit if you do not already have a Claude Code plan, since the proxy mode depends on Claude Code's own login. For a pure OpenAI-to-Anthropic bridge without Claude Code, you would be better served by a generic proxy.

Alternatives and how they differ

The README itself names relay-ai as the project clodex was derived from. relay-ai is a broader relay that also works with Claude Code plans, but it does not support the Agent tool and does not make Claude Code aware of true context windows. That is a real difference in approach: relay-ai is a general relay, while clodex is a focused bridge with a patcher. Another alternative is CLIProxyAPI, which the README says violates Anthropic's ToS because it requires duplicating the OAuth flow. The README does not go into detail on how CLIProxyAPI works, but the implication is that it sets ANTHROPIC_BASE_URL to a custom value, which clodex avoids in proxy mode. The process-based solutions, like running a child codex process, are listed as not supporting the Agent tool or dynamic workflows. The key difference is that clodex integrates at the HTTP layer with a selective proxy, rather than spawning separate processes or relaying all traffic through a gateway that replaces credentials.

Maintenance, licensing, and upgrade cost

clodex is MIT-licensed, which means you can use it freely, but the README does not mention any contributor license agreement or CLA. The repository shows recent releases on consecutive days (v2.8.1, v2.8.2, v2.8.3), which suggests active maintenance, but the README does not state a release cadence or a deprecation policy. The main upgrade cost is the patch step: every time you update Claude Code, you must re-run clodex patch. The README also says to use --save-mode if you want a mode flag to persist, which means default behavior can change silently if you forget to save. The project is derived from relay-ai with full commit history preserved, so you can trace changes, but that also means the codebase carries history from a different project. For a security-sensitive tool like a MITM proxy, you should review the code yourself, especially the CA handling and the OAuth token storage. The README does not provide a security audit or a list of known vulnerabilities.

Editorial conclusion

Adopt clodex if you have a ChatGPT/Codex plan or an OpenAI API key and want those models inside Claude Code without abandoning your Anthropic subscription. Skip it if you cannot trust a man-in-the-middle proxy with your HTTPS traffic or if your workspace blocks device-code OAuth and you refuse the browser fallback. Before committing, verify that the patcher works with your exact Claude Code version, test `clodex patch --restore` on a non-production install, and confirm that your provider of choice is in the supported list, since OpenCode Go is community-supported and may lag upstream changes.

Frequently asked questions

What is Codex used for?

In clodex it is one of the authentication paths: clodex providers auth openai signs in with your ChatGPT or Codex plan over a device-code OAuth flow, so Claude Code can route to OpenAI models under that subscription instead of requiring API billing.

Is codex from OpenAI?

The README treats it as the OpenAI plan you authenticate against, naming it together with ChatGPT and describing device-code OAuth, with the token stored in your operating system credential store. API-key users use clodex providers add instead.

What is the difference between clodex proxy mode and endpoint mode?

Proxy mode is the default and selectively intercepts requests to api.anthropic.com, leaving Anthropic model requests untouched with Claude Code's own token. Endpoint mode runs a local Anthropic-format gateway and points ANTHROPIC_BASE_URL at it, so all traffic passes through it. Add --save-mode to make a flag the saved default.

What does clodex patch do, and can it be undone?

It bakes your favorites and aliases into the Claude Code binary so those models pass validation, appear in the /model menu and report their real context windows. clodex patch --restore undoes it, and it has to be re-run after each claude update.

Which providers does clodex fully support?

OpenAI by API key and OpenAI through a ChatGPT or Codex plan are fully supported by the maintainer. OpenCode Go and custom OpenAI-compatible servers such as OpenRouter or vLLM are community-supported, because the maintainer holds no account for those services and new providers land in that tier by default.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/bman654-clodex.svg)](https://hysenlabs.com/projects/bman654-clodex)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/bman654-clodex.svg)](https://hysenlabs.com/projects/bman654-clodex)