<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dev Tools | Attack on Life</title><link>https://en.1991421.cn/tag/dev-tools/</link><atom:link href="https://en.1991421.cn/tag/dev-tools/index.xml" rel="self" type="application/rss+xml"/><description>Dev Tools</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-US</language><lastBuildDate>Fri, 22 Aug 2025 21:13:36 +0800</lastBuildDate><image><url>https://en.1991421.cn/media/sharing.png</url><title>Dev Tools</title><link>https://en.1991421.cn/tag/dev-tools/</link></image><item><title>Claude Code Is Expensive? Try Connecting to DeepSeek</title><link>https://en.1991421.cn/2025/08/22/claudecode-deepseek/</link><pubDate>Fri, 22 Aug 2025 21:13:36 +0800</pubDate><guid>https://en.1991421.cn/2025/08/22/claudecode-deepseek/</guid><description>&lt;blockquote>
&lt;p>I subscribe to Claude Pro, but the quota is limited and often runs out. Yesterday DeepSeek released v3.1 and also provided a ClaudeCode-compatible API. Today I tried connecting Claude Code to DeepSeek. If you have network issues or insufficient quota for ClaudeCode, you can try DS.
I think it is pretty good, so I am noting the steps here.&lt;/p>
&lt;/blockquote>
&lt;h2 id="shell-configuration">
&lt;a class="heading-anchor-link" href="#shell-configuration">Shell configuration&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="shell-configuration"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>Open &lt;code>~/.zshrc&lt;/code> or &lt;code>~/.bashrc&lt;/code> and add the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">ANTHROPIC_BASE_URL&lt;/span>&lt;span class="o">=&lt;/span>https://api.deepseek.com/anthropic
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">ANTHROPIC_AUTH_TOKEN&lt;/span>&lt;span class="o">=&lt;/span>sk-
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">ANTHROPIC_MODEL&lt;/span>&lt;span class="o">=&lt;/span>deepseek-chat
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">export&lt;/span> &lt;span class="nv">ANTHROPIC_SMALL_FAST_MODEL&lt;/span>&lt;span class="o">=&lt;/span>deepseek-chat
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For &lt;code>ANTHROPIC_AUTH_TOKEN&lt;/code>, get it at &lt;a href="https://platform.deepseek.com/api_keys" target="_blank" rel="noopener">https://platform.deepseek.com/api_keys&lt;/a>.&lt;/p>
&lt;p>&lt;figure class="image-figure">
&lt;img
src="https://static.1991421.cn/2025/2025-08-22_21-29-38.jpg"
alt="api key"
loading="lazy"
decoding="async"
class="rounded-lg"
/>
&lt;/figure>&lt;/p>
&lt;p>After configuring, restart your terminal session or run &lt;code>source ~/.zshrc&lt;/code> or &lt;code>source ~/.bashrc&lt;/code> to apply the changes.&lt;/p>
&lt;h2 id="launch-claude-code">
&lt;a class="heading-anchor-link" href="#launch-claude-code">Launch Claude Code&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="launch-claude-code"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>Type &lt;code>claude&lt;/code> in the terminal. If the proxy is configured correctly, you will see the proxied service URL in the output.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">│ • API Base URL: │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ https://api.deepseek.com/anthropic
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;figure class="image-figure">
&lt;img
src="https://static.1991421.cn/2025/2025-08-22_21-32-16.jpg"
alt="api key"
loading="lazy"
decoding="async"
class="rounded-lg"
/>
&lt;/figure>&lt;/p>
&lt;p>Now you can use the DeepSeek version of ClaudeCode. The experience is basically the same as Claude, since only the model is changed.&lt;/p>
&lt;h2 id="flexible-switching-between-deepseek-and-claude">
&lt;a class="heading-anchor-link" href="#flexible-switching-between-deepseek-and-claude">Flexible switching between DeepSeek and Claude&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="flexible-switching-between-deepseek-and-claude"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>With the method above, you can only use DeepSeek models. If you want to switch back to Claude, you would have to comment out the environment variables and restart the terminal. That is too annoying, so here is a more flexible approach.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">alias claudeds=&amp;#34;claude --settings &amp;#39;{\&amp;#34;env\&amp;#34;:{\&amp;#34;ANTHROPIC_BASE_URL\&amp;#34;:\&amp;#34;https://api.deepseek.com/anthropic\&amp;#34;,\&amp;#34;ANTHROPIC_AUTH_TOKEN\&amp;#34;:\&amp;#34;sk-\&amp;#34;,\&amp;#34;ANTHROPIC_MODEL\&amp;#34;:\&amp;#34;deepseek-chat\&amp;#34;,\&amp;#34;ANTHROPIC_SMALL_FAST_MODEL\&amp;#34;:\&amp;#34;deepseek-chat\&amp;#34;}}&amp;#39;&amp;#34;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After setting this alias, in any terminal session, use &lt;code>claudeds&lt;/code> for DeepSeek and &lt;code>claude&lt;/code> for Claude. No need to toggle environment variables.&lt;/p>
&lt;p>Note: settings passed via command line have the highest priority, but they still merge with config files in the current directory and in the user home directory.&lt;/p>
&lt;h2 id="current-ds-issues">
&lt;a class="heading-anchor-link" href="#current-ds-issues">Current DS issues&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="current-ds-issues"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>After using it, I think DS is still a bit behind.&lt;/p>
&lt;ol>
&lt;li>Request speed is slower than Claude, but acceptable.&lt;/li>
&lt;li>AI understanding is weaker. For example, if you ask it to translate a Markdown article without modifying certain meta fields, it still changes them. Code generation is also not as good as Claude. But it is cheaper, so for general scenarios it is fine.&lt;/li>
&lt;/ol>
&lt;h2 id="pricing-note">
&lt;a class="heading-anchor-link" href="#pricing-note">Pricing note&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="pricing-note"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>DeepSeek API gives some free credit at registration. If it runs out, you need to top up. DS is cheaper than Claude, so costs are lower. Still, keep an eye on it because Claude Code consumes tokens.&lt;/p>
&lt;p>I used DS for one hour to translate an article and spent a bit over 3 RMB. Not bad.&lt;/p>
&lt;h2 id="final-thoughts">
&lt;a class="heading-anchor-link" href="#final-thoughts">Final Thoughts&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="final-thoughts"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>I think it is great that DS provides a compatible API. It saves the effort of building a separate CLI and gives users a cheaper way to use ClaudeCode. Although DS is still slower and weaker in code quality than Claude, it is good enough for general usage. If you have not tried it, give it a shot.&lt;/p></description></item></channel></rss>