Run DeepSeek-V4-Flash Inside Codex CLI Without Breaking Your ChatGPT Login
The official method of adding a second provider to Codex CLI overwrites the main config and forces an API-key-only login, which logs out the ChatGPT session. This profile-based workaround keeps both auth methods alive, so developers can evaluate DeepSeek's coding model without sacrificing their existing workflow.
Codex CLI can now switch between three isolated model profiles — default GPT, DeepSeek-V4-Flash, and an existing GPT-5.5 setup — by passing a profile flag. The key fix is keeping the main config.toml untouched and giving DeepSeek its own profile file that sets requires_openai_auth to false, so the ChatGPT login session in auth.json stays valid. A custom models.json entry registers DeepSeek-V4-Flash with its reasoning tiers, 1M-token context window, and tool capabilities, requiring Codex CLI 0.144.0 or later. Sessions are started with codex -p deepseek and resumed with the --last flag, and the API key lives only in the local deepseek.config.toml file.
Codex CLI's profile system was designed for environment switching, but the documentation omits the auth.json conflict that occurs when a second provider forces API-key login — this workaround fills that gap.
The models.json catalog is not just metadata; it gates which reasoning tiers and tools the client exposes, so a missing or misconfigured entry silently degrades the model's capabilities.
Setting requires_openai_auth = false while omitting forced_login_method and preferred_auth_method is the precise combination that prevents the logout prompt, suggesting the client checks those fields before invalidating the existing session.