<?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>Forem: ntriq-gh</title>
    <description>The latest articles on Forem by ntriq-gh (@ntriqgh).</description>
    <link>https://forem.com/ntriqgh</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%2F3866633%2F0cb29c65-2c42-4c66-ad18-6144c030d4bb.png</url>
      <title>Forem: ntriq-gh</title>
      <link>https://forem.com/ntriqgh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ntriqgh"/>
    <language>en</language>
    <item>
      <title>HTTP 402 + USDC: Pay-per-use AI APIs for Autonomous Agents</title>
      <dc:creator>ntriq-gh</dc:creator>
      <pubDate>Tue, 07 Apr 2026 23:02:13 +0000</pubDate>
      <link>https://forem.com/ntriqgh/http-402-usdc-pay-per-use-ai-apis-for-autonomous-agents-4g5d</link>
      <guid>https://forem.com/ntriqgh/http-402-usdc-pay-per-use-ai-apis-for-autonomous-agents-4g5d</guid>
      <description>&lt;h2&gt;
  
  
  The Problem with API Keys for AI Agents
&lt;/h2&gt;

&lt;p&gt;AI agents need to call external APIs autonomously. But traditional API key auth has a fundamental mismatch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Who manages the keys?&lt;/strong&gt; The agent can't sign up for accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How does billing work?&lt;/strong&gt; Subscription tiers don't fit pay-per-task usage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What about multi-agent systems?&lt;/strong&gt; Keys get shared, leaked, revoked&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's a better way: let agents pay directly, per request, with crypto.&lt;/p&gt;

&lt;h2&gt;
  
  
  x402: HTTP 402 as a Payment Protocol
&lt;/h2&gt;

&lt;p&gt;The HTTP 402 status code has been "reserved for future use" since 1991. &lt;a href="https://x402.org" rel="noopener noreferrer"&gt;x402&lt;/a&gt; finally uses it.&lt;/p&gt;

&lt;p&gt;The flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Agent → POST /document-intel
Server → 402 Payment Required
        { amount: "0.05", currency: "USDC", network: "eip155:8453" }
Agent → EIP-3009 signature (gasless transfer authorization)
Server → Facilitator validates → 200 OK + result
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No API keys. No subscriptions. No gas fees. The payment IS the authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  ntriq AgentShop: 6 Endpoints, $0.01–$0.05
&lt;/h2&gt;

&lt;p&gt;We built a document intelligence server on this protocol, running 100% local inference on a Mac Mini.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/document-intel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.05&lt;/td&gt;
&lt;td&gt;qwen2.5vl:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/invoice-extract&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.03&lt;/td&gt;
&lt;td&gt;qwen2.5vl:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/screenshot-data&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.02&lt;/td&gt;
&lt;td&gt;qwen2.5vl:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/alt-text&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;qwen2.5vl:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/pii-detect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.02&lt;/td&gt;
&lt;td&gt;qwen2.5:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/sentiment&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;qwen2.5:7b&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Cost to run: $0&lt;/strong&gt; (local inference). Margin: ~100%.&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;&lt;span class="c"&gt;# Step 1: Hit the endpoint — you'll get a 402 back&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://x402.ntriq.co.kr/sentiment &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"text": "This product is amazing"}'&lt;/span&gt;

&lt;span class="c"&gt;# Response:&lt;/span&gt;
&lt;span class="c"&gt;# { "x402Version": 1, "accepts": [{ "amount": "10000", "currency": "USDC" }] }&lt;/span&gt;

&lt;span class="c"&gt;# Step 2: Sign with EIP-3009 and retry&lt;/span&gt;
&lt;span class="c"&gt;# The x402 client library handles this automatically&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Local Inference?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero marginal cost&lt;/strong&gt;: Every request is pure profit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No rate limits&lt;/strong&gt;: Mac Mini handles concurrent requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt;: Documents never leave our infrastructure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt;: No network hop to OpenAI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;qwen2.5vl:7b handles documents, invoices, and screenshots with accuracy comparable to GPT-4V for structured extraction tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP Integration
&lt;/h2&gt;

&lt;p&gt;ntriq-agentshop is available as a ClawHub skill. Any agent using OpenClaw or Claude can discover and use these endpoints automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install via ClawHub&lt;/span&gt;
clawhub &lt;span class="nb"&gt;install &lt;/span&gt;ntriq-document-intelligence-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live server&lt;/strong&gt;: &lt;a href="https://x402.ntriq.co.kr" rel="noopener noreferrer"&gt;https://x402.ntriq.co.kr&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/ntriq-gh/ntriq-agentshop" rel="noopener noreferrer"&gt;https://github.com/ntriq-gh/ntriq-agentshop&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402 protocol&lt;/strong&gt;: &lt;a href="https://x402.org" rel="noopener noreferrer"&gt;https://x402.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Listed on&lt;/strong&gt;: &lt;a href="https://github.com/punkpeye/awesome-mcp-servers" rel="noopener noreferrer"&gt;awesome-mcp-servers&lt;/a&gt; (PR #4364)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built on Mac Mini M4, running 24/7. No cloud bills.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
