{"slug": "260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config", "title": "[260819] DeepSeek Meets Codex: Don't Follow the Official Guide and Edit the Config File", "summary": "X-CMD v0.10.3 enables DeepSeek V4 series models to run with OpenAI's Codex via the Responses API without modifying existing Codex configuration files, using the 'x codex ds' command and environment variables for API keys. The approach overrides settings only for the current process, allowing OpenAI and DeepSeek to coexist, with a persistent configuration solution planned for the next release.", "body_md": "# DeepSeek Meets Codex: Don't Follow the Official Guide and Edit the Config File\n\nTLDR\n\n- DeepSeek now supports the OpenAI Responses API, enabling direct Codex integration.\n- x codex ds runs DeepSeek without modifying existing Codex configuration.\n- OpenAI and DeepSeek can coexist, with API keys passed via environment variables.\n\nRecently, **DeepSeek V4 series models added support for the OpenAI Responses API**, making Codex integration much more straightforward.\n\nHowever, compared with DeepSeek's official integration guide, we provide a safer and more convenient approach: **use DeepSeek models without modifying your existing Codex configuration.**\n\n## Don't Modify the Config File \n\nPreviously, integrating third-party models with Codex required handling the conversion between the Responses API and Chat Completions API. Now that DeepSeek natively supports the Responses API, this extra step is no longer necessary.\n\nHowever, we noticed that DeepSeek's official integration guide **directly modifies the global configuration file as plain text, rather than using a dedicated TOML editing tool**. In highly customized setups, this approach could potentially disrupt existing configuration. Switching back to OpenAI afterward is also inconvenient. **Why modify an already-configured Codex just to add another model?**\n\nAfter using Codex for a while, `~/.codex/config.toml`\n\noften contains many personal settings, including ** model, provider, permission policies, MCP, and hooks**.\n\nFollowing the official guide can integrate DeepSeek successfully, but it changes the existing Codex environment. Switching back to OpenAI later requires editing the configuration again.\n\nOur approach uses Codex's ** --config option** to provide the DeepSeek-specific settings as\n\n**overrides for the current launch**. They\n\n**only apply to the current Codex process** and do not affect the user's existing\n\n`config.toml`\n\n, `models.json`\n\n, or other files.## Safe and Non-Intrusive \n\n**Your existing Codex configuration remains completely unchanged.** Even if you've heavily customized Codex, you don't need to edit or overwrite configuration files just to use DeepSeek, **avoiding unintended changes to other settings when switching models.**\n\n**The API key can also be passed through environment variables, so it doesn't need to be stored in plain text in TOML.**\n\n## Easy to Coexist \n\n**You don't need to repeatedly edit the configuration to switch between OpenAI and DeepSeek.**\n\nWhen you need DeepSeek, simply run:\n\n```\nx codex ds\n```\n\nAfter exiting, start Codex normally, and **it will still use your original OpenAI configuration**.\n\nThis approach is suitable for one-off tasks or scenarios where you need to switch between different models. Update to or download the latest `X-CMD`\n\n**v0.10.3** to use it.\n\n## Persistent Configuration \n\nIf you later want to use DeepSeek as your default model or **sync the configuration to clients such as Codex Desktop**, you will need to **make the configuration persistent**.\n\nFor this, we will provide an ** x codex use ds** solution in the next release, using a\n\n**dedicated TOML editing tool** to switch configurations\n\n**without manually editing the configuration file**.\n\nPlease indicate the source and link of this article when reprinting.\n\nHelp us make these docs great!\n\nAll X-CMD docs are generated from command help and multiple data sources. See something that's wrong or unclear? Feel free to let us know through any of these ways~", "url": "https://wpnews.pro/news/260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config", "canonical_source": "https://x-cmd.com/blog/260819/", "published_at": "2026-08-19 00:00:00+00:00", "updated_at": "2026-08-19 03:40:39.524304+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["DeepSeek", "OpenAI", "Codex", "X-CMD"], "alternates": {"html": "https://wpnews.pro/news/260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config", "markdown": "https://wpnews.pro/news/260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config.md", "text": "https://wpnews.pro/news/260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config.txt", "jsonld": "https://wpnews.pro/news/260819-deepseek-meets-codex-don-t-follow-the-official-guide-and-edit-the-config.jsonld"}}