<?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: mazhic87</title>
    <description>The latest articles on DEV Community by mazhic87 (@mazhic87).</description>
    <link>https://dev.to/mazhic87</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271868%2F6e2399b6-9026-4469-b17c-b1e6d8efc3de.png</url>
      <title>DEV Community: mazhic87</title>
      <link>https://dev.to/mazhic87</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mazhic87"/>
    <language>en</language>
    <item>
      <title>Use Claude Code, Cursor &amp; Cline Without a Credit Card: Local HTTP x402 USDC Proxy (Open Source)</title>
      <dc:creator>mazhic87</dc:creator>
      <pubDate>Sun, 29 Nov 2026 07:30:30 +0000</pubDate>
      <link>https://dev.to/mazhic87/use-claude-code-cursor-cline-without-a-credit-card-local-http-x402-usdc-proxy-open-source-4je3</link>
      <guid>https://dev.to/mazhic87/use-claude-code-cursor-cline-without-a-credit-card-local-http-x402-usdc-proxy-open-source-4je3</guid>
      <description>&lt;p&gt;I built a small open-source local proxy (&lt;code&gt;x402-llm-proxy&lt;/code&gt;, MIT, single dependency on &lt;code&gt;viem&lt;/code&gt;) that bridges standard OpenAI (&lt;code&gt;/v1/chat/completions&lt;/code&gt;) and Anthropic (&lt;code&gt;/v1/messages&lt;/code&gt;) clients—like Claude Code, Cursor, Cline, and the Python/Node SDKs—to HTTP x402 pay-per-call LLM endpoints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Existing coding tools and SDKs cannot natively handle HTTP 402 challenges or sign EIP-3009 USDC payment headers. If you want pay-per-call frontier model access without a credit card or monthly subscription, you need a local shim that stays strictly on &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/mazhic87/x402-llm-proxy" rel="noopener noreferrer"&gt;https://github.com/mazhic87/x402-llm-proxy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/x402-llm-proxy" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/x402-llm-proxy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Default upstream gateway &amp;amp; pricing (disclosure: I operate this Cloudflare Workers gateway): &lt;a href="https://sage-x402-tools.sage-ibis.workers.dev" rel="noopener noreferrer"&gt;https://sage-x402-tools.sage-ibis.workers.dev&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Free dry-run connectivity &amp;amp; 402 quote check ($0 spent):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx x402-llm-proxy --test
npx x402-llm-proxy --models
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mode A — Pay-per-call with Base USDC (HTTP x402 v2, 0 ETH gas, no account):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;BASE_PRIVATE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x... npx x402-llm-proxy --max-call-usd 0.05 --max-session-usd 2.00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The private key never leaves &lt;code&gt;127.0.0.1&lt;/code&gt;. On an HTTP 402 response, the proxy checks the quoted amount against &lt;code&gt;--max-call-usd&lt;/code&gt; and &lt;code&gt;--max-session-usd&lt;/code&gt;, signs a single EIP-3009 &lt;code&gt;TransferWithAuthorization&lt;/code&gt; payload locally, and retries with the &lt;code&gt;PAYMENT-SIGNATURE&lt;/code&gt; header.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mode B — Prepaid API key (Base or Solana USDC, native streaming + full tool use):&lt;/strong&gt;
If you prefer not to put a hot wallet key in an env var, you can fund a prepaid key (&lt;code&gt;$0.10&lt;/code&gt; min via 0-gas browser wallet or direct Base/Solana USDC transfer) at &lt;a href="https://sage-x402-tools.sage-ibis.workers.dev/topup:" rel="noopener noreferrer"&gt;https://sage-x402-tools.sage-ibis.workers.dev/topup:&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SAGE_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk-sage-... npx x402-llm-proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Point Claude Code / Cursor / SDK at localhost:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:4020 &lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;x402 claude
&lt;span class="c"&gt;# or OPENAI_BASE_URL=http://127.0.0.1:4020/v1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also pass &lt;code&gt;--upstream&lt;/code&gt; to point it at any other x402 v2 compatible gateway. Happy to hear feedback on the x402 v2 signing flow, SSE wrapping, or security defaults.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>x402</category>
      <category>claude</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
