DeepSeek in Claude Code

Claude Code can work with any service that speaks Anthropic's API, and DeepSeek does. Point it at HaryAI and every request runs on DeepSeek, at 55% off DeepSeek's own price, peak hours included.

US dollars per 1M tokens
ModelInput, cache hitInput, cache missOutput
DeepSeek V4.1 FlashDeepSeek, peak hours$0.006$0.3$1.2
DeepSeek, off-peak$0.003$0.15$0.6
HaryAI$0.003$0.135$0.54
DeepSeek V4 ProDeepSeek, peak hours$0.044$1.32$3.96
DeepSeek, off-peak$0.022$0.66$1.98
HaryAI$0.022$0.594$1.782

Three ways to set it up

One click with CC Switch

CC Switch is a free app that switches your tools between providers. Install it from its GitHub releases page.

  1. On your account page, press Show next to your key, then Import for Claude Code.
  2. CC Switch opens. Confirm, switch Claude Code to HaryAI, and restart Claude Code.

Account page

Ask an AI to do it

Send this to Codex or Claude Code (or whatever AI assistant you use). Put your key in place of <your HaryAI key> first.

Prompt
Set up Claude Code on this computer to use HaryAI.

1. Back up ~/.claude/settings.json (copy it to ~/.claude/settings.json.bak). If it doesn't exist, create it containing {}.
2. Add the entries below to the "env" object in that file. If an entry with the same name is already there, change its value. Keep every other setting, and keep the file valid JSON.

```json
{
  "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"
  }
}
```

3. Then tell me to start a new Claude Code session and send a short message to check that it answers.
4. Also tell me how to undo this: put the backup back and start a new session.

By hand

Add this to ~/.claude/settings.json, with your key in place of <your HaryAI key>. If the file already has an "env" block, add these entries to it. This covers the Claude Code CLI and the VS Code extension.

~/.claude/settings.json
{
  "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"
  }
}

Check: Start a new Claude Code session and send a short message. A reply means you're set.

What the settings change

These are the entries that go into the env block of ~/.claude/settings.json. CC Switch and the prompt write the same ones.

ANTHROPIC_BASE_URLhttps://api.haryai.comSends Claude Code's requests to HaryAI instead of Anthropic.
ANTHROPIC_AUTH_TOKEN<your HaryAI key>Signs in with your HaryAI key, so no Claude account is used.
ANTHROPIC_MODELdeepseek-flash[1m]The main model: DeepSeek V4.1 Flash with its full 1M-token context.
ANTHROPIC_DEFAULT_OPUS_MODELdeepseek-flash[1m]Whenever Claude Code would pick Opus, it gets the same model.
ANTHROPIC_DEFAULT_SONNET_MODELdeepseek-flash[1m]The same for Sonnet.
ANTHROPIC_DEFAULT_HAIKU_MODELdeepseek-flashSmall background jobs, such as naming a session.
CLAUDE_CODE_SUBAGENT_MODELdeepseek-flashSubagents run on DeepSeek as well.
CLAUDE_CODE_EFFORT_LEVELmaxThinks as hard as it can on every task.
CLAUDE_CODE_AUTO_COMPACT_WINDOW786432Shortens the conversation only when it nears 768K tokens, not at 200K.
CLAUDE_CODE_DISABLE_ARTIFACT1Turns off the Artifact tool, which DeepSeek doesn't accept.

To use DeepSeek V4 Pro

Change deepseek-flash to deepseek-v4-pro in the three main model entries and keep the [1m]. V4 Pro reads text only, so screenshots are skipped.

To undo it

Put the backup of ~/.claude/settings.json back, or delete these entries from its env block, then start a new session. If you used CC Switch, switch Claude Code back to your previous provider there.

Questions

Do I need a Claude subscription?

No. With these settings Claude Code signs in with your HaryAI key.

Why does Claude Code still list Opus, Sonnet and Haiku?

Those are Claude Code's own labels. With these settings every one of them runs on DeepSeek.

Do my projects and sessions stay?

Yes. Only the entries above change; everything else in your setup stays as it is.

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.