Seamlessly integrate any LLM with OpenAI Codex and Claude Code.
Project details
opencodex serves as a universal provider proxy for OpenAI Codex and Claude Code, allowing users to leverage any LLM while maintaining the familiar Codex workflow. It simplifies integration with various models like Claude, Gemini, and Ollama, offering robust functionality including account management and support for multiple sessions.
opencodex is a universal provider proxy designed to connect various Large Language Models (LLMs) with OpenAI's Codex and Claude Code. This lightweight local proxy allows seamless interaction between Codex CLI, App, and SDK, and multiple LLM providers such as Claude, Gemini, Grok, DeepSeek, and more.
The architecture is designed for flexibility:
flowchart LR
codex[Codex session<br/>CLI, App, SSH, mobile] --> proxy[opencodex]
proxy --> existing{Existing thread?}
existing -->|yes| pinned[Keep the same<br/>ChatGPT account]
existing -->|new session| quota[Refresh quota<br/>5h, weekly, 30d]
quota --> pick[Pick lowest-usage<br/>healthy account]
pick --> upstream[ChatGPT / Codex backend]
pinned --> upstream
upstream --> outcomes[Quota / auth outcome]
outcomes -->|429| cooldown[Cooldown + failover]
outcomes -->|401 / 403| reauth[Mark reauth needed]
cooldown --> quota
This design allows opencodex to translate Codex's Requests API into a language understood by any LLM provider, ensuring all features—streaming, tool calls, and reasoning tokens—function smoothly.
Install opencodex via npm with the following command:
npm install -g @bitkyc08/opencodex
Then initialize the setup:
ocx init
Start the proxy with:
ocx start
This sets up an interactive environment where Codex routes through the opencodex proxy.
The opencodex dashboard provides a user-friendly interface to add providers, view usage statistics, and manage your settings interactively. New providers can be added easily, with auto-discovery of models from the provider's API endpoint.
Directly access any configured provider and model using the provider/model syntax, with all routed models appearing within the Codex App model picker:
# Example commands to leverage routed models:
codex -m "anthropic/claude-opus-4-8" "Explain this stack trace"
codex -m "google/gemini-3-pro" "Write unit tests for auth.ts"
For comprehensive documentation, visit the opencodex documentation site. This extensive guide covers installation, configuration, and best practices for integrating opencodex into your workflow.
Comments
0Start the conversation
Share the first comment.