Research · Claude Code + DeepSeek

Claude Code with DeepSeek. Same terminal loop, three backends.

Point Claude Code's base URL at DeepSeek V4.1 Flash for a 1M window. Then compare cache cost, privacy, and refusals.

01

Quick setup

Three env vars swap the backend. On Nodecode, the last two set the 1M window and keep auto-mode checks client-side.

Nodecode Cyber v1
export ANTHROPIC_BASE_URL=https://api.nodecode.ai
export ANTHROPIC_AUTH_TOKEN=sk-nc-...
export ANTHROPIC_MODEL=nodecode-cyber-v1
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576
export CLAUDE_CODE_AUTO_MODE_SERVER=0
claude

Omit /v1 from the base URL. Subagent names alias automatically - see Cyber v1 quickstart for settings.json.

DeepSeek direct
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=sk-...
export ANTHROPIC_MODEL=deepseek-flash
export ANTHROPIC_SMALL_FAST_MODEL=deepseek-flash
claude

Pin deepseek-flash or DeepSeek silently routes Opus calls to V4 Pro (4.2x the bill). DeepSeek's guide sets 9 vars.

Capture 1 · Local RCE PoC + patch

17s11s
Live Claude Code session running nodecode-cyber-v1: audits diag.py, writes and runs a command-injection RCE PoC extracting a local lab flag, patches shell=True, and re-runs the PoC to confirm it fails.
Stock Claude Code on Cyber v1: exploits command injection in a local lab, patches to argv, and re-verifies in 1711s with zero refusals.

02

One CLI, swap the brain

Claude Code keeps every local tool, diff, and MCP server untouched. One env var swaps cost, data handling, and refusals.

Plate 1 · How it works

Same terminal loop, one setting swaps the model

BASE URL

Anthropic · The default

Base URL
api.anthropic.com
Model
Claude Opus 5.5
Run by
Anthropic, USA
Says no
Trained in
This session
$3.44
BASE URL

DeepSeek direct

Base URL
api.deepseek.com/anthropic
Model
DeepSeek V4.1 Flash
Run by
DeepSeek, Hangzhou, China
Says no
92 of 100 risky asks
This session
$0.18
BASE URL

Cyber v1 · Nodecode

Base URL
api.nodecode.ai
Model
DeepSeek V4.1 Flash, refusal removed
Run by
Foresight Labs, Netherlands (EU), memory only
Says no
1 of 100 risky asks
This session
$0.21
Claude Code runs locally and asks a model what to do at every step. Setting ANTHROPIC_BASE_URL keeps the CLI, tools, and repo identical while swapping cost, data handling, and refusal behavior.

03

Why a Claude Code session is mostly cache

Coding agents resend the full conversation on every turn. In one real 14-minute, 45-request Claude Code session of ours (usage counters only), 96.5% of 4.87M input tokens came from prompt cache - so cache read rate decides your bill.

Plate 2 · Where the tokens go

  • Read from cache
  • New this request
  • Written by the model
  • 1 cell = 2,000 tokens1 cell = 6,000 tokens
25.7K sent188K sentRequest 1Request 4525.7K sent188K sentRequest 1Request 45
4.87M tokens sent, 96.5% read from cache. The model wrote 82 thousand tokens across 45 turns (usage counters only, zero prompt content). That is why cache read rate decides most of the bill.

04

Same session, five bills

That exact 45-request session at 4 Dec 2026 list prices: Cyber v1 is 16.6x below Opus 5.5 and 8.2x below Sonnet 5.5.

Plate 3 · What it costs

  • Read from cache
  • New input
  • Written by the model
  • 1 cell = 4 cents1 cell = 10 cents
Claude Opus 5.5Anthropic$3.44Claude Sonnet 5.5Anthropic$1.72DeepSeek V4 ProDeepSeek direct$0.76DeepSeek V4.1 FlashDeepSeek direct$0.18Cyber v1Nodecode$0.21Claude Opus 5.5Anthropic$3.44Claude Sonnet 5.5Anthropic$1.72DeepSeek V4 ProDeepSeek direct$0.76DeepSeek V4.1 FlashDeepSeek direct$0.18Cyber v1Nodecode$0.21
Weekday and peak list prices (4 Dec 2026). DeepSeek is half price off-peak, Cyber v1 half price Saturday and Sunday. Token counts are held fixed across backends; Claude 4.7+ counts roughly 30% more tokens for the same text per Anthropic.
Backend / ModelInput (miss)Cache writeCache readOutput45-req session
Claude Opus 5.5Anthropic pricing
Input (miss)$4.00
Cache write$5.00
Cache read$0.20
Output$20.00
45-req session$3.44
Claude Sonnet 5.5Anthropic pricing
Input (miss)$2.00
Cache write$2.50
Cache read$0.10
Output$10.00
45-req session$1.72
Input (miss)$1.32
Cache write$1.32
Cache read$0.044
Output$3.96
45-req session$0.76
DeepSeek V4.1 FlashDeepSeek pricing (peak)
Input (miss)$0.30
Cache write$0.30
Cache read$0.006
Output$1.20
45-req session$0.18 ($0.09 off-peak)
Input (miss)$0.33
Cache write$0.33
Cache read$0.009
Output$1.32
45-req session$0.21 ($0.10 Sat-Sun)

Fixed token counts across backends (Anthropic 5m cache write). Claude 4.7+ counts ~30% more tokens for the same text per Anthropic; Cyber v1 bills cached reads above 262k at 4x (session peaked at 188k) and runs half-price Sat-Sun.

05

What $0.03 buys over DeepSeek direct

DeepSeek Flash direct ($0.18 peak) is three cents cheaper than Cyber v1 ($0.21 weekday). That spread buys two things DeepSeek direct cannot offer:

EU operator + memory-only ZDR
DeepSeek's Terms and Privacy Policy sit under PRC law with no self-serve ZDR. Cyber v1 is operated by Foresight Labs (Netherlands, EU) with memory-only ZDR: prompts stay in RAM, prefix cache expires idle in 30 minutes, nothing touches disk.
Zero security refusals
Base DeepSeek refuses 92 of 100 security prompts. Our abliterated checkpoint refuses 1 of 100 (0.136 KL across 38 tables, 99.7% untouched), so AppSec and red-team loops finish without mid-run walls.

Capture 2 · Red-team prompt, zero disclaimers

23s25s
Live Claude Code session running nodecode-cyber-v1 on an authorized RFC1918 lab red-team task: writes a Nuclei command-injection detection template and returns three Linux privilege-escalation recon one-liners with zero refusals or disclaimers.
Abliterated weights in Claude Code: writes nuclei-rce.yaml (marker 424242 + 7 -> 424249) and 3 Linux privesc recon one-liners for an RFC1918 lab in 2325s, zero lecturing.

06

When to pick each backend

WorkloadBackendWhy
WorkloadHardest refactors, max reasoning
BackendAnthropic Opus 5.5 / Sonnet 5.5
WhyHighest ceiling when token budget does not matter.
WorkloadPublic hobby repos, lowest raw rate
BackendDeepSeek direct (deepseek-flash)
Why$0.03 cheaper per 45-turn run if PRC terms and logging are fine.
WorkloadPrivate repos, EU/GDPR, authorized security & pentest
BackendNodecode Cyber v1
WhyDutch/EU memory-only ZDR, 1/100 refusals, 64 seats, card or crypto from $5, no KYC.

Keep default claude untouched with a shell alias, or skip env vars with Nodecode Agent.

Shell alias
alias claude-cyber='\
  ANTHROPIC_BASE_URL=https://api.nodecode.ai \
  ANTHROPIC_AUTH_TOKEN=$NODECODE_API_KEY \
  ANTHROPIC_MODEL=nodecode-cyber-v1 \
  CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576 \
  CLAUDE_CODE_AUTO_MODE_SERVER=0 claude'

07

Questions

Yes. Set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL. On Nodecode, also set CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048576 and CLAUDE_CODE_AUTO_MODE_SERVER=0.

Claude Code appends /v1/messages automatically. Adding /v1 sends requests to /v1/v1/messages (404). Keep /anthropic on DeepSeek direct.

Without ANTHROPIC_MODEL=deepseek-flash, DeepSeek maps Claude Code's default claude-opus-* to deepseek-v4-pro ($0.76 vs $0.18 on our 45-turn run).

DeepSeek's Terms and Privacy Policy sit under mainland PRC law with retention for compliance and safety, and no self-serve ZDR. Cyber v1 is operated by Foresight Labs (Netherlands, EU) with memory-only ZDR.

No. Pay-as-you-go from $5 via card, PayPal, Pix, or crypto (BTC, XMR, USDC, no KYC) with 64 concurrent seats.