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.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
How to Connect Claude Code to DeepSeek‑V3.1 for AI‑Powered Coding

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-router

Configuration

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 code

The UI can be launched with ccr ui and the service restarted with ccr restart.

Claude Code UI
Claude Code UI

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 .
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI CodingDeepSeekRouter configurationinstallation guidemodel integrationClaude Code
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.