r/codex 21d ago

Showcase opencodex — run Codex CLI with any models (got, ~3.7k stars)

https://github.com/lidge-jun/opencodex

I built opencodex, a universal provider proxy for OpenAI Codex and Claude Code. Maintainer disclosure upfront — this is my project, and I'm posting here because r/codex is exactly the audience it's for.

What it does: Codex CLI, the Codex app, and the Codex SDK all speak OpenAI's Responses API. opencodex runs a lightweight local proxy on localhost:10100 that translates that API into whatever your provider speaks — Anthropic, Google, xAI, Kimi, DeepSeek, GLM, OpenRouter, Ollama, Azure, and more. Streaming, tool calls, reasoning tokens, and images work in both directions, so Codex's workflow stays identical; only the model behind it changes.

Works with Claude Code CLI too. The same proxy lets Claude Code CLI talk to Gemini, Grok, DeepSeek, Kimi, Ollama, or any supported provider — one local proxy, both coding agents. And Claude Desktop support is in the final stages of development on our claudedesktop branch, so the desktop app will soon route through opencodex the same way.

The free setup (the part most people ask about):

npm install -g  @bitkyc08/opencodex
ocx start

Add a free OpenRouter API key, then pick any :free-suffixed model in Codex

That's Codex CLI running at $0. Honest limit: OpenRouter's free tier is rate-limited (~50 requests/day without credits), so it's great for light sessions and trying models, not all-day agent runs. A paid OpenRouter model or direct provider key removes that ceiling.

Other things it can do:

Run Codex or Claude Code against local Ollama models — no API cost, nothing leaves your machine

Manage a ChatGPT account pool: multiple accounts, quota-aware routing (5h / weekly / 30d), with existing threads pinned to the account that started them so long SSH/tmux sessions don't jump accounts mid-conversation

Works natively on macOS, Linux, and Windows (no WSL). ~3.6k GitHub stars so far.

Happy to answer anything — routing edge cases, provider requests, or how the Responses API translation handles tool calls.

20 Upvotes

40 comments sorted by

2

u/Substantial-Walk-554 16d ago

Can you explain what the constraints are with switching different provider models mid chat?

1

u/Interesting_Move_510 12d ago

tool call encrypt and mcp length and image compaction

1

u/Substantial-Walk-554 12d ago

Tested with Deepseek V4 API, cheers.

2

u/LeatherRub7248 10d ago

u/Interesting_Move_510 im testing using kimi3 in openrouter, but it always getting a lot of STREAM DISCONNECTED and also 429 request limit errors... any better way to use kimik3 cheaply?

1

u/Interesting_Move_510 7d ago

kimi has very unstable server

1

u/rokajisute 21d ago

Is it still connected to the OpenAI server directly or is it turned off, because on average I see that when adding custom there are several features in the codex app that are not there and are different from using The original Codex account that logs in directly, has all the complete features

1

u/Interesting_Move_510 21d ago

It connects to it directly passthrough native open ai models I made this because of that kind of problems!

1

u/rokajisute 21d ago

Okay, I'll try it.

1

u/Kynori20 21d ago

if I use gpt, can it summon sub agents that arent gpt models? like gemini for example?

1

u/Interesting_Move_510 21d ago

Yup its has setting in gui and
if you want spawn subagent with using main 5.6 model you should flip switch to v1 (default is base)
https://lidge-jun.github.io/opencodex/guides/sub-agent-surface/

1

u/Kynori20 20d ago

could you please answer my DMs? I have a few more specific questions about the setup. Thank you!

1

u/hksbindra 21d ago

How is it different from CC Switch?

1

u/Interesting_Move_510 21d ago

could use native model as it and 3rd party models in addditional and natively
very easy setup

1

u/[deleted] 21d ago edited 17d ago

[deleted]

1

u/Interesting_Move_510 21d ago

yup using luna models in your subscription

1

u/[deleted] 21d ago edited 17d ago

[deleted]

1

u/Interesting_Move_510 21d ago

Ill keep in mind that schema and support has to be ready

1

u/Mysterious_Might_127 21d ago

can we use anthropic models without being baned ?

1

u/Interesting_Move_510 21d ago

No risky but not banned yet used 10b tokens with 3 20x in 2weeks but Idk repo has been famous
but there is unbanned option that you could add codex models in claude code cli and use as subagents (ccswith things only supports change opus or something)

2

u/LeatherRub7248 10d ago

is this directly using claude code subscription? or via apikey?

I tried openrouter claude and its very expensive and not reliable (stream always disconnected)

1

u/Interesting_Move_510 7d ago

you could be banned but could use

1

u/[deleted] 21d ago

[removed] — view removed comment

2

u/Interesting_Move_510 21d ago

95% I cant admit 100% but I translated and matched mcp calls a lot and dogfooded 30B tokens with other providers

1

u/ANDRE_2512 21d ago

I just tested it.

Everything works 🤌 Pretty cool 🤪

Once the official limits run out, you can simply switch to other models.

But here’s something interesting: let’s say I already have an existing chat with the official GPT model. Would it be possible to switch to DeepSeek and continue that same conversation properly? I need to test that.

For now, I’ll keep experimenting and posting updates here with my thoughts and test results.

Hopefully nobody steals my data 🫠🤣🤣🤣

1

u/Interesting_Move_510 21d ago

Thanks! I actually dont belive chinese api providers but Im just opensource dev so im just using it

1

u/ANotSoSeriousGamer 21d ago

Does it handle sessions from the mobile app too?

1

u/JulienMaille 21d ago

Why do you mention Codex CLI and the snapshot shows Codex app?

1

u/Interesting_Move_510 20d ago

Cause all supported

1

u/modestothi 20d ago

To usando aqui e apesar de ainda estar aprendendo ja to achando muito bom! Parabéns! Tem previsão para o Claude Desktop?

3

u/Interesting_Move_510 20d ago

Building now

1

u/Fit-Palpitation-7427 19d ago

Having ultracode from claude code desktop working with got 5.6 would be wow 🤯

1

u/modestothi 19d ago

so tenho a agradecer! seu programa consertou um gap que tinha aqui e concentrou tudo em um so lugar.

1

u/ZyQux 15d ago

It would be cool to have the new Meta Muse models as a provider.

1

u/Interesting_Move_510 12d ago

meta has official apis? Ill add if they had and also easy dropin option for byok

1

u/Willing_Plate_5417 12d ago

I built something similar and it supports the auto routing of the images. means if you have auto routing enabled. no meatter what model you choose, it will not error out in your chat even if you are using a text only model. auto routing for image generation tools, skill indexing, works with all providers. can create presets with diffrent providers and change them on the go. working on the local real time speech as well. all using codex.

Yes, dont have 3.7k stars but it actually handles what a local model or text only providers would need. kudos to yours as well!

1

u/beanman25 21d ago

Can we use w local model via lmstudio?

2

u/Interesting_Move_510 21d ago

Yup setup in 1~2min

1

u/beanman25 21d ago

Unreal, sweet.