How to Connect GPT, DeepSeek, and Grok to Codex Using OpenCodex
This step‑by‑step guide shows how to install OpenCodex, configure multiple AI providers such as GPT, DeepSeek, and Grok, and switch between them within Codex to streamline complex refactoring, batch edits, and script generation tasks.
The author explains a practical problem: needing GPT for complex refactoring, DeepSeek for low‑cost batch edits, and Grok for other tasks, and how to manage these models without repeatedly reconfiguring Codex.
What OpenCodex Does
OpenCodex acts as a local model gateway. It intercepts Codex requests and forwards them to the selected provider, allowing official and third‑party models to appear together in Codex’s model list.
Key benefits:
Different models can coexist, enabling task‑specific switching.
A visual configuration page shows providers, model names, endpoints, and connection status.
API keys and subscription logins are managed centrally.
Step 1 – Install
Node.js 18+ is required. Run the following command in a terminal: npminstall -g @bitkyc08/opencodex If the script is blocked by Bun, use:
npminstall -g --allow-scripts=bun @bitkyc08/opencodexVerify the installation with: ocx --version After the first use, run initialization:
ocx initStep 2 – Launch
Start the visual manager with: ocx gui The GUI opens the provider configuration page; if the service isn’t running, it will be started automatically.
Step 3 – Add DeepSeek
In the Providers page, click “Add provider” and search for DeepSeek. After selecting it, confirm the name and adapter, then fill in the API key, endpoint, and default model. The adapter used is openai-responses. Save and verify the connection status.
Subscription accounts can be added either directly on the Providers page or via command line. For example, to log in to an xAI account: ocx login xai After successful authorization, the model appears in Codex’s model list alongside the API key.
Step 4 – Use in Codex
Reopen Codex and open the model selection box. If GPT, DeepSeek, and Grok are all visible, the multi‑model configuration is active. Switch models just like with the built‑in provider.
The author recommends assigning tasks: use GPT for architecture design, complex refactoring, and tricky errors; use DeepSeek for batch edits, formatting, and simple scripts, e.g., switching between DeepSeek’s flash and vision models.
Model selection happens inside Codex, reducing cost and friction. If you already use Codex and have multiple model accounts, this configuration is worth trying.
Final Note
AI tools like Codex still have many pain points—phone verification, plus recharge, plugin usage, workflow building—each can stall. OpenAI’s policies change frequently, so the tutorial may need updates in the future.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Su San Talks Tech
Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
