CChatGPTTech
Codex CLI + DeepSeek — it really works

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.

5 min
one-time setup
Any model
from chatgpttech.mobi
Transparent
after config
terminal
$ codex
> Using model: deepseek-v4-pro
  Provider: chatgpttech.mobi

> Let's build something.
Codex CLI
Agent workflow
Model
DeepSeek-V4 Pro
Setup
5 minutes

Quick Start — one command, 30 seconds

auto-detected

Paste this in your terminal — it installs everything and guides you through setup:

$ curl -fsSL https://chatgpttech.mobi/install.sh | bash
Prefer manual setup? Follow the steps below
1

Install Codex CLI

Codex CLI is OpenAI's open-source agentic coding tool. Install it globally:

npm install -g @openai/codex

See OpenAI's Codex GitHub for more installation options and documentation.

2

Get your API key from chatgpttech.mobi

  1. Register an account at chatgpttech.mobi
  2. Go to API Keys in the dashboard
  3. Click "Create API Key" and copy it
sk-hub-xxxxxxxxxxxxxxxx

Your key format should start with sk-hub-.

3

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.

4

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:

~/.zshrc~/.bashrc
# 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.

5

Launch Codex CLI

Navigate to your project and run codex:

cd /path/to/your/project codex
terminal
$ codex
Using model: deepseek-v4-pro
Provider: chatgpttech.mobi
> Ready. What would you like to build?

That'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.

ModelReasoning EffortNotes
deepseek-v4-prohighMost capable, for complex tasks
deepseek-v4-promediumBalanced performance and cost
deepseek-v4-flashhighFastest, great for quick iterations
deepseek-v4-flashmediumLowest latency, simple tasks
deepseek-r1-v4xhighDeep reasoning, research-grade
deepseek-r1-v4highStrong 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.