Use Codex for Free: CCX + DeepSeek Alternative Setup in Five Minutes
Use Codex for Free: CCX + DeepSeek Alt…
Use CCX middleware to route Codex requests to DeepSeek for a free AI coding assistant setup.
This guide shows how to use OpenAI's Codex AI programming assistant for free by leveraging CCX, an open-source local gateway that forwards requests to DeepSeek's affordable API. The three-step setup covers installing Codex, obtaining a DeepSeek API key, and configuring CCX for protocol translation and model mapping — no VPN or OpenAI account required.
Introduction
Codex is OpenAI's AI programming assistant that's been generating a lot of buzz recently. However, it's not easy for users in China to access — registration requires a foreign phone number, and there's a $20/month subscription fee. So is there a way to use Codex at zero cost without a VPN?
Actually, yes. By using the open-source middleware CCX to forward Codex requests to DeepSeek, you can use it domestically with zero barriers. The following solution comes from B-station creator "Web3村长" — I've compiled the complete configuration process here.
Core Principle: CCX Acts as a "Translator"
Codex originally only recognizes OpenAI's API protocol, and last month OpenAI updated the protocol, making it impossible for domestic models to connect directly. CCX is an open-source tool that works like a translator:
- Codex sends a request → CCX translates it into a format DeepSeek can understand
- DeepSeek returns results → CCX translates them back into a format Codex can receive
- The entire process doesn't go through OpenAI's servers, doesn't require a VPN, and doesn't need a GPT account
This "local gateway forwarding" approach preserves Codex's interactive experience while leveraging DeepSeek's cost advantages.
Technical Background: API Gateway and Protocol Adaptation
The "API gateway" is a classic design pattern in microservices architecture. It serves as a middle layer between clients and backend services, handling request routing, protocol conversion, load balancing, and more. In the AI space, while most major model providers reference OpenAI's Chat Completions API format, there are differences in specific implementations — model names, parameter fields, streaming response formats, and Function Calling structures aren't entirely consistent.
In 2025, OpenAI made a significant update to its API protocol, introducing new authentication mechanisms and request header formats. This broke the previous approach of simply replacing the BaseURL to connect to domestic models. CCX's core function is to start an HTTP service on local 127.0.0.1, intercept all API requests from Codex, "downgrade" or "translate" the new protocol format into a DeepSeek-compatible standard format, and then return responses in the structure Codex expects. The entire data flow is completed within local and domestic networks, with no communication to overseas servers.
Three-Step Configuration Tutorial
Step 1: Download and Install Codex
Go directly to the Codex official website to download the Windows version. The installer is about 500+ MB, and download speeds are decent. Double-click to run and wait for the automatic installation to complete.
After installation, Codex will prompt you to log in with GPT — just close it. You don't need to log into any account.
What is Codex?
The Codex mentioned here is the standalone desktop AI programming assistant application launched by OpenAI in 2025 — don't confuse it with the earlier Codex API (which was retired in 2023). It's positioned as an "AI pair programming partner" — essentially an enhanced programming-specific version of ChatGPT that supports code generation, debugging, refactoring, and explanation, and can directly read local project files for context-aware code suggestions.
Unlike GitHub Copilot, which primarily embeds within IDEs, Codex is a standalone application with its own conversation interface and project management capabilities. In the current AI-assisted programming competitive landscape, Codex, Cursor, Windsurf, and GitHub Copilot each have different strengths: Copilot excels at inline IDE completions, Cursor excels at deep editor integration, while Codex emphasizes a conversational, task-driven development mode.
Step 2: Obtain a DeepSeek API Key
Go to the DeepSeek Open Platform (platform.deepseek.com), register an account, and after adding a small amount of credit:
- Click "API-Key" in the left menu
- Click "Create" and enter any name
- Save the generated API Key (it can be used long-term after creation)
DeepSeek's API pricing is much lower than OpenAI's. The V4 Flash model is so cheap it's almost negligible, making it very suitable for daily development.
DeepSeek's Technical Positioning and Cost Advantages
DeepSeek is one of China's leading AI laboratories, known for its "high performance, low cost" technical approach. The DeepSeek V4 series models use MoE (Mixture of Experts) architecture, meaning that while the total parameter count is enormous, only a subset of expert networks is activated during each inference, dramatically reducing computational costs.
For a specific price comparison: OpenAI GPT-4o's API pricing is approximately $2.5 per million input tokens and $10 per million output tokens; while DeepSeek V4 Flash is priced at approximately 0.8 RMB per million input tokens and 2 RMB per million output tokens — a difference of several dozen times. For high-frequency use cases like daily programming assistance, this cost difference means you can accomplish with a few RMB what would otherwise cost tens of dollars. A 10 RMB top-up could last one or two months under normal development intensity.
Step 3: Install and Configure the CCX Gateway
This is the most critical step. Download CCX from GitHub (current latest version is 2.8.20):
- Select the Windows 64-bit exe version, approximately 17MB
- If a "Windows PC protection" prompt appears during installation, click "More info" → "Run anyway"
- After installation, open CCX and click "Complete configuration and start"
Configure Codex Connection:
In the Codex configuration area of the CCX interface, select "CCX Local Gateway" from the dropdown, then click "Apply Configuration" → "Confirm Apply."
Configure DeepSeek Channel:
- Click "Channel Center" on the left
- In the "Add Target" dropdown, select Codex
- Keep the BaseURL at its default
- Enter the DeepSeek API Key you just obtained
- Click "Add to CCX"
After configuration is complete, reopen Codex. It will go directly to the conversation interface without requiring login. Type "Who are you" as a test — if you receive a response, the setup is working.
Model Mapping: Distinguishing Pro and Flash
DeepSeek currently has two main models with different use cases:
| Model | Characteristics | Use Cases |
|---|---|---|
| DeepSeek V4 Pro | More capable, higher price | Complex programming tasks |
| DeepSeek V4 Flash | Fast, extremely low price | Daily development tasks |
However, the Codex interface only displays GPT series model names and doesn't allow direct selection of DeepSeek models. The solution is to set up model mapping in CCX:
- Open the CCX management interface → Codex tab, find channel editing
- In the default configuration, "GPT" maps to DeepSeek V4 Pro, and "mini" maps to V4 Flash
- You can also customize names, such as using "GPT5.5" for Pro and "GPT5.4" for Flash
By switching between these custom model names in Codex, you can flexibly choose which DeepSeek model to use.
Technical Logic of Model Mapping (Model Routing)
Model mapping is essentially a "routing rule" in the API gateway — when the gateway receives a request with the model field set to "gpt-4o", it replaces it with "deepseek-v4-pro" according to a preset mapping table, then forwards it to DeepSeek's API endpoint. This design pattern is very common in AI middleware, with open-source projects like One API and New API implementing similar functionality.
The reason this mapping layer is needed is that the Codex client's model selection list is hardcoded — it only recognizes OpenAI's own model names (such as gpt-4o, gpt-4o-mini, etc.) and cannot add custom models. By doing name substitution at the gateway layer, users can transparently route requests to any compatible backend model without modifying the client. This also means that if you want to switch to other domestic models in the future (such as Qwen or Kimi), you only need to modify the mapping rules and API Key in CCX — the Codex side remains completely unaware.
Usage Notes
CCX must remain running. Before using Codex each time, confirm that the CCX gateway is started. It's recommended to enable "Start on boot" in CCX settings to avoid having to start it manually every time.
Verify configuration through gateway monitoring. CCX has a "Gateway Monitor" entry at the top — click it to see which model each request actually calls, making it easy to confirm whether the mapping is working.
Watch your costs. For daily use, it's recommended to default to V4 Flash and only switch to Pro for complex tasks. This way, API costs are essentially negligible.
A note on data security. When using this solution, your code and conversation content will be sent to DeepSeek's servers for inference processing. Although DeepSeek's privacy policy states that user API call data won't be used for model training, if your project involves highly sensitive commercial code or confidential information, you should still assess the risk of data transmission. For enterprise use cases, consider DeepSeek's private deployment solutions, or use locally deployed open-source models (such as running DeepSeek's open-source version via Ollama) with CCX to achieve completely offline AI programming assistance.
Conclusion
The core value of this solution can be summed up in one sentence: Experience Codex's complete workflow at minimal cost.
Codex is indeed one of the stronger AI programming assistants currently available, but the $20/month barrier keeps many people out. With the CCX plus DeepSeek combination, you can spend just a few RMB to test the waters, see whether Codex can actually improve your development efficiency, and then decide whether to subscribe to the official service.
From a broader perspective, this "international product for frontend experience, domestic model for backend compute" combination is becoming mainstream practice among Chinese developers. It reflects an interesting phenomenon in the current AI tool ecosystem: product experience and model capability are decoupling. A good AI programming tool's value lies not only in how powerful the underlying model is, but also in interaction design, context management, project understanding, and other engineering capabilities. At the model level, as domestic large models rapidly catch up in code generation tasks, "replacing GPT with domestic models" is already a viable and economical choice in an increasing number of scenarios.
Tools are meant to be used — you shouldn't be blocked by registration barriers and fees. Start using it first, then decide if it's worth it.
Related articles

Claude Code for Test Development in Practice: An AI Programming Workflow That Doubles Your Efficiency
A practical guide to Claude Code for test development: auto-generating test scripts, Plan Mode workflows, MCP + Playwright integration, and Subagent parallel tasks to build systematic AI-assisted workflows.

Hermes Agent Hands-On Review: An AI Efficiency Revolution for Indie Game Developers
Indie game developer reviews Hermes Agent vs OpenClaude: intelligent context compression, real-time Memory, remote control via Telegram, and practical use cases in game dev, social media, and email.

Vibe Coding Beginner's Guide: Tool Selection Across Three Categories with Practical Examples
A comprehensive guide to Vibe Coding's three tool categories: Agent frameworks, CLI Coding, and IDE tools, with practical examples including Snake game and data analysis workbench.