Connect Claude Code to DeepSeek V4 in 5 Steps: From Installation to VSCode Integration
This guide walks through installing Claude Code, obtaining a DeepSeek V4 API key, configuring the CC Switch tool, verifying the model connection, and using the integrated model inside VSCode, while highlighting common pitfalls and cost considerations.
Install Claude Code
Run a single command because the official installer is blocked in China. curl -fsSL https://claude.ai/install.sh | bash Windows PowerShell: irm https://claude.ai/install.ps1 | iex After installation close and reopen the terminal so environment variables take effect. Running claude shows version information; an initial region‑check error can be ignored because it will be resolved later with CC Switch.
Obtain DeepSeek API Key
DeepSeek V4 Pro follows the Anthropic API protocol, allowing direct calls from Claude Code.
Generate an API key on the DeepSeek Open Platform and copy it immediately; it cannot be viewed again.
Configure model with CC Switch
CC Switch is a CLI tool for AI‑coding configuration management that automates provider switching.
Repository: https://github.com/farion1231/cc-switch Install the .msi (Windows) or .dmg (macOS) package, then open the application.
Add a new provider named “DeepSeek” with the following fields:
Provider : DeepSeek
API Key : the copied key
Base URL : https://api.deepseek.com/anthropic Model : model ID from DeepSeek documentation
Reference DeepSeek API documentation for valid model IDs and parameters.
Recommended CC Switch options (enable all):
Auto‑start on boot
Silent launch
Apply to Claude Code plugin
Skip Claude Code first‑run confirmation (resolves region‑check error)
Minimize to tray on close
Verify integration
Open a terminal and run claude. If the displayed model information shows DeepSeek, the connection is successful. Ask any question to confirm a response.
Use Claude Code in VSCode
Download VSCode from the official site.
Install two extensions:
Chinese (Simplified) – provides a Chinese UI; restart VSCode after installation.
Claude Code – adds a Claude icon to the top‑right corner.
Click the Claude icon; it displays the model configured in CC Switch, enabling code generation, bug fixing, and Q&A directly inside VSCode.
Common pitfalls
Running claude yields no response – restart the terminal.
Region‑check error – enable “Skip Claude Code first‑run confirmation” in CC Switch.
Lost API key – generate a new key and copy it immediately.
CC Switch change not taking effect – restart Claude Code.
Cost considerations
DeepSeek API is paid but cheaper than Claude’s native API; some providers offer free quotas for trial.
Related links
Claude Code docs: https://code.claude.com/docs/zh-CN/overview
DeepSeek platform: https://platform.deepseek.com/
CC Switch repo: https://github.com/farion1231/cc-switch
VSCode download: https://code.visualstudio.com/Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Tech Ocean
Focused on AI programming, sharing ready-to-use development efficiency solutions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
