How to Connect Claude Code to DeepSeek‑V3.1 for AI‑Powered Coding
This guide explains how to install Claude Code and the ClaudeCodeRouter, configure them to use DeepSeek‑V3.1 via the Anthropic API format, run the tool, and troubleshoot common connection and Windows environment issues.
Overview
DeepSeek released the DeepSeek‑V3.1 model, expanding the context window from 64 k to 128 k tokens and improving coding capabilities, inference speed, and agent functions. The model now supports the Anthropic API format, enabling easy integration with Claude Code.
Installation
Install the official Claude Code CLI and the open‑source ClaudeCodeRouter that proxies requests to other providers.
npm install -g @anthropic/ai/claude-code npm install -g @musistudio/claude-code-routerConfiguration
Configure ClaudeCodeRouter to point to a provider such as Qiniu’s AI inference service. Edit the file C:\Users\Administrator\.claude-code-router\config.json (Windows) with the following JSON (trimmed for brevity):
{
"Providers": [
{
"name": "qiniu",
"api_base_url": "https://openai.qiniu.com/v1/chat/completions",
"api_key": "YOUR_QINIU_API_KEY",
"models": [
"deepseek-v3.1",
"nvidia/llama-3.3-nemotron-super-49b-v1.5",
"gpt-oss-120b"
],
"transformer": {
"use": [],
"deepseek-v3.1": {
"use": [
["maxtoken", { "max_tokens": 8192 }]
]
}
}
}
],
"Router": {
"default": "qiniu,deepseek-v3.1",
"background": "qiniu,deepseek-v3.1",
"think": "qiniu,deepseek-v3.1",
"longContext": "qiniu,deepseek-v3.1",
"longContextThreshold": 60000,
"webSearch": "qiniu,deepseek-v3.1"
}
}Usage
From your project directory run:
cd my--webman-project
ccr codeThe UI can be launched with ccr ui and the service restarted with ccr restart.
Troubleshooting
Problem 1: Failed to connect to api.anthropic.com: ERR_BAD_REQUEST Solution: Enable proxy mode (e.g., TUN simulation).
Problem 2: Claude Code on Windows requires git‑bash. Solution: Install git‑bash and set the environment variable CLAUDE_CODE_GIT_BASH_PATH to the path of bash.exe , e.g., D:\Program Files\Git\bin\bash.exe .
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.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
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.
