Ultimate cost-saving guide: Routing Claude Code via DeepSeek API

Unlikely_Bluejay5392 · reddit · 2026-08-26

A detailed guide on routing Claude Code's architecture to the DeepSeek API for cost-effective coding agents. By modifying .claude/setting., users can force the use of DeepSeek models.

The Setup

{

"env": {

"ANTHROPICBASEURL": "https://api.deepseek.com/anthropic",

"ANTHROPICAUTHTOKEN": "yourdeepseektokenhere",

"ANTHROPICMODEL": "deepseek-v4-pro"

}

}

The Math

Leveraging DeepSeek's Prompt Caching, a session processing 20.6M tokens achieved 97.6% cache efficiency, costing only $1.58.

Golden Rules

Original post →

More from coding & agent

coding & agent channel →