Run DeepSeek in Codex CLI
Keep Codex CLI's powerful agent workflow — project-aware editing, tool use, bash execution — while swapping the underlying model to DeepSeek-V4 Pro (or any supported model via chatgpttech.mobi). One-time setup, 5 minutes, transparent after that.
$ codex
> Using model: deepseek-v4-pro
Provider: chatgpttech.mobi
> Let's build something.Quick Start — one command, 30 seconds
Paste this in your terminal — it installs everything and guides you through setup:
$ curl -fsSL https://chatgpttech.mobi/install.sh | bashInstall Codex CLI
Codex CLI is OpenAI's open-source agentic coding tool. Install it globally:
npm install -g @openai/codexSee OpenAI's Codex GitHub for more installation options and documentation.
Get your API key from chatgpttech.mobi
- Register an account at chatgpttech.mobi
- Go to API Keys in the dashboard
- Click "Create API Key" and copy it
sk-hub-xxxxxxxxxxxxxxxxYour key format should start with sk-hub-.
Create config.toml
Create or edit ~/.codex/config.toml with the following configuration. This tells Codex to use chatgpttech.mobi as the model provider:
model_provider = "openai_compatible"
model = "deepseek-v4-pro"
model_reasoning_effort = "high"
[model_providers.openai_compatible]
name = "chatgpttech"
base_url = "https://api.chatgpttech.mobi/v1"
env_key = "TECHMOBI_API_KEY"model_provider: Set to openai_compatible — Codex's generic provider for OpenAI-compatible APIs.
model: Any model from chatgpttech.mobi/models (e.g., deepseek-v4-pro, deepseek-v4-flash).
model_reasoning_effort: Optional. Set to low, medium, high, or xhigh.
Set your API key
Codex reads the API key from the TECHMOBI_API_KEY environment variable (configured via env_key in config.toml). Add it to your shell config:
# Add to ~/.zshrc (or ~/.bashrc for bash users)
export TECHMOBI_API_KEY="sk-hub-${YOUR_KEY}"After saving: Run source ~/.zshrc (or source ~/.bashrc) to apply the changes, or open a new terminal window.
Launch Codex CLI
Navigate to your project and run codex:
cd /path/to/your/project codexThat's it! Codex CLI now runs with your chosen model via chatgpttech.mobi.
Recommended Model Configurations
Set these model and model_reasoning_effort values in your ~/.codex/config.toml. All models are routed through chatgpttech.mobi.
| Model | Reasoning Effort | Notes |
|---|---|---|
| deepseek-v4-pro | high | Most capable, for complex tasks |
| deepseek-v4-pro | medium | Balanced performance and cost |
| deepseek-v4-flash | high | Fastest, great for quick iterations |
| deepseek-v4-flash | medium | Lowest latency, simple tasks |
| deepseek-r1-v4 | xhigh | Deep reasoning, research-grade |
| deepseek-r1-v4 | high | Strong reasoning, faster |
Any model from chatgpttech.mobi/models can be used. These are the recommended pairings — you can customize them.
FAQ & Tips
P.S. Codex CLI is open-source and provider-agnostic. You can switch between providers by editing ~/.codex/config.toml. The chatgpttech.mobi setup gives you access to DeepSeek and other Chinese AI models through a single API.