DeepSeek in Codex
Codex talks to models through the Responses API, and DeepSeek supports it natively, so DeepSeek can be Codex's model. One config file covers the Codex CLI, the ChatGPT desktop app and the Codex extension for VS Code.
The easy way: import into CC Switch
CC Switch is a free app that manages Codex and Claude Code settings. Install it, then on your HaryAI account page press Import for Codex. It writes the settings, leaves the rest of your config alone, and switches back whenever you want.
After switching, your earlier sessions may seem to be gone. They aren't: Codex keeps sessions from a ChatGPT login and sessions from an API key in separate lists, and shows the one that matches your current setup.
Or edit the config yourself
Add this to ~/.codex/config.toml and replace the placeholder with your HaryAI key. To use DeepSeek V4 Pro instead, set model to deepseek-v4-pro.
model = "deepseek-flash"
model_provider = "haryai"
forced_login_method = "api"
model_reasoning_effort = "high"
[model_providers.haryai]
name = "HaryAI"
base_url = "https://api.haryai.com/v1"
wire_api = "responses"
experimental_bearer_token = "<your HaryAI key>"DeepSeek in Claude Code
Add this env block to ~/.claude/settings.json, put in your key, and reopen Claude Code. It works for the CLI and the VS Code extension. The setup guide also has a one-click CC Switch import and a prompt that lets your agent do it.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.haryai.com",
"ANTHROPIC_AUTH_TOKEN": "<your HaryAI key>",
"ANTHROPIC_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-flash",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-flash",
"CLAUDE_CODE_EFFORT_LEVEL": "max",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "786432",
"CLAUDE_CODE_DISABLE_ARTIFACT": "1"
}
}Questions
Do I need a ChatGPT login for Codex?
No. The config tells Codex to sign in with an API key instead.
Can DeepSeek read screenshots in Codex?
DeepSeek V4.1 Flash takes image input. DeepSeek V4 Pro doesn't.
Is this only for programmers?
No. Codex and Claude Code can also write documents, edit spreadsheets and make slides, and DeepSeek does the same work there.
Sources
DeepSeek's figures are from its own docs, checked on 2026-11-15.
DeepSeek at 55% off the official price
Cheaper than DeepSeek's own off-peak price, around the clock.