DeepSeek V4 替代 Claude Code 贵价 API?10 分钟配置教程(费用降 90%+)
如果你在找「Claude Code 便宜替代」,结论:保留 Claude Code 界面,把推理后端切到 DeepSeek V4,API 费用可降 90% 以上;按本文 10 分钟完成配置。
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 API | DeepSeek V4 | |
|---|---|---|
| token | 15 Sonnet | 1 Flash |
| token | 75 Sonnet | 4 Flash |
| — | CLI | |
| — |
1 DeepSeek API
DeepSeek 10
API KeysCreate API key sk- Claude Code DeepSeek
2
mkdir -p ~/.config/mg-deepseek && chmod 700 ~/.config/mg-deepseeksk-your-key-here
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.env700 600 API
3 Claude Code
Claude Code OAuth Vertex AIAWS Bedrock DeepSeek
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.jsonJSON
- ** 4 ** Vertex AI AWS Bedrock
ANTHROPIC_BASE_URLAPI DeepSeek Anthropichttps://api.deepseek.com/anthropicANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEY
DeepSeek Anthropic API JSON Claude Code
4 Claude Code — DeepSeek
Claude Code DeepSeek
claude --bare \
--settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
--model sonnet \
" Python JWT REST API"--bareClaude Code OAuth settings ——--settingsJSON- **
--model sonnet**Claude Code Anthropic DeepSeeksonnet→DeepSeek V4 Flash
Claude Code / /help``/bug``/review Claude Code
--bare | OAuth/ | ✅ |
--settings | DeepSeek JSON | ✅ |
--model sonnet | DeepSeek V4 Flash | ✅ |
**** DeepSeek V4 Pro DeepSeek API Claude Code Flash
5
API DeepSeek
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 AI | JSON 4 |
bedrock-runtime | ❌ AWS Bedrock | JSON 4 |
6
** 1 — Claude CodeAnthropic / Vertex / Bedrock**
claude --model opus ""** 2 — DeepSeek **
claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
--model sonnet " async/await "Claude Code settings
shell
# ~/.zshrc ~/.bashrc
alias claude-cheap='claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json --model sonnet'claude-cheap ""→ DeepSeek V4 Flash 1 / tokenclaude ""→ Opus Sonnet
shell
Q1auth conflict
Claude Code OAuth --bare
Q2 Anthropic
--debug-file
claude --bare --settings ~/.config/mg-deepseek/claude-deepseek-settings.json \
--debug-file /tmp/check.log --model sonnet "test"
grep "API REQUEST" /tmp/check.logURL 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
相关推荐
How to Write .cursorrules: Cursor Prompt Engineering Guide (2026)
If Cursor's AI keeps generating code you have to fix every time, the problem is not the model: it is your rules file. A good .cursorrules can cut your edit-to-accept ratio from 3:1 to near 1:1. After eight months of iterating on Cursor rules across React, Python, and Go projects, this guide walks through what works, what breaks, and the templates I actually use.
Claude Code Pricing Guide: Plans, Credits, and Cost Optimization (2026)
I spend $80-150/month on Claude Code and use it 6-7 days a week. This guide breaks down exactly how Claude Code pricing works: per-token API billing, Anthropic credits, Max mode costs, the June 2026 billing change, and real monthly budgets from three developer profiles. I also share the six cost optimization techniques that cut my bill from $340 to $80 without reducing how much I ship.
主题中心
2026 AI 编程工具全景指南
从 Copilot 改版到 Claude Code / DeepSeek 低成本方案——把分散资讯收成可搜索、可对比的工具矩阵。
进入「2026 AI 编程工具全景指南」 →赚钱视角
这个趋势怎么赚钱?
WayToClawEarn 的差异在可验证的赚钱案例,而不只是资讯。从这些复盘开始:
浏览全部案例 →