WayToClawEarn
入门阅读约 10 分钟2026年4月28日

DeepSeek V4 vs Claude Code: 90% Cheaper, Same Quality

如果你在找「Claude Code 便宜替代」,结论:保留 Claude Code 界面,把推理后端切到 DeepSeek V4,API 费用可降 90% 以上;按本文 10 分钟完成配置。

入门 · 10 分钟 · 2026年4月28日

10 Claude Code DeepSeek V4 ——API 90%+

  • Claude Code DeepSeek V4 Flash 1 / token
  • Claude Code
  • API

  • Claude Code macOS / Linux
  • DeepSeek 10

DeepSeek Claude Code

Claude Code AI Anthropic API ——Claude Sonnet 15 / tokenOpus DeepSeek V4 API Anthropic 5%-10% Claude Sonnet

Claude Code

Anthropic APIDeepSeek V4
token15 Sonnet1 Flash
token75 Sonnet4 Flash
CLI

1 DeepSeek API

DeepSeek 10

API KeysCreate API key sk- Claude Code DeepSeek


2

terminal
mkdir -p ~/.config/mg-deepseek && chmod 700 ~/.config/mg-deepseek

sk-your-key-here

terminal
echo 'export DEEPSEEK_API_KEY="sk-your-key-here"' > ~/.config/mg-deepseek/key.env
chmod 600 ~/.config/mg-deepseek/key.env
source ~/.config/mg-deepseek/key.env

700 600 API

3 Claude Code

Claude Code OAuth Vertex AIAWS Bedrock DeepSeek

terminal
cat > ~/.config/mg-deepseek/claude-deepseek-settings.json <<EOF
{
 "env": {
 "CLAUDE_CODE_USE_VERTEX": "",
 "ANTHROPIC_VERTEX_PROJECT_ID": "",
 "CLOUD_ML_REGION": "",
 "ANTHROPIC_DEFAULT_OPUS_MODEL": "",
 "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
 "ANTHROPIC_AUTH_TOKEN": "$DEEPSEEK_API_KEY",
 "ANTHROPIC_API_KEY": "$DEEPSEEK_API_KEY"
 }
}
EOF
chmod 600 ~/.config/mg-deepseek/claude-deepseek-settings.json

JSON

  1. ** 4 ** Vertex AI AWS Bedrock
  2. ANTHROPIC_BASE_URL API DeepSeek Anthropic https://api.deepseek.com/anthropic
  3. ANTHROPIC_AUTH_TOKEN / ANTHROPIC_API_KEY

DeepSeek Anthropic API JSON Claude Code

4 Claude Code — DeepSeek

Claude Code DeepSeek

terminal
claude --bare \
 --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
 --model sonnet \
 " Python JWT REST API"
  • --bare Claude Code OAuth settings ——
  • --settings JSON
  • **--model sonnet**Claude Code Anthropic DeepSeek sonnet→DeepSeek V4 Flash

Claude Code / /help``/bug``/review Claude Code

--bareOAuth/
--settingsDeepSeek JSON
--model sonnetDeepSeek V4 Flash

**** DeepSeek V4 Pro DeepSeek API Claude Code Flash

5

API DeepSeek

terminal
claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
 --debug-file /tmp/check.log --model sonnet "SWAP_TEST"

grep "API REQUEST" /tmp/check.log | head -1

/anthropic/v1/messages DeepSeek /v1/projects/.../publishers/anthropic/ Vertex AI—— settings JSON 4 bedrock-runtime AWS Bedrock——

URL
/anthropic/v1/messages✅ DeepSeek V4
/v1/projects/.../publishers/anthropic/❌ Vertex AIJSON 4
bedrock-runtime❌ AWS BedrockJSON 4

6

** 1 — Claude CodeAnthropic / Vertex / Bedrock**

terminal
claude --model opus ""

** 2 — DeepSeek **

terminal
claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
 --model sonnet " async/await "

Claude Code settings

shell

terminal

# ~/.zshrc ~/.bashrc
alias claude-cheap='claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json --model sonnet'
  • claude-cheap "" → DeepSeek V4 Flash 1 / token
  • claude "" → Opus Sonnet

shell

Q1auth conflict

Claude Code OAuth --bare

Q2 Anthropic

--debug-file

terminal
claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
 --debug-file /tmp/check.log --model sonnet "test"
grep "API REQUEST" /tmp/check.log

URL deepseek.com JSON shell

Q3 ANTHROPIC_BASE_URL `.zshrc

Claude Code Vertex/Bedrock --bare --settings

Q4 --model sonnet `--model opus

Claude Code Anthropic DeepSeek sonnet → DeepSeek V4 Flashopus → DeepSeek V4 Pro deepseek-v4 Claude Code

Claude Code``DeepSeek``Anthropic``Vertex AI``AWS Bedrock``OpenAI

Claude Code

免责声明:本站案例均为知识分享内容,仅供灵感与参考,不构成收益承诺;由此进行的外部执行与结果请自行判断并承担相应责任。

相关推荐