Claude Code Now Works with DeepSeek V4: Switch via Environment Variable, Just as Good, Way Cheaper

Published on: 2026-06-23

Claude Code Now Works with DeepSeek V4: Switch via Environment Variable, Just as Good, Way Cheaper

📖 Glossary

AI Box (also known as Agent Computer / Agent PC), is a dedicated local hardware device that runs AI Agents. Pre-installed with an AI agent management system, plug-and-play, running 24/7. Users can remotely command AI to work via Discord, Slack, Telegram, WhatsApp, and more.

Abstract: Claude Code now supports switching to DeepSeek V4 via environment variables. Two simple configuration steps let you use a domestic model for AI programming in your terminal at a fraction of the cost. Detailed tutorial + performance comparison included.

Using Claude Code for a day of programming? That's dozens of RMB in API fees. Switch to DeepSeek V4 and the same work costs less than one RMB.

The key: you don't have to switch tools. Claude Code is still Claude Code — just the model behind it changes.

How It Works

Claude Code is essentially a terminal-based AI programming tool. It's not locked to one model — whatever API you give it, that's the model it uses.

Default is Claude, which is expensive. But you can point the API to DeepSeek V4 through environment variables.

Two steps:

Step 1: Get a DeepSeek API Key

Register at DeepSeek's website and create an API key. DeepSeek V4 pricing: $0.27/M tokens input, $1.1/M tokens output. Over 50x cheaper than Claude.

Step 2: Set Environment Variables

In your terminal:

export ANTHROPIC_API_KEY=your_DeepSeek_API_Key
export ANTHROPIC_BASE_URL=https://api.deepseek.com/v1

Article Body Image

For Windows PowerShell:

$env:ANTHROPIC_API_KEY="your_DeepSeek_API_Key"
$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/v1"

Then start Claude Code normally. It's now calling DeepSeek V4.

Real Test: How Does It Compare to Claude

I ran three comparison tests — same tasks, Claude Fable 5 vs DeepSeek V4:

Test 1: Write a Python Web Scraper

Claude Fable 5 DeepSeek V4
Code quality Passed first try, no bugs Passed first try, no bugs
Execution time 8 seconds 11 seconds
API cost $0.42 $0.008

Test 2: Fix a React Component Style Bug

Claude Fable 5 DeepSeek V4
Bug fixed Yes Yes
Rounds needed 1 conversation 2 conversations (first attempt had a misunderstanding)
API cost $0.18 $0.003

Test 3: Refactor a 500-line Node.js Module

Claude Fable 5 DeepSeek V4
Refactor quality Excellent, clean structure Good, 1 spot needed manual adjustment
Rounds needed 3 conversations 4 conversations
API cost $0.95 $0.017

Bottom line: For everyday coding tasks, DeepSeek V4 is close to Claude. Complex refactoring and deep context understanding still favor Claude. But given the price difference — DeepSeek V4 costs roughly 1/50th of Claude — DeepSeek is sufficient for most scenarios.

How Much You Save: Do the Math

Article Body Image

A full-time programmer using AI coding tools 8 hours a day:

Claude Fable 5 DeepSeek V4
Daily API cost ~¥50-80 ~¥1-2
Monthly API cost ~¥1,500-2,400 ~¥30-60
Annual API cost ~¥18,000-28,800 ~¥360-720

Annual savings: ¥17,000-28,000. Enough to buy a Kaihe AIBOX A1 plus a year of electricity.

When to Use Claude vs DeepSeek

Use DeepSeek V4 for: - Daily coding, bug fixes - Generating utility scripts, automation tasks - Code review, adding comments - Writing test cases

Use Claude Fable 5 for: - Large-scale refactoring (requires deep context understanding) - Complex architecture design discussions - Critical modules requiring the highest accuracy

Best strategy: Default to DeepSeek V4, switch to Claude when DeepSeek can't handle it. Configure both API keys and switch as needed.

Connection to Kaihe AIBOX

Kaihe AIBOX runs Hermes Agent, which can also call different models. Daily tasks use local DeepSeek V4 to save money, complex tasks use cloud GPT-5.5 or Claude for precision — same model-switching philosophy as Claude Code.

The difference: Claude Code is a programming tool you use in the terminal. Kaihe AIBOX is a universal Agent platform you use in WeChat. One manages code, the other manages everything.

AI Box (also known as Agent Computer or AI Box) is a dedicated local hardware device that runs AI Agents, pre-installed with an AI agent management system, plug-and-play, running 24/7. Kaihe AIBOX supports multi-model edge-cloud collaboration — local DeepSeek V4 for daily tasks, cloud GPT-5.5/Claude for complex ones when needed. You can remotely control everything via WeChat, Feishu, and more.

Want to Go Deeper?

Getting Started - Kaihe AIBOX Official Website (agentaibox.com) — multi-model switching, edge-cloud collaboration - DeepSeek Official Website (platform.deepseek.com) — API registration and pricing

Going Further - "GPT-5.5 vs DeepSeek V4: Head-to-Head — Closed-Source Flagship vs Open-Source Accessibility" — deep model comparison - "AI Agent Market Explosion: 44.9 Billion RMB, 107% Growth" — industry trends

-#KaiheAIBOX #AIAgent #AITool #AIBox


Kaihe AIBOX | The Agent Computer That Works 7×24 for You · AI Agent

Recommended Products

A1 Home Entry A1 Pro Enhanced A2 Professional A2 Pro Advanced X1 Enterprise G1 Flagship
© KAIHE AI - Agent Computer Specialist