<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hoàng Văn Anh Nghĩa</title>
    <description>The latest articles on DEV Community by Hoàng Văn Anh Nghĩa (@nghyane).</description>
    <link>https://dev.to/nghyane</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3776680%2F1ef7d09e-36ef-4c6a-9a8a-c9fe1e8e2088.jpeg</url>
      <title>DEV Community: Hoàng Văn Anh Nghĩa</title>
      <link>https://dev.to/nghyane</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nghyane"/>
    <language>en</language>
    <item>
      <title>How I use AmpCode for free</title>
      <dc:creator>Hoàng Văn Anh Nghĩa</dc:creator>
      <pubDate>Tue, 17 Feb 2026 02:29:04 +0000</pubDate>
      <link>https://dev.to/nghyane/how-i-use-ampcode-for-free-2m3</link>
      <guid>https://dev.to/nghyane/how-i-use-ampcode-for-free-2m3</guid>
      <description>&lt;h2&gt;
  
  
  How I Use AmpCode for Free
&lt;/h2&gt;

&lt;p&gt;I like &lt;a href="https://ampcode.com" rel="noopener noreferrer"&gt;AmpCode&lt;/a&gt;. It works both in the terminal and as a VS Code extension, and it gets out of my way. But the credit system adds up — especially when you're running long coding sessions with Claude Opus or GPT-5.&lt;/p&gt;

&lt;p&gt;Then I realized something: I already have Claude Code, OpenAI Codex CLI, and Gemini CLI — all free, all with generous API quotas through OAuth. AmpCode is just calling the same models through the same APIs.&lt;/p&gt;

&lt;p&gt;So I built a proxy that sits between AmpCode and the AI providers, swapping AmpCode's paid credentials for my existing free ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AmpCode → ampcode-connector (localhost) → Claude Code OAuth   (free)
                                        → OpenAI Codex OAuth  (free)
                                        → Gemini CLI OAuth    (free)
                                        → AmpCode upstream    (paid, last resort)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When AmpCode asks for Claude Sonnet, the proxy intercepts the request and forwards it to &lt;code&gt;api.anthropic.com&lt;/code&gt; using the OAuth token from my Claude Code subscription. Same model, same response — zero credits spent.&lt;/p&gt;

&lt;p&gt;If no local provider is available, the request falls through to AmpCode's servers as normal. You never lose access, you just stop paying for what you already have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup takes 30 seconds
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bunx ampcode-connector setup    &lt;span class="c"&gt;# points AmpCode at the proxy&lt;/span&gt;
bunx ampcode-connector login    &lt;span class="c"&gt;# opens browser for OAuth&lt;/span&gt;
bunx ampcode-connector          &lt;span class="c"&gt;# start&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;setup&lt;/code&gt; rewrites your AmpCode config to route through &lt;code&gt;localhost:7860&lt;/code&gt;. &lt;code&gt;login&lt;/code&gt; opens a browser-based OAuth flow for each provider — the same flow you'd use to log into Claude Code or Codex CLI normally. No API keys to copy-paste.&lt;/p&gt;

&lt;h2&gt;
  
  
  What providers are supported?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Models you get&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;Opus 4, Sonnet 4, Haiku&lt;/td&gt;
&lt;td&gt;Anthropic OAuth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI Codex CLI&lt;/td&gt;
&lt;td&gt;GPT-5, o3&lt;/td&gt;
&lt;td&gt;OpenAI OAuth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini CLI&lt;/td&gt;
&lt;td&gt;Gemini Pro, Flash&lt;/td&gt;
&lt;td&gt;Google OAuth&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each provider uses standard PKCE OAuth — the same auth flow that Claude Code and Codex CLI use internally.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing is smarter than you'd think
&lt;/h2&gt;

&lt;p&gt;A simple proxy would just forward requests. ampcode-connector does more:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thread affinity.&lt;/strong&gt; Once a thread starts on a specific account, it stays there. This avoids context confusion when you have multiple accounts logged in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Least-connections balancing.&lt;/strong&gt; New threads go to the account with the fewest active threads. If you log in with 3 Google accounts, they get used evenly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rate limit handling.&lt;/strong&gt; When a provider returns 429, the proxy automatically retries with a different account or quota pool. The failed account goes on cooldown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google cascade.&lt;/strong&gt; Google gives you two separate quota pools — Gemini CLI and Antigravity (Vertex AI). The proxy tries both before giving up, effectively doubling your free tier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request in → local OAuth available?
  yes → forward to provider API (free)
    429? → retry different account/pool
    401? → fall through
  no → forward to ampcode.com (paid)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Multi-account stacking
&lt;/h2&gt;

&lt;p&gt;This is the part I like most. You can log in multiple times per provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bunx ampcode-connector login google    &lt;span class="c"&gt;# account 1&lt;/span&gt;
bunx ampcode-connector login google    &lt;span class="c"&gt;# account 2&lt;/span&gt;
bunx ampcode-connector login google    &lt;span class="c"&gt;# account 3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each account has its own rate limit quota. Three Google accounts = 3x the free tier. The proxy balances across all of them automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't touch
&lt;/h2&gt;

&lt;p&gt;The proxy only intercepts AI model requests (&lt;code&gt;/api/provider/...&lt;/code&gt;). Everything else — authentication, threads, telemetry, settings — passes through to &lt;code&gt;ampcode.com&lt;/code&gt; untouched. AmpCode doesn't know the proxy exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is this allowed?
&lt;/h2&gt;

&lt;p&gt;You're using your own subscriptions to call APIs you already have access to. The proxy doesn't bypass any paywalls or share credentials. It just routes your AmpCode requests through OAuth tokens that belong to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bunx ampcode-connector setup
bunx ampcode-connector login
bunx ampcode-connector
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source: &lt;a href="https://github.com/nghyane/ampcode-connector" rel="noopener noreferrer"&gt;github.com/nghyane/ampcode-connector&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you're using AmpCode and already have Claude Code, Codex CLI, or Gemini CLI — you're paying twice for the same models. This fixes that.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
