<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>OpenRouter on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/openrouter/</link>
        <description>Recent content in OpenRouter on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Sun, 24 May 2026 09:52:55 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/openrouter/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Two Ways to Use DeepSeek Models with Codex: Local Gateway and OpenRouter BYOK</title>
        <link>https://knightli.com/en/2026/05/24/codex-deepseek-config-ccx-openrouter-byok/</link>
        <pubDate>Sun, 24 May 2026 09:52:55 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/24/codex-deepseek-config-ccx-openrouter-byok/</guid>
        <description>&lt;p&gt;If you want Codex to use DeepSeek, the first instinct is usually to edit &lt;code&gt;~/.codex/config.toml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek-chat&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;base_url&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://api.deepseek.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;That idea can work in some older versions or in regular OpenAI SDK scenarios. But with the current Codex CLI, it can easily run into a lower-level mismatch: custom model providers in Codex use the OpenAI Responses protocol, while DeepSeek&amp;rsquo;s official API is mainly exposed through an OpenAI-compatible Chat Completions interface.&lt;/p&gt;
&lt;p&gt;My local version is currently &lt;code&gt;codex-cli 0.111.0&lt;/code&gt;. &lt;code&gt;codex --help&lt;/code&gt; shows support for configuration entry points such as &lt;code&gt;--config&lt;/code&gt;, &lt;code&gt;--model&lt;/code&gt;, and &lt;code&gt;--profile&lt;/code&gt;. The official OpenAI Codex configuration reference is also explicit: &lt;code&gt;model_providers.&amp;lt;id&amp;gt;.wire_api&lt;/code&gt; currently supports only &lt;code&gt;responses&lt;/code&gt;, and defaults to &lt;code&gt;responses&lt;/code&gt; when omitted.&lt;/p&gt;
&lt;p&gt;DeepSeek&amp;rsquo;s official docs, meanwhile, show the call path as &lt;code&gt;https://api.deepseek.com/chat/completions&lt;/code&gt;, with examples such as &lt;code&gt;client.chat.completions.create(...)&lt;/code&gt;. So the issue is not that DeepSeek cannot be called through OpenAI-style tooling. The issue is that the request semantics Codex sends are not exactly the same as what DeepSeek&amp;rsquo;s native API understands.&lt;/p&gt;
&lt;p&gt;That is why changing &lt;code&gt;base_url&lt;/code&gt; directly to &lt;code&gt;https://api.deepseek.com&lt;/code&gt; may produce symptoms such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The request path does not match, resulting in a 404 or an unexpected response format.&lt;/li&gt;
&lt;li&gt;Multi-turn conversations, tool calls, or patch generation fail during parsing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tool_calls&lt;/code&gt; order, message structure, or streaming event format does not line up.&lt;/li&gt;
&lt;li&gt;The model seems able to answer a plain prompt, but starts failing once Codex does real work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The steadier approach is to put a translation layer between Codex and DeepSeek. There are two common routes.&lt;/p&gt;
&lt;h2 id=&#34;method-1-bridge-deepseek-through-a-local-gateway&#34;&gt;Method 1: Bridge DeepSeek Through a Local Gateway
&lt;/h2&gt;&lt;p&gt;A local gateway should do more than simple forwarding. Its job is to convert Responses-style requests from Codex into Chat Completions-style requests that DeepSeek can handle, then convert DeepSeek&amp;rsquo;s result back into a format Codex can consume.&lt;/p&gt;
&lt;p&gt;If you use a local gateway such as ccx, the configuration idea looks roughly like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;profiles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;deepseek-ccx&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek-v4-flash&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model_provider&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;ccx-bridge&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;model_providers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ccx-bridge&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Local CCX Gateway&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;base_url&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;http://localhost:3000/v1&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;env_key&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;DEEPSEEK_API_KEY&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Then set the DeepSeek key in your terminal and start Codex with that profile:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;DEEPSEEK_API_KEY&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;your-deepseek-key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;codex --profile deepseek-ccx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In PowerShell:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$env:DEEPSEEK_API_KEY&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;your-deepseek-key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;codex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;-profile&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;deepseek-ccx&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;There are two details to watch.&lt;/p&gt;
&lt;p&gt;First, &lt;code&gt;base_url&lt;/code&gt; should point to the gateway endpoint exposed to Codex, not the official DeepSeek address. The gateway calls DeepSeek behind the scenes.&lt;/p&gt;
&lt;p&gt;Second, the correct value for &lt;code&gt;env_key&lt;/code&gt; depends on how the gateway handles authentication. Some gateways read the official DeepSeek key directly. Others ask you to provide a local proxy key, while storing the DeepSeek key in the gateway backend. In that case, &lt;code&gt;env_key&lt;/code&gt; should be changed to whatever environment variable the gateway expects.&lt;/p&gt;
&lt;p&gt;This route is local and controllable, and it is easier to reason about latency and cost. The tradeoff is that you must confirm the gateway really supports the current Responses semantics used by Codex, rather than only acting as a basic Chat Completions proxy.&lt;/p&gt;
&lt;h2 id=&#34;method-2-use-openrouter-byok-as-an-online-bridge&#34;&gt;Method 2: Use OpenRouter BYOK as an Online Bridge
&lt;/h2&gt;&lt;p&gt;If you do not want to run a local gateway, OpenRouter BYOK is another option. BYOK means binding your own upstream provider key to OpenRouter, which then handles routing and forwarding.&lt;/p&gt;
&lt;p&gt;The most common mistake here is the environment variable. Codex is calling OpenRouter, so &lt;code&gt;env_key&lt;/code&gt; should usually be &lt;code&gt;OPENROUTER_API_KEY&lt;/code&gt;, not &lt;code&gt;DEEPSEEK_API_KEY&lt;/code&gt;. The DeepSeek key should be added in OpenRouter&amp;rsquo;s BYOK or provider key settings.&lt;/p&gt;
&lt;p&gt;Example configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;profiles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;deepseek-openrouter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek/deepseek-chat&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model_provider&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;openrouter&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;model_providers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;openrouter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;OpenRouter&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;base_url&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://openrouter.ai/api/v1&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;env_key&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;OPENROUTER_API_KEY&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Start it like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;OPENROUTER_API_KEY&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;your-openrouter-key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;codex --profile deepseek-openrouter
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;PowerShell:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$env:OPENROUTER_API_KEY&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;your-openrouter-key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;codex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;-profile&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;deepseek-openrouter&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Then add your DeepSeek provider key in the OpenRouter dashboard. OpenRouter&amp;rsquo;s BYOK documentation says provider keys are stored encrypted and used for routing to the corresponding provider.&lt;/p&gt;
&lt;p&gt;This route saves you from maintaining a local gateway and feels more like using a regular third-party API proxy. The downside is that an online service sits in the middle, so troubleshooting may require checking Codex, OpenRouter, and DeepSeek error messages together.&lt;/p&gt;
&lt;h2 id=&#34;should-you-keep-using-the-deepseek-chat-model-name&#34;&gt;Should You Keep Using the deepseek-chat Model Name?
&lt;/h2&gt;&lt;p&gt;In DeepSeek&amp;rsquo;s documentation as of May 2026, the recommended model names include &lt;code&gt;deepseek-v4-flash&lt;/code&gt; and &lt;code&gt;deepseek-v4-pro&lt;/code&gt;, with a note that compatibility aliases such as &lt;code&gt;deepseek-chat&lt;/code&gt; and &lt;code&gt;deepseek-reasoner&lt;/code&gt; will be deprecated after 2026-07-24.&lt;/p&gt;
&lt;p&gt;For new configurations, it is better to test:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek-v4-flash&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you are using OpenRouter, follow OpenRouter&amp;rsquo;s model naming format, for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek/deepseek-chat&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The actual available names depend on your gateway or OpenRouter&amp;rsquo;s model page. When the model name is wrong, errors usually look like &lt;code&gt;model not found&lt;/code&gt;, 404, or the provider failing to find the matching endpoint.&lt;/p&gt;
&lt;h2 id=&#34;why-directly-setting-deepseeks-official-base_url-is-not-recommended&#34;&gt;Why Directly Setting DeepSeek&amp;rsquo;s Official base_url Is Not Recommended
&lt;/h2&gt;&lt;p&gt;You can certainly try this as an experiment:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;profiles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;deepseek-direct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek-v4-flash&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;model_provider&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;model_providers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;deepseek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;DeepSeek&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;base_url&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;https://api.deepseek.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;env_key&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;DEEPSEEK_API_KEY&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;But this is more of a debugging experiment than a stable setup. Codex talks to custom providers through the Responses protocol, while DeepSeek&amp;rsquo;s official examples use &lt;code&gt;/chat/completions&lt;/code&gt;. If DeepSeek or Codex adds a full compatibility layer later, direct connection may become simple. Until then, a bridge layer is more reliable.&lt;/p&gt;
&lt;h2 id=&#34;what-if-codex-still-uses-openai-after-editing-the-config&#34;&gt;What If Codex Still Uses OpenAI After Editing the Config?
&lt;/h2&gt;&lt;p&gt;First, confirm the config file location. The global config should be:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;~/.codex/config.toml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The project-level &lt;code&gt;.codex/config.toml&lt;/code&gt; is not the right place for machine-level provider settings such as &lt;code&gt;model_provider&lt;/code&gt; and &lt;code&gt;model_providers&lt;/code&gt;. The official OpenAI docs also note that project-level configuration does not override local provider and authentication fields.&lt;/p&gt;
&lt;p&gt;If Codex still asks you to log in through the web, or appears to use the default OpenAI model, log out first:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;codex &lt;span class=&#34;nb&#34;&gt;logout&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Some older tutorials write this as &lt;code&gt;/logout&lt;/code&gt; inside the interactive UI. With the current CLI, running &lt;code&gt;codex logout&lt;/code&gt; directly in the terminal is the more reliable option.&lt;/p&gt;
&lt;p&gt;You can also run a quick check with a temporary profile:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;codex --profile deepseek-ccx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Or:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;codex -c &lt;span class=&#34;nv&#34;&gt;model_provider&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;ccx-bridge -c &lt;span class=&#34;nv&#34;&gt;model&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;deepseek-v4-flash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If that works, the config itself is readable. If it does not, check the profile name, TOML syntax, and whether the environment variable only exists in the current shell session.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting-checklist&#34;&gt;Troubleshooting Checklist
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;401&lt;/code&gt;: The key is wrong, or &lt;code&gt;env_key&lt;/code&gt; points to the wrong environment variable.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;404&lt;/code&gt;: &lt;code&gt;base_url&lt;/code&gt; or the model name is wrong, or a Responses request is being sent to an endpoint that only supports Chat Completions.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tool_calls&lt;/code&gt;, patch, or streaming parse errors: the protocol bridge is likely incomplete.&lt;/li&gt;
&lt;li&gt;Still prompted to log in to OpenAI: run &lt;code&gt;codex logout&lt;/code&gt;, then confirm you are using the correct profile.&lt;/li&gt;
&lt;li&gt;PowerShell environment variable disappears in a new window: &lt;code&gt;$env:...&lt;/code&gt; only applies to the current session. Use user environment variables if you need it to persist.&lt;/li&gt;
&lt;li&gt;OpenRouter BYOK is not using your own DeepSeek key: check whether the provider key is bound in OpenRouter, whether the current OpenRouter API key is allowed to use it, and whether fallback is enabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Using DeepSeek with Codex is not impossible through &lt;code&gt;config.toml&lt;/code&gt;. The catch is that changing only &lt;code&gt;base_url&lt;/code&gt; is usually not enough.&lt;/p&gt;
&lt;p&gt;The two steadier routes today are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use a local gateway as a protocol bridge: Codex talks to the local gateway, and the gateway talks to DeepSeek.&lt;/li&gt;
&lt;li&gt;Use OpenRouter BYOK as an online proxy: Codex talks to OpenRouter, while the DeepSeek key is bound in the OpenRouter dashboard.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you only want a quick test, OpenRouter is easier. If you want tighter control over keys, cost, and logs, a local gateway is better for long-term tinkering.&lt;/p&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://developers.openai.com/codex/config-reference/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;OpenAI Codex Configuration Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://api-docs.deepseek.com/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepSeek API Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://openrouter.ai/docs/use-cases/byok/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;OpenRouter BYOK Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>free-claude-code: Connecting Claude Code to OpenRouter, DeepSeek, and Local Models Through a Proxy</title>
        <link>https://knightli.com/en/2026/05/01/free-claude-code-anthropic-compatible-proxy/</link>
        <pubDate>Fri, 01 May 2026 03:41:49 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/01/free-claude-code-anthropic-compatible-proxy/</guid>
        <description>&lt;p&gt;&lt;code&gt;free-claude-code&lt;/code&gt; is an Anthropic-compatible proxy for &lt;code&gt;Claude Code&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Its idea is not to crack Claude Code, nor to provide an official free Claude service. Instead, it starts a local proxy service that looks like an Anthropic API, then forwards requests from Claude Code to other model backends. The README mentions backends such as NVIDIA NIM, OpenRouter, DeepSeek, LM Studio, llama.cpp, and Ollama.&lt;/p&gt;
&lt;p&gt;In simple terms, it solves this problem: you like the terminal experience of Claude Code, but want to send model requests to another provider or a local model.&lt;/p&gt;
&lt;h2 id=&#34;what-problem-it-solves&#34;&gt;What Problem It Solves
&lt;/h2&gt;&lt;p&gt;Claude Code has an interaction model that works well for development tasks.&lt;/p&gt;
&lt;p&gt;It can read code, edit files, run commands, and move tasks forward based on project context inside the terminal. But many users may not always want to use the same model backend:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They want to try different models on OpenRouter&lt;/li&gt;
&lt;li&gt;They want to use models such as DeepSeek to reduce cost&lt;/li&gt;
&lt;li&gt;They want to route requests to local Ollama&lt;/li&gt;
&lt;li&gt;They want to run local models through LM Studio or llama.cpp&lt;/li&gt;
&lt;li&gt;They want one proxy entry point in the development environment&lt;/li&gt;
&lt;li&gt;They want to compare different models inside the Claude Code workflow&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;free-claude-code&lt;/code&gt; is positioned as a compatibility layer between Claude Code and these model services.&lt;/p&gt;
&lt;p&gt;Claude Code still sends requests in an Anthropic-like style, while the proxy adapts those requests to different backends.&lt;/p&gt;
&lt;h2 id=&#34;how-it-works&#34;&gt;How It Works
&lt;/h2&gt;&lt;p&gt;You can think of it as three layers:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The frontend is Claude Code&lt;/li&gt;
&lt;li&gt;The middle layer is the &lt;code&gt;free-claude-code&lt;/code&gt; proxy&lt;/li&gt;
&lt;li&gt;The backend is OpenRouter, DeepSeek, a local model, or another model service&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Claude Code believes it is accessing an Anthropic-compatible API.&lt;/p&gt;
&lt;p&gt;After the proxy receives a request, it selects a target provider according to configuration, transforms the necessary fields, and returns the response to Claude Code.&lt;/p&gt;
&lt;p&gt;The benefit of this structure is that you do not need to modify Claude Code itself, and you do not need every model service to natively support Claude Code. As long as the proxy can align the interfaces, more models can be connected to the same workflow.&lt;/p&gt;
&lt;h2 id=&#34;supported-backends&#34;&gt;Supported Backends
&lt;/h2&gt;&lt;p&gt;The README lists these directions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NVIDIA NIM&lt;/li&gt;
&lt;li&gt;OpenRouter&lt;/li&gt;
&lt;li&gt;DeepSeek&lt;/li&gt;
&lt;li&gt;LM Studio&lt;/li&gt;
&lt;li&gt;llama.cpp&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These backends represent different usage styles.&lt;/p&gt;
&lt;p&gt;OpenRouter is more like a model aggregation entry point, useful for testing different commercial and open-source models.&lt;/p&gt;
&lt;p&gt;DeepSeek is suitable for people who care about Chinese ability, coding ability, and cost.&lt;/p&gt;
&lt;p&gt;LM Studio, llama.cpp, and Ollama are more local-model oriented. They are suitable for running models on your own machine or inside an intranet, reducing dependence on external APIs and making offline experiments easier.&lt;/p&gt;
&lt;p&gt;NVIDIA NIM is more oriented toward enterprise and GPU inference deployment scenarios.&lt;/p&gt;
&lt;h2 id=&#34;why-an-anthropic-compatible-proxy&#34;&gt;Why an Anthropic-Compatible Proxy
&lt;/h2&gt;&lt;p&gt;Claude Code was originally designed around Anthropic interfaces and model conventions.&lt;/p&gt;
&lt;p&gt;If you want to connect it to other models, the most direct problem is interface mismatch:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Request fields differ&lt;/li&gt;
&lt;li&gt;Model names differ&lt;/li&gt;
&lt;li&gt;Streaming formats differ&lt;/li&gt;
&lt;li&gt;Tool use is represented differently&lt;/li&gt;
&lt;li&gt;Error response formats differ&lt;/li&gt;
&lt;li&gt;Token and context limits differ&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is where the proxy layer is useful.&lt;/p&gt;
&lt;p&gt;It keeps the interface seen by Claude Code close to the Anthropic shape, then adapts to the backend. For users, after configuring the proxy once, they can test different models inside the same Claude Code workflow.&lt;/p&gt;
&lt;h2 id=&#34;suitable-scenarios&#34;&gt;Suitable Scenarios
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;free-claude-code&lt;/code&gt; is suitable for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using the Claude Code terminal workflow&lt;/li&gt;
&lt;li&gt;Testing non-Anthropic models in Claude Code&lt;/li&gt;
&lt;li&gt;Reducing model calling costs&lt;/li&gt;
&lt;li&gt;Connecting Claude Code to OpenRouter&lt;/li&gt;
&lt;li&gt;Connecting to compatible model services such as DeepSeek&lt;/li&gt;
&lt;li&gt;Running local models through Ollama, LM Studio, or llama.cpp&lt;/li&gt;
&lt;li&gt;Giving a team one unified model proxy entry point&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only use official Claude Code normally and have no special needs around providers, cost, or local deployment, you may not need this type of proxy.&lt;/p&gt;
&lt;p&gt;But if you often compare models, or want Claude Code to connect to local and third-party models, this type of tool is useful.&lt;/p&gt;
&lt;h2 id=&#34;difference-from-directly-using-openrouter-or-ollama&#34;&gt;Difference from Directly Using OpenRouter or Ollama
&lt;/h2&gt;&lt;p&gt;Using OpenRouter, Ollama, or LM Studio directly usually means chatting with a model or calling it through an API.&lt;/p&gt;
&lt;p&gt;The point of &lt;code&gt;free-claude-code&lt;/code&gt; is not to replace those services, but to connect them to the Claude Code development workflow.&lt;/p&gt;
&lt;p&gt;The difference is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You still use the Claude Code terminal experience&lt;/li&gt;
&lt;li&gt;AI can execute tasks around a code repository&lt;/li&gt;
&lt;li&gt;The model backend can be changed to another provider&lt;/li&gt;
&lt;li&gt;Local models can enter the Claude Code workflow&lt;/li&gt;
&lt;li&gt;Configuration is centralized in the proxy layer instead of changed in each tool&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So it is more like a bridge than a new chat client.&lt;/p&gt;
&lt;h2 id=&#34;notes-about-local-models&#34;&gt;Notes About Local Models
&lt;/h2&gt;&lt;p&gt;Connecting Claude Code to local models is attractive, but there are real limitations.&lt;/p&gt;
&lt;p&gt;First, model capability differs.&lt;/p&gt;
&lt;p&gt;Claude Code tasks are usually not just chat. They include understanding code, planning modifications, editing files, and handling command output. Smaller local models may not complete these tasks reliably.&lt;/p&gt;
&lt;p&gt;Second, context window matters.&lt;/p&gt;
&lt;p&gt;Code tasks need a lot of context. If the model context is too small, it may fail to read full files, miss constraints, or lose background across multi-turn tasks.&lt;/p&gt;
&lt;p&gt;Third, tool use compatibility matters.&lt;/p&gt;
&lt;p&gt;Claude Code workflows depend on tool calls and structured behavior. Even if a backend model can chat, it may not follow tool-use protocols well.&lt;/p&gt;
&lt;p&gt;Fourth, speed and hardware matter.&lt;/p&gt;
&lt;p&gt;Local model speed depends on machine configuration, quantization, and model size. If code tasks respond too slowly, the experience drops noticeably.&lt;/p&gt;
&lt;p&gt;So local models are better for experiments, low-risk tasks, and specific scenarios. For truly complex coding tasks, choose carefully according to model capability.&lt;/p&gt;
&lt;h2 id=&#34;usage-boundaries&#34;&gt;Usage Boundaries
&lt;/h2&gt;&lt;p&gt;Projects like this are easy to misunderstand from the title, so the boundaries should be clear.&lt;/p&gt;
&lt;p&gt;First, it is not an official free Claude Code quota.&lt;/p&gt;
&lt;p&gt;It only forwards Claude Code requests to other model backends. When using OpenRouter, DeepSeek, NVIDIA NIM, or other APIs, you still need to follow the pricing, quotas, and terms of the corresponding services.&lt;/p&gt;
&lt;p&gt;Second, it is not a tool for bypassing authorization.&lt;/p&gt;
&lt;p&gt;When using any proxy tool, you should follow the licenses and terms of Claude Code, model providers, and the project itself. Do not interpret it as a way to avoid official restrictions.&lt;/p&gt;
&lt;p&gt;Third, the proxy handles your request content.&lt;/p&gt;
&lt;p&gt;Code, command output, and project context may pass through the proxy and backend services. When deploying, consider logs, keys, network boundaries, and privacy. For company code or sensitive projects, use a controlled environment.&lt;/p&gt;
&lt;p&gt;Fourth, model performance varies greatly.&lt;/p&gt;
&lt;p&gt;The same Claude Code operation may behave very differently after switching models. Do not assume every model can replace Claude.&lt;/p&gt;
&lt;h2 id=&#34;relationship-with-proxies-such-as-litellm&#34;&gt;Relationship with Proxies Such as LiteLLM
&lt;/h2&gt;&lt;p&gt;Conceptually, &lt;code&gt;free-claude-code&lt;/code&gt; belongs to the category of compatible interface proxies.&lt;/p&gt;
&lt;p&gt;The shared goal of such tools is to reduce coupling between upper-level applications and lower-level model services. The upper-level application faces a relatively unified interface, while backend providers can be switched by configuration.&lt;/p&gt;
&lt;p&gt;Different projects focus on different areas. Some are general model gateways, some focus on OpenAI-compatible APIs, and some specifically adapt tools such as Claude Code.&lt;/p&gt;
&lt;p&gt;What makes &lt;code&gt;free-claude-code&lt;/code&gt; worth noting is that it puts Claude Code directly at the center, rather than building a generic chat proxy.&lt;/p&gt;
&lt;h2 id=&#34;suitable-users&#34;&gt;Suitable Users
&lt;/h2&gt;&lt;p&gt;It is better suited to users who are comfortable tinkering:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Familiar with Claude Code&lt;/li&gt;
&lt;li&gt;Know how to configure API keys and model providers&lt;/li&gt;
&lt;li&gt;Understand proxy service startup and environment variables&lt;/li&gt;
&lt;li&gt;Can troubleshoot network, port, model name, and streaming issues&lt;/li&gt;
&lt;li&gt;Want to compare different models on coding tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only want something that works out of the box, the official configuration is usually simpler.&lt;/p&gt;
&lt;p&gt;If you are willing to set up a proxy, switch models, tune parameters, and let Claude Code enter more model environments, this project is worth studying.&lt;/p&gt;
&lt;h2 id=&#34;reference&#34;&gt;Reference
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/Alishahryar1/free-claude-code&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Alishahryar1/free-claude-code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;final-thought&#34;&gt;Final Thought
&lt;/h2&gt;&lt;p&gt;The value of &lt;code&gt;free-claude-code&lt;/code&gt; is not in the word “free,” but in the bridge it builds between Claude Code and more model backends.&lt;/p&gt;
&lt;p&gt;When you want to keep the Claude Code development experience while testing OpenRouter, DeepSeek, local models, or enterprise inference services, an Anthropic-compatible proxy like this becomes useful.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
