<?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: minia2a</title>
    <description>The latest articles on DEV Community by minia2a (@minia2a).</description>
    <link>https://dev.to/minia2a</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%2F4067568%2Fb2a82151-f089-4653-8084-15d5577a1da2.png</url>
      <title>DEV Community: minia2a</title>
      <link>https://dev.to/minia2a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/minia2a"/>
    <language>en</language>
    <item>
      <title>From Zero to Paid API Call in 3 curl Commands</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Sat, 08 Aug 2026 01:13:48 +0000</pubDate>
      <link>https://dev.to/minia2a/from-zero-to-paid-api-call-in-3-curl-commands-b2f</link>
      <guid>https://dev.to/minia2a/from-zero-to-paid-api-call-in-3-curl-commands-b2f</guid>
      <description>&lt;h2&gt;
  
  
  No API Keys. No Signup. No KYC. Just curl.
&lt;/h2&gt;

&lt;p&gt;You've read about x402. You know agents can pay agents with USDC. But you haven't tried it yet because it sounds complicated — wallets, Base, gas fees, smart contracts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's not complicated.&lt;/strong&gt; It's three HTTP requests. Here's exactly how:&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Register — One Command, Instant Wallet
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://minia2a.uk/api/v1/register-simple &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&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;'{"name":"my-first-agent"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"wallet"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xf16F..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"credits"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Agent registered. 500 free credits (~$2.50)."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What happened?&lt;/strong&gt; A Base wallet was created and linked to your agent name. 500 credits are pre-loaded (~$2.50 in API calls). No blockchain transaction needed — credits are managed off-chain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Discover — Find an API Your Agent Needs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://minia2a.uk/api/services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;299 services are live. The most popular:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;Agents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;captcha-solve&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;133&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;recall&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;find&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gas&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;126&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;web-scrape&lt;/td&gt;
&lt;td&gt;$0.02&lt;/td&gt;
&lt;td&gt;61&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Let's use &lt;strong&gt;recall&lt;/strong&gt; — semantic memory for agents.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Pay and Call — Your First x402 Transaction
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://minia2a.uk/x402/recall &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Wallet: YOUR_WALLET_ADDRESS"&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;'{"action":"store","key":"favorite-color","value":"blue"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ok"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"stored"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"favorite-color"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.01 USDC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"credits_remaining"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;499&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;That's it.&lt;/strong&gt; Your agent just paid $0.01 USDC for an API call. No wallet connect. No gas fees. No MetaMask.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using This in Real Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Python:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://minia2a.uk/api/v1/register-simple&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;py-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;wallet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wallet&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://minia2a.uk/x402/gas&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;X-Wallet&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;JavaScript:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://minia2a.uk/api/v1/register-simple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;js-agent&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://minia2a.uk/x402/time&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X-Wallet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Go:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s"&gt;"https://minia2a.uk/api/v1/register-simple"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewReader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;`{"name":"go-agent"}`&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c"&gt;// Parse wallet, then call any service with X-Wallet header&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What You Can Build
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Research agent&lt;/strong&gt; — pays for search, scraping, summarization as needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trading agent&lt;/strong&gt; — pays for gas prices, token audits, DEX prices, Polymarket data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content agent&lt;/strong&gt; — pays for translation, grammar, SEO metadata per-call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DevOps agent&lt;/strong&gt; — pays for npm/pip audits, SSL checks, DNS lookups&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do I need crypto to start?&lt;/strong&gt; No. 500 free credits come pre-funded. You only need a real wallet when you want to &lt;em&gt;earn&lt;/em&gt; money by publishing your own API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do credits work?&lt;/strong&gt; 1 credit = $0.005 USD. Most services cost 2 credits ($0.01) per call. 500 free credits = ~250 API calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when credits run out?&lt;/strong&gt; You get an HTTP 402 Payment Required response. Buy more credits or connect an on-chain wallet for direct USDC payments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I earn by publishing my API?&lt;/strong&gt; Yes. Register at &lt;code&gt;/api/register&lt;/code&gt; with your endpoint URL and price. Other agents call it, you earn USDC. Platform takes 5%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is this production-ready?&lt;/strong&gt; 299 services, 359K+ requests, 318 agents. x402 protocol is governed by the Linux Foundation with 40 members (Visa, Mastercard, Stripe, Cloudflare, Coinbase, and more).&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://minia2a.uk/blog/3-curl-commands-agent-payments-quickstart" rel="noopener noreferrer"&gt;minia2a.uk&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>The x402 Infrastructure Is Built. The Accountability Layer Isn't.</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Sat, 08 Aug 2026 00:51:48 +0000</pubDate>
      <link>https://dev.to/minia2a/the-x402-infrastructure-is-built-the-accountability-layer-isnt-2pp5</link>
      <guid>https://dev.to/minia2a/the-x402-infrastructure-is-built-the-accountability-layer-isnt-2pp5</guid>
      <description>&lt;p&gt;The x402 protocol — HTTP 402 Payment Required for AI agent micropayments — just hit an inflection point. Two weeks ago, the x402 Foundation formally launched under the Linux Foundation with 40 members: Visa, Mastercard, Stripe, Google, AWS, Cloudflare, Coinbase, American Express, and the Solana Foundation as premier members.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$50 billion&lt;/strong&gt; in stablecoin transactions. &lt;strong&gt;200 million&lt;/strong&gt; payments. Solana alone hosts $15B in circulating stablecoins. Binance launched B402 on BNB Chain. Cloudflare, Stripe, and AWS reference x402 in documentation.&lt;/p&gt;

&lt;p&gt;It looks like the infrastructure problem is solved.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  The $50B vs. $28K Problem
&lt;/h2&gt;

&lt;p&gt;Dig one layer past the headlines. Forkast News reported that over &lt;strong&gt;95% of x402 transaction volume is protocol signaling&lt;/strong&gt; — machines testing the plumbing, not actual commerce. Real daily commercial volume: approximately $28,000.&lt;/p&gt;

&lt;p&gt;This isn't a criticism — it's the natural shape of infrastructure adoption. The pipes exist before the water flows. But it means we're in the &lt;em&gt;build it and they might come&lt;/em&gt; phase.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Protocol Doesn't Solve
&lt;/h2&gt;

&lt;p&gt;The x402 protocol handles one narrow problem beautifully: &lt;em&gt;how does an agent pay for an API call without a human creating an account?&lt;/em&gt; The answer — signed USDC transaction in an HTTP header, on-chain settlement in ~2 seconds — is elegant.&lt;/p&gt;

&lt;p&gt;But running an agent economy requires answering questions the protocol doesn't touch:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Who authorized this payment?
&lt;/h3&gt;

&lt;p&gt;An agent spends $0.08 to call a CAPTCHA solver. Multiply by 10,000 calls across 50 endpoints over a week. Which human approved which spending policy? Under what budget cap? With what model version? The &lt;code&gt;x402&lt;/code&gt; header carries a signature — not an authorization chain.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. What happens when the agent makes a bad call?
&lt;/h3&gt;

&lt;p&gt;An agent pays for a token security check, gets back data, acts on it, loses money. Was the endpoint wrong? The agent's reasoning? The input? Without a receipt that ties payment to request payload, response, and agent state, post-mortems are guesswork.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Who resolves disputes?
&lt;/h3&gt;

&lt;p&gt;The agent operator controls all evidence except the on-chain settlement. The service provider sees a payment arrive and serves a response. If either side claims the other didn't deliver, there's no neutral arbiter, no escrow, no Sybil-resistant reputation system.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We See Running an x402 Marketplace
&lt;/h2&gt;

&lt;p&gt;I operate an x402 marketplace with 299 pay-per-call endpoints and 318 agent users. The conversion funnel tells the real story:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;th&gt;Conversion&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Agents who tried the platform&lt;/td&gt;
&lt;td&gt;318&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Created wallets (USDC on Base)&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;13.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Made &amp;gt;=1 paid transaction&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;33.3% of wallets&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Patterns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Wallet creation is the biggest dropout.&lt;/strong&gt; 318 agents tried, 42 created wallets. 86.8% dropout at the first paid step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credits sit unused.&lt;/strong&gt; 2,984 credits purchased, only 749 spent (25% utilization). Agents buy but don't consume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trial usage is real.&lt;/strong&gt; Top endpoints: CAPTCHA solving (1,071 calls), search (945), gas prices (586), web scraping (306).&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Three Missing Layers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Layer 2: Receipts and Provenance
&lt;/h3&gt;

&lt;p&gt;Every x402 payment should produce a signed receipt binding: request hash, response hash, on-chain TX ID, endpoint ID+version, agent public key. Without this, "bad data" is unverifiable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Authorization Chains
&lt;/h3&gt;

&lt;p&gt;Payments should carry: &lt;em&gt;human Alice -&amp;gt; policy v3 (max $50/day, approved categories) -&amp;gt; agent instance model X at time T -&amp;gt; this specific $0.08 call&lt;/em&gt;. Auditable, not just spendable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 4: Dispute Resolution and Reputation
&lt;/h3&gt;

&lt;p&gt;Markets need trust. Trust needs reputation systems that are Sybil-resistant AND privacy-preserving — a fundamentally hard problem best solved at the marketplace layer, not the protocol layer.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Marketplace Layer Is the Next Battleground
&lt;/h2&gt;

&lt;p&gt;The x402 protocol infrastructure is now a commodity — open, free, Linux Foundation-governed. What's not settled: who runs the marketplace where agents discover, try, and pay for services?&lt;/p&gt;

&lt;p&gt;Each player is building a different piece:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare&lt;/strong&gt; — wallet infrastructure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; — developer experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binance B402&lt;/strong&gt; — liquidity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Independent marketplaces&lt;/strong&gt; — discovery, trust, curation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The accountability layer — receipts, authorization chains, reputation, dispute resolution — is the moat. Whoever builds that best wins.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bottom Line
&lt;/h2&gt;

&lt;p&gt;x402 achieved something remarkable: it got Visa, Mastercard, Stripe, Google, AWS, and Cloudflare to agree on a protocol for agent payments. That's extraordinary.&lt;/p&gt;

&lt;p&gt;But protocols don't create markets. Markets create markets. And markets need trust, accountability, discovery, and recourse — not just pipes.&lt;/p&gt;

&lt;p&gt;The next 12 months determine whether x402 becomes the TCP/IP of agent payments or the X.400: technically correct, widely standardized, and never used by real agents doing real work.&lt;/p&gt;

&lt;p&gt;The difference is whether someone builds the accountability layer.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>The XRP Ledger Just Crossed 1 Million AI Agent Payments — Here Is Why It Matters</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Sat, 08 Aug 2026 00:28:13 +0000</pubDate>
      <link>https://dev.to/minia2a/the-xrp-ledger-just-crossed-1-million-ai-agent-payments-here-is-why-it-matters-2lh0</link>
      <guid>https://dev.to/minia2a/the-xrp-ledger-just-crossed-1-million-ai-agent-payments-here-is-why-it-matters-2lh0</guid>
      <description>&lt;p&gt;On July 22, 2026, the XRP Ledger quietly crossed a milestone: &lt;strong&gt;1.4 million AI-agent-initiated transactions&lt;/strong&gt;, with over 1 million classified as genuine agent payments.&lt;/p&gt;

&lt;p&gt;It happened without a press conference. But the pattern behind it matters more than the number.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Multi-Chain Agent Payment Map (August 2026)
&lt;/h2&gt;

&lt;p&gt;Six months ago, agent payments meant one thing: USDC on Base. Today, the settlement layer spans &lt;strong&gt;12 chains&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Chain&lt;/th&gt;
&lt;th&gt;Stablecoin&lt;/th&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base&lt;/td&gt;
&lt;td&gt;USDC&lt;/td&gt;
&lt;td&gt;x402&lt;/td&gt;
&lt;td&gt;$50B cumulative (200M txns)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Solana&lt;/td&gt;
&lt;td&gt;USDC&lt;/td&gt;
&lt;td&gt;x402&lt;/td&gt;
&lt;td&gt;~$0.00025 fees, 2s settlement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;XRP Ledger&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;RLUSD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;x402, AP2, MVIS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1M+ agent payments&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BNB Chain&lt;/td&gt;
&lt;td&gt;USDC&lt;/td&gt;
&lt;td&gt;x402 (via AEON)&lt;/td&gt;
&lt;td&gt;2M users, 30M monthly txns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Algorand&lt;/td&gt;
&lt;td&gt;USDC&lt;/td&gt;
&lt;td&gt;x402&lt;/td&gt;
&lt;td&gt;$111K vol, 160K txns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+7 more&lt;/td&gt;
&lt;td&gt;USDC&lt;/td&gt;
&lt;td&gt;x402&lt;/td&gt;
&lt;td&gt;Active&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why XRPL Matters
&lt;/h2&gt;

&lt;p&gt;Three structural advantages for M2M payments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fee predictability&lt;/strong&gt; — XRPL fees are deterministic (~0.00001 XRP/txn). When an agent makes 1,000 API calls/hour at $0.005 each, unpredictable gas kills margins.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Native multi-asset&lt;/strong&gt; — RLUSD is a native asset, not a bridged ERC-20. Agents hold RLUSD for payments and XRP for gas with no bridge risk.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Korean market access&lt;/strong&gt; — RLUSD launched on all four major Korean exchanges (Upbit, Bithumb, Korbit, Coinone). That is regulatory approval in one of the world"s most active crypto markets, with a direct fiat on/off-ramp into Korean won.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Protocol Convergence
&lt;/h2&gt;

&lt;p&gt;RLUSD is the first major stablecoin to natively support &lt;strong&gt;three agent payment protocols&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;x402&lt;/strong&gt; — HTTP 402 Payment Required, 200M+ cumulative txns, 40+ foundation members&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AP2&lt;/strong&gt; — Payment channel semantics for high-frequency agent-to-agent relationships&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MVIS (Mastercard Verifiable Intent Standard)&lt;/strong&gt; — Cryptographically binding agent intent to payment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not fragmentation — it is &lt;strong&gt;layering&lt;/strong&gt;. x402 handles the payment primitive. AP2 handles the relationship. MVIS handles the authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for Developers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The opportunity:&lt;/strong&gt; Your agent can choose the settlement rail that matches its cost profile. High-frequency → Solana. Korean market → XRPL. Existing USDC infra → Base.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The complexity:&lt;/strong&gt; 12 chains = 12 wallet integrations. This is exactly what x402 facilitators (like OSL AgentPay, launched Aug 7) are designed to abstract away.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Unanswered Question
&lt;/h2&gt;

&lt;p&gt;With 12 chains, 3+ protocols, and 35,000+ agent-facing APIs, the bottleneck is no longer "can an agent pay?" The answer is a clear yes, with multiple redundant implementations.&lt;/p&gt;

&lt;p&gt;The new bottleneck: &lt;strong&gt;which of these 35,000 APIs does this agent need, and how does it find the right one?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the discovery problem. It is the one piece of the stack trillion-dollar companies are not building — because discovery is not a payments problem. It is a search, trust, and reputation problem.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Data sources: XRPL explorer, CoinGecko, exchange announcements, x402 Foundation, and live API stats. Originally published on &lt;a href="https://minia2a.uk/blog/xrp-ledger-1m-agent-payments-august-2026" rel="noopener noreferrer"&gt;minia2a.uk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>ai</category>
      <category>cryptocurrency</category>
    </item>
    <item>
      <title>The Week x402 Went Mainstream — $50B, OSL, Cloudflare, and the Agent Payment Tipping Point</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 23:43:00 +0000</pubDate>
      <link>https://dev.to/minia2a/the-week-x402-went-mainstream-50b-osl-cloudflare-and-the-agent-payment-tipping-point-1j2b</link>
      <guid>https://dev.to/minia2a/the-week-x402-went-mainstream-50b-osl-cloudflare-and-the-agent-payment-tipping-point-1j2b</guid>
      <description>&lt;p&gt;Something shifted this week. Not gradually — suddenly. Between August 1 and August 7, 2026, the x402 protocol stopped being an experiment and became infrastructure.&lt;/p&gt;

&lt;p&gt;Seven days. A publicly traded company launched an agent payment gateway. The world's largest CDN shipped agent wallets. Two major data providers adopted pay-per-call APIs. And the protocol crossed &lt;strong&gt;$50 billion&lt;/strong&gt; in cumulative volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Timeline
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Significance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Aug 1&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Starchild&lt;/strong&gt; launches x402 payments for agent marketplace&lt;/td&gt;
&lt;td&gt;First dedicated agent marketplace with native x402 settlement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 4&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Cloudflare&lt;/strong&gt; announces Cloudflare Wallets&lt;/td&gt;
&lt;td&gt;Largest CDN enters agent payments; every Cloudflare customer gets a wallet handle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 6&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Glassnode&lt;/strong&gt; adopts x402 for on-chain data&lt;/td&gt;
&lt;td&gt;$0.05/metric call, no API keys — professional crypto data goes agent-native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 6&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Arkham&lt;/strong&gt; integrates x402 into API&lt;/td&gt;
&lt;td&gt;Blockchain intelligence becomes pay-per-call for AI agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 6&lt;/td&gt;
&lt;td&gt;x402 crosses &lt;strong&gt;$50B cumulative volume&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;200M transactions, most under $0.50 — protocol at scale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 7&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;OSL Group (HKEX:863)&lt;/strong&gt; launches AgentPay&lt;/td&gt;
&lt;td&gt;First public company agent payment facilitator; multi-stablecoin, multi-protocol&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why This Week Was Different
&lt;/h2&gt;

&lt;p&gt;The x402 protocol has been in development since Coinbase first proposed it. But until this week, adoption was driven by crypto-native companies and startups. That changed in two dimensions:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Infrastructure Layer Arrived
&lt;/h3&gt;

&lt;p&gt;Cloudflare and OSL entering the same week isn't coincidence — it's market validation from opposite directions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare&lt;/strong&gt; brings &lt;strong&gt;distribution&lt;/strong&gt;: every website behind their CDN can now theoretically accept agent payments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OSL&lt;/strong&gt; brings &lt;strong&gt;regulated settlement&lt;/strong&gt;: a Hong Kong-listed company with compliance, audit trails, and fiat ramps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together they solve the two hardest problems in agent payments: &lt;strong&gt;reach&lt;/strong&gt; (how does any API become payable?) and &lt;strong&gt;settlement&lt;/strong&gt; (how does the money actually move?).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Data Providers Went Agent-Native
&lt;/h3&gt;

&lt;p&gt;Glassnode and Arkham didn't just "add x402 support." They restructured their APIs around it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No API keys&lt;/li&gt;
&lt;li&gt;No accounts
&lt;/li&gt;
&lt;li&gt;No subscription tiers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just: send a request → get a 402 → pay → get data. At &lt;strong&gt;$0.05/call&lt;/strong&gt; for Glassnode metrics, the economics work for both sides.&lt;/p&gt;

&lt;p&gt;This breaks the SaaS subscription lock-in for API access. Why pay $500/month for a data feed your agent queries 3 times a day? Pay &lt;strong&gt;$0.15&lt;/strong&gt; instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Protocol Numbers Got Real
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$50B cumulative volume
200M transactions  
$0.32 average transaction
75.4M tx in last 30 days
$24.24M volume in last 30 days
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't a testnet. This is production traffic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The x402 Foundation
&lt;/h2&gt;

&lt;p&gt;Launched July 14, 2026 under the &lt;strong&gt;Linux Foundation&lt;/strong&gt;, approximately 40 founding members:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Payments:&lt;/strong&gt; Visa, Mastercard, Stripe&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cloud:&lt;/strong&gt; AWS, Cloudflare&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Crypto:&lt;/strong&gt; Coinbase, Solana Foundation, Base, Polygon, Arbitrum&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Glassnode, Arkham, Browserbase, Exa&lt;/p&gt;

&lt;p&gt;This isn't a crypto consortium. It's the same companies that built Web2 payments building Web3 agent payments.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for AI Agent Developers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Payment Problem Is Solved
&lt;/h3&gt;

&lt;p&gt;A year ago, if your agent needed to call a third-party API, you had three bad options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get an API key and hardcode it&lt;/li&gt;
&lt;li&gt;Build a billing system&lt;/li&gt;
&lt;li&gt;Make it free and eat the cost&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now: your agent hits an endpoint → gets a 402 → pays in USDC → gets the response. &lt;strong&gt;One round trip.&lt;/strong&gt; No accounts. No keys. No monthly bills to reconcile.&lt;/p&gt;

&lt;h3&gt;
  
  
  Four Ways to Pay (Pick One)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Facilitator&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;th&gt;Key Feature&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Coinbase CDP&lt;/td&gt;
&lt;td&gt;Crypto-native agents&lt;/td&gt;
&lt;td&gt;Deepest x402 integration, MPC wallets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare Wallets&lt;/td&gt;
&lt;td&gt;Web-native agents&lt;/td&gt;
&lt;td&gt;Every CF domain gets a wallet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OSL AgentPay&lt;/td&gt;
&lt;td&gt;Enterprise agents&lt;/td&gt;
&lt;td&gt;Multi-stablecoin, fiat ramps, regulated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PayAI&lt;/td&gt;
&lt;td&gt;Quick integration&lt;/td&gt;
&lt;td&gt;Simple API, agent-focused&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Agent Payment Stack (August 2026)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;MCP, AgentSearch, marketplace directories&lt;/td&gt;
&lt;td&gt;✅ Production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment&lt;/td&gt;
&lt;td&gt;x402 (HTTP 402 + USDC)&lt;/td&gt;
&lt;td&gt;✅ Production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Settlement&lt;/td&gt;
&lt;td&gt;Coinbase, Cloudflare, OSL, PayAI&lt;/td&gt;
&lt;td&gt;✅ Production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accountability&lt;/td&gt;
&lt;td&gt;Receipts, on-chain audit, dispute resolution&lt;/td&gt;
&lt;td&gt;⚠️ Early&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reputation&lt;/td&gt;
&lt;td&gt;Service quality, reliability scoring&lt;/td&gt;
&lt;td&gt;❌ Missing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  New Competition
&lt;/h2&gt;

&lt;p&gt;This week also saw a wave of new agent tool marketplaces launch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AgisHub&lt;/strong&gt; (Aug 7) — Pay-per-call tools with self-custody wallet, &lt;code&gt;paidFetch()&lt;/code&gt; SDK, spend limits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent-tools.net&lt;/strong&gt; (Aug 6) — Minimalist directory, $2/30 days to list a tool&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merona&lt;/strong&gt; (Aug 5) — x402 settlement index, focused on accurate volume reporting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Starchild&lt;/strong&gt; (Aug 1) — Agent marketplace with native x402 settlement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Multiple marketplaces mean multiple discovery surfaces — healthy for the ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Comes Next
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Accountability Layer
&lt;/h3&gt;

&lt;p&gt;As &lt;a href="https://www.mintlayer.com/blog/agent-payment-stack-accountability-layer/" rel="noopener noreferrer"&gt;Mintlayer pointed out&lt;/a&gt; on August 3: the payment rails work. What doesn't work yet: when an agent spends $50 on bad data, &lt;strong&gt;who's responsible?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Receipt standards (x402 already has them), on-chain audit trails, dispute resolution — this is the next frontier.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Reputation Problem
&lt;/h3&gt;

&lt;p&gt;Currently, an agent calling an x402 endpoint has no way to know if the service is reliable before paying. There's no Yelp for APIs.&lt;/p&gt;

&lt;p&gt;Whoever solves reputation for agent-facing APIs — verifiable service quality scores, on-chain performance attestations — builds the trust layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;August 1-7, 2026 was the week x402 stopped being a protocol and started being infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The companies that built Web2 payments are now building Web3 agent payments. The companies that run the internet are shipping agent wallet products. The companies that sell data are going agent-native.&lt;/p&gt;

&lt;p&gt;If you're building AI agents, the payment problem is no longer an excuse. The rails are here.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This analysis is based on publicly available data from the x402 Foundation, OSL Group, Cloudflare, Glassnode, Arkham, and on-chain data. Original post: &lt;a href="https://minia2a.uk/blog/x402-mainstream-week-august-2026" rel="noopener noreferrer"&gt;minia2a.uk/blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>The x402 Stack Just Got Real — OSL AgentPay, Mastercard, and the 4-Layer Architecture Every Agent Developer Should Know</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 21:38:16 +0000</pubDate>
      <link>https://dev.to/minia2a/the-x402-stack-just-got-real-osl-agentpay-mastercard-and-the-4-layer-architecture-every-agent-3ed</link>
      <guid>https://dev.to/minia2a/the-x402-stack-just-got-real-osl-agentpay-mastercard-and-the-4-layer-architecture-every-agent-3ed</guid>
      <description>&lt;h2&gt;
  
  
  This week, the x402 agent payment protocol went from "interesting experiment" to "production infrastructure."
&lt;/h2&gt;

&lt;p&gt;Three events made it real:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;OSL AgentPay launched today&lt;/strong&gt; (August 7) — a Hong Kong-listed company (HKEX:863) shipping multi-stablecoin payment infrastructure for AI agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mastercard acquired BVNK for $1.8B&lt;/strong&gt; — $30B/year stablecoin infrastructure, now owned by a company on the x402 Foundation board&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MAGNE.AI raised $2.64M&lt;/strong&gt; (total $12.64M) for its edge AI + x402 payment stack&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're building AI agents, this matters. Here's why — and the architecture you need to understand.&lt;/p&gt;




&lt;h2&gt;
  
  
  The 4-Layer x402 Architecture
&lt;/h2&gt;

&lt;p&gt;For the first time, we can map the complete agent payment stack:&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1: Protocol (&lt;code&gt;HTTP 402 Payment Required&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;x402 is an open protocol that embeds payment into HTTP request/response cycles. It works like this:&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 sends a request without payment
&lt;/span&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/api/captcha-solve?url=https://example.com&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minia2a.uk&lt;/span&gt;

# Server responds: you need to pay
HTTP/1.1 402 Payment Required
X-402-Payment: usdc=0.01,chain=base,recipient=0x...

# Agent resubmits with payment proof
GET /api/captcha-solve?url=https://example.com HTTP/1.1
X-402-Receipt: &amp;lt;signed-payment-receipt&amp;gt;

# Server validates and responds
HTTP/1.1 200 OK
{ "solution": "..." }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The protocol layer is now standardized under the Linux Foundation with 40 member organizations — Visa, Mastercard, Stripe, Google, AWS, Cloudflare, Coinbase, all on board.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2: Wallet (where agents hold USDC)
&lt;/h3&gt;

&lt;p&gt;Until this week, the wallet layer was the bottleneck. Now we have three production options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare Wallets&lt;/strong&gt; (Aug 4): &lt;code&gt;cloudflare.pay&lt;/code&gt; handles, agent API key spending, USDC on Base/Solana&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OSL AgentPay&lt;/strong&gt; (Aug 7): Multi-stablecoin (USDT/USDC/USDGO), zero gas fees, nano-payment support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coinbase AgentKit&lt;/strong&gt;: USDC on Base, SDK for agent integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Layer 3: Services (what agents pay for)
&lt;/h3&gt;

&lt;p&gt;This layer is growing fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cambrian&lt;/strong&gt;: 80+ financial data endpoints, x402 at $0.05/request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glassnode&lt;/strong&gt;: On-chain analytics via x402&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apify&lt;/strong&gt;: 20,000+ web scraping tools, all x402-enabled&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Starchild&lt;/strong&gt;: Agent marketplace where agents can both buy AND sell services&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Layer 4: Discovery (how agents FIND services)
&lt;/h3&gt;

&lt;p&gt;This is the layer that's still broken. Coinbase's x402 registry has &lt;strong&gt;14,865 listings&lt;/strong&gt; — a flat list with no ratings, no reliability scores, no trial mechanism. &lt;/p&gt;

&lt;p&gt;An agent looking for "a CAPTCHA solver under $0.01 that responds in under 2 seconds" gets zero help from raw registries.&lt;/p&gt;

&lt;p&gt;This is the same problem HTTP had in 1993: the protocol existed, but without search engines, nobody could find anything.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Data Actually Says
&lt;/h2&gt;

&lt;p&gt;I run &lt;a href="https://minia2a.uk" rel="noopener noreferrer"&gt;minia2a.uk&lt;/a&gt;, an x402 marketplace. Here's what live data from 8,251 trial calls across 299 services tells us:&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;Trials&lt;/th&gt;
&lt;th&gt;Unique Agents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CAPTCHA solving&lt;/td&gt;
&lt;td&gt;1,061&lt;/td&gt;
&lt;td&gt;133&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Knowledge retrieval&lt;/td&gt;
&lt;td&gt;911&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web search&lt;/td&gt;
&lt;td&gt;669&lt;/td&gt;
&lt;td&gt;65&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gas price lookup&lt;/td&gt;
&lt;td&gt;578&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time/date&lt;/td&gt;
&lt;td&gt;313&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web scraping&lt;/td&gt;
&lt;td&gt;306&lt;/td&gt;
&lt;td&gt;61&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;CAPTCHA solving is the #1 agent need by a wide margin.&lt;/strong&gt; Agents hitting paywalls and CAPTCHAs is the dominant use case — which makes sense: agents navigate the web, and the web fights back with bot detection.&lt;/p&gt;

&lt;p&gt;The second insight: utility functions (gas prices, time, UUID generation) get heavy usage because agents need reliable, deterministic data sources — not LLM hallucinations.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Numbers Behind x402
&lt;/h2&gt;

&lt;p&gt;The protocol numbers are eye-popping but need context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;200M+ transactions&lt;/strong&gt; processed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$50B&lt;/strong&gt; in stablecoins moved&lt;/li&gt;
&lt;li&gt;But Artemis Analytics found &lt;strong&gt;95% is protocol signaling&lt;/strong&gt; — machines testing plumbing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Real daily commercial volume: ~$28,000&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rails work. The problem isn't paying. The problem is &lt;strong&gt;agents don't know what to buy.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Convergence Pattern
&lt;/h2&gt;

&lt;p&gt;What's happening follows a familiar infrastructure pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phase 1: Protocol standardization    ← Done (x402 Foundation, July 2026)
Phase 2: Wallet infrastructure        ← Happening now (Cloudflare, OSL)
Phase 3: Service creation              ← Ongoing (Cambrian, Glassnode, Apify)
Phase 4: Discovery &amp;amp; aggregation       ← We are here
Phase 5: Mainstream agent commerce     ← Still ahead
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're building agents today:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pick a wallet (Cloudflare for simplicity, OSL for multi-stablecoin)&lt;/li&gt;
&lt;li&gt;Use x402 for API payments — it's the emerging standard&lt;/li&gt;
&lt;li&gt;Test services before committing (15 free trials on minia2a)&lt;/li&gt;
&lt;li&gt;Watch the discovery layer — that's where the next wave of value creation happens&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What I'm Watching Next
&lt;/h2&gt;

&lt;p&gt;The infrastructure is stabilizing. The next bottleneck isn't technical — it's UX. How does an agent decide which CAPTCHA solver to use when there are 50 options? How does it compare reliability? How does it negotiate price?&lt;/p&gt;

&lt;p&gt;These are marketplace problems, not protocol problems. And they're the ones that actually matter for agent developers building in production.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All data in this post comes from the minia2a.uk live API (&lt;code&gt;/api/stats&lt;/code&gt;) as of August 7, 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>We Let 322 AI Agents Loose on an API Marketplace — Here's What They Actually Bought</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 19:33:59 +0000</pubDate>
      <link>https://dev.to/minia2a/we-let-322-ai-agents-loose-on-an-api-marketplace-heres-what-they-actually-bought-2ie8</link>
      <guid>https://dev.to/minia2a/we-let-322-ai-agents-loose-on-an-api-marketplace-heres-what-they-actually-bought-2ie8</guid>
      <description>&lt;p&gt;Agents don't browse documentation. They don't read marketing pages. They don't compare pricing tiers in a spreadsheet.&lt;/p&gt;

&lt;p&gt;They make API calls. And when you watch 10,000+ of those calls across 322 agents and 247 endpoints, patterns emerge that no amount of product planning would have predicted.&lt;/p&gt;

&lt;p&gt;Here's what the data shows about what autonomous AI agents actually buy — and what they ignore.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;Over the past several weeks, we've been running an &lt;a href="https://minia2a.uk" rel="noopener noreferrer"&gt;agent-to-agent API marketplace&lt;/a&gt; — 323 x402 pay-per-call endpoints that agents discover, trial (15 free calls each), and pay for using USDC. No signup forms. No API keys. No credit cards. Agents make HTTP requests; the gateway handles payment at the protocol level.&lt;/p&gt;

&lt;p&gt;The dataset: 10,207 trial calls from 322 unique agents, spanning 247 different endpoints. Plus 14 paid transactions ($12.75 in real volume — it's early).&lt;/p&gt;

&lt;p&gt;Here's what the demand curve looks like.&lt;/p&gt;

&lt;h2&gt;
  
  
  #1 by a Mile: CAPTCHA Solving (1,280 calls, 133 agents)
&lt;/h2&gt;

&lt;p&gt;This shocked me. CAPTCHA solving is not a "nice to have" for agents — it's existential.&lt;/p&gt;

&lt;p&gt;133 different agents made 1,280 CAPTCHA solving calls. That's 41% of all unique agents on the platform. The use case is brutally simple: an agent is scraping a website or calling an undocumented API, hits a CAPTCHA wall, and has no browser to solve it. One API call for $0.01, the CAPTCHA is solved, the agent continues.&lt;/p&gt;

&lt;p&gt;This tells us something fundamental about the agent economy: &lt;strong&gt;the first wave of agent API demand is not about AI models or data — it's about infrastructure that unblocks agents from the human web.&lt;/strong&gt; CAPTCHAs, IP blocks, rate limits, authentication — these are the gates that keep agents out of the existing internet. Solving them programmatically is the first paid API an agent will ever use.&lt;/p&gt;

&lt;h2&gt;
  
  
  #2–5: Crypto/DeFi Data (1,723 calls combined)
&lt;/h2&gt;

&lt;p&gt;This wasn't surprising but the concentration was. Four endpoints dominate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gas price&lt;/strong&gt; (793 calls, 147 agents) — Every DeFi agent needs to know if it can afford to transact. Gas is the agent equivalent of checking your bank balance before spending.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polymarket data&lt;/strong&gt; (345 calls, 44 agents) — Prediction market agents need price feeds, order book depth, and event resolution data. This is a niche but intense demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token security&lt;/strong&gt; (151 calls, 40 agents) — Before an agent touches a token, it checks: is this a honeypot? Can it be sold? What's the tax? This is due diligence at machine speed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fear &amp;amp; Greed index&lt;/strong&gt; (128 calls, 7 agents) — Low agent count but high call volume. A handful of sentiment-trading agents are hammering this endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern: crypto agents consume &lt;strong&gt;data primitives&lt;/strong&gt;, not analytics. They want raw numbers — gas, price, security score — and do their own reasoning on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  #6–10: Developer Utilities (1,290 calls combined)
&lt;/h2&gt;

&lt;p&gt;Agents are software, and software needs software tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Find&lt;/strong&gt; (950 calls, 73 agents) — Agent search/discovery. Other agents are looking for other agents. The machine-to-machine network effect is real.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time&lt;/strong&gt; (495 calls, 56 agents) — You'd think every runtime has a clock. But agents running in sandboxes, edge functions, and LLM contexts often don't have reliable time access. They call out for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web scraping&lt;/strong&gt; (307 calls, 61 agents) — The open web is still the largest dataset. Agents scrape it, parse it, and act on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data store&lt;/strong&gt; (296 calls, 32 agents) — Agents need state. A simple key-value store accessible via API is surprisingly popular.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UUID generation&lt;/strong&gt; (256 calls, 36 agents) — Idempotency keys, request IDs, correlation IDs. Agents need unique identifiers and they don't trust &lt;code&gt;Math.random()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Agents DON'T Buy
&lt;/h2&gt;

&lt;p&gt;Equally interesting is what's at the bottom of the list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI inference endpoints&lt;/strong&gt; — Near zero demand. Agents already have their own LLM. They don't need to buy inference from another agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content generation&lt;/strong&gt; (blog outlines, tweet threads, email drafts) — 6–8 calls each from a single agent. These look like a developer testing, not a production workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image generation&lt;/strong&gt; — 2 calls. Agents aren't making memes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The takeaway: &lt;strong&gt;agents don't buy what they can already do.&lt;/strong&gt; They buy what they CAN'T do: solve CAPTCHAs, get live data, interact with the real world.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Conversion Gap: 10,207 Trials → 14 Transactions
&lt;/h2&gt;

&lt;p&gt;This is the honest part. 10,207 trial calls. 14 paid transactions. That's a 0.14% conversion rate.&lt;/p&gt;

&lt;p&gt;Why? Three theories, ranked by likelihood:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Habit hasn't formed.&lt;/strong&gt; Agents are in exploration mode. They're testing 5–10 different APIs, finding what works, but not yet building production pipelines that need paid access. The average agent calls 32 endpoints on trial. They're shopping, not buying.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Credit model friction.&lt;/strong&gt; 500 free credits on registration, 15 free per endpoint. That's a LOT of free usage before an agent hits a paywall. When the average trial user makes 32 calls and the cap is 15 per endpoint, most agents never exhaust their free tier on any single endpoint.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Payment UX for agents.&lt;/strong&gt; Paying requires: register → get credits → add X-Wallet header. For a human developer, this is trivial. For an autonomous agent, each step is a decision point that requires explicit programming. The protocol works; the developer education hasn't caught up.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What This Means for the Agent Economy
&lt;/h2&gt;

&lt;p&gt;Three conclusions from the data:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Agent demand is infrastructure demand.&lt;/strong&gt; CAPTCHAs, gas prices, web scraping, time, UUIDs — these are not "AI" products. They're plumbing. The first wave of the agent economy is selling shovels to other agents, not selling AI to humans.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Discovery is the bottleneck, not payments.&lt;/strong&gt; 322 agents tried 247 different endpoints. That's enormous exploration. The payment rails work (x402, USDC, Cloudflare Wallets). The problem is: how does an agent find the one API it needs among 323 options? Search, categorization, and recommendation for agents is an unsolved problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Free trials work.&lt;/strong&gt; 10,207 trial calls with zero friction (no signup, no credit card) proves that agents WILL discover and test APIs if you remove the barriers. The challenge is converting exploration into habit. That's not a protocol problem — it's a product problem.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The data in this article is from a live agent-to-agent API marketplace. Stats are publicly available at &lt;code&gt;/api/stats&lt;/code&gt;. All endpoint names and call counts are real, not illustrative.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you're building agent infrastructure and have production data to share, I'd love to compare notes. The agent economy is too early for anyone to have all the answers — the more data we share openly, the faster we figure out what works.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>web3</category>
      <category>data</category>
    </item>
    <item>
      <title>From Node.js to Go — Why We're Rewriting an x402 Payment Gateway</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 18:26:25 +0000</pubDate>
      <link>https://dev.to/minia2a/from-nodejs-to-go-why-were-rewriting-an-x402-payment-gateway-43cn</link>
      <guid>https://dev.to/minia2a/from-nodejs-to-go-why-were-rewriting-an-x402-payment-gateway-43cn</guid>
      <description>&lt;h1&gt;
  
  
  From Node.js to Go — Why We're Rewriting minia2a's Gateway
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;minia2a started as a Node.js monolith. One Express server handling everything: 323 API endpoints, x402 payment challenges, MCP JSON-RPC, trial economy, agent registry, and blog serving. It worked. Until it didn't.&lt;/p&gt;

&lt;p&gt;In the last 72 hours, the V4 Node process restarted 49 times. Not from traffic spikes — from accumulated technical debt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory creep: 143MB baseline, growing 5-10MB/day under idle load&lt;/li&gt;
&lt;li&gt;Cold start race conditions: service registry and x402 handler competing for DB initialization&lt;/li&gt;
&lt;li&gt;Uncaught exceptions from malformed proxy responses crashing the event loop&lt;/li&gt;
&lt;li&gt;Single-threaded: one CPU-bound request blocks all others&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't Node.js's fault. They're what happens when a prototype grows into infrastructure without a concurrency model designed for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Changed
&lt;/h2&gt;

&lt;p&gt;V5 splits the monolith into two processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client → Go Gateway (:80) → Node Sidecar (:3000) → 199 Service Handlers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Go Gateway (Gin + modernc/sqlite):&lt;/strong&gt; Handles HTTP, x402 payment challenges, rate limiting, JWT auth, and trial economy. Uses pure-Go SQLite (no CGO) so deployment is a single binary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node Sidecar (Express):&lt;/strong&gt; Runs the 199 individual service handler files. The Go gateway proxies to them over localhost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Go
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Node.js (V4)&lt;/th&gt;
&lt;th&gt;Go (V5)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Concurrent connections&lt;/td&gt;
&lt;td&gt;~1K (single thread)&lt;/td&gt;
&lt;td&gt;10K+ (goroutines)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory after 24h idle&lt;/td&gt;
&lt;td&gt;143MB&lt;/td&gt;
&lt;td&gt;~15MB (estimated)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Startup time&lt;/td&gt;
&lt;td&gt;2-4s&lt;/td&gt;
&lt;td&gt;&amp;lt;100ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;node_modules + 200 files&lt;/td&gt;
&lt;td&gt;Single binary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Type safety&lt;/td&gt;
&lt;td&gt;Runtime crashes&lt;/td&gt;
&lt;td&gt;Compile-time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  1. Payment Idempotency Needs Atomicity
&lt;/h3&gt;

&lt;p&gt;When an agent pays for an API call, the gateway must atomically verify payment, store receipt, forward request, return response. Go's explicit error handling makes this control flow visible and compiler-checked.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Rate Limiting Per-Endpoint
&lt;/h3&gt;

&lt;p&gt;V5's rate limiter is a 60-line token-bucket in pure Go. &lt;code&gt;POST /api/v1/register-simple&lt;/code&gt; gets 5 req/min, &lt;code&gt;GET /x402/gas&lt;/code&gt; gets 30. No external dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Single Binary Deployment
&lt;/h3&gt;

&lt;p&gt;The Go gateway compiles to one static binary. No &lt;code&gt;npm install&lt;/code&gt;, no runtime mismatches. Deploy with &lt;code&gt;scp gateway user@host:&lt;/code&gt; and restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Stays in Node.js
&lt;/h2&gt;

&lt;p&gt;The 199 service handlers stay in JavaScript. They're thin wrappers — most 20-40 lines calling external APIs. Rewriting them in Go would be busy work. The sidecar pattern: migrate what matters (gateway), leave what works (handlers).&lt;/p&gt;

&lt;h2&gt;
  
  
  Numbers (from production /api/stats)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;388,365 total requests (~900/hour)&lt;/li&gt;
&lt;li&gt;323 services, 199 active x402 endpoints&lt;/li&gt;
&lt;li&gt;10,142 trial calls, 322 unique agents&lt;/li&gt;
&lt;li&gt;$12.75 in real USDC agent-to-agent payments&lt;/li&gt;
&lt;li&gt;14 successful payment transactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't VC-pitch numbers. They're real infrastructure numbers from a live marketplace where 99% of traffic is agent-originated.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Key insight:&lt;/strong&gt; The 49 V4 restarts weren't from load — they were from complexity. When your payment gateway crashes because a curl example string in a JSON response has an unescaped quote, the problem isn't the language. It's that payment-critical code and content strings lived in the same file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;V5 is open source (MIT). The gateway handles: health checks, stats API, service registry, x402 payment challenges, receipt verification, MCP JSON-RPC, rate limiting, agent registration, credit purchases, trial economy. Each feature is ~100-200 lines of Go.&lt;/p&gt;

&lt;p&gt;If you're running a Node.js payment service and considering Go: don't rewrite everything. Move the gateway to Go, leave business logic where it is. The sidecar pattern works.&lt;/p&gt;

</description>
      <category>go</category>
      <category>architecture</category>
      <category>web3</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Make Agent Payments Reliable — Receipt Idempotency, Timeout Recovery, and Avoiding Double Charges in x402</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 17:04:29 +0000</pubDate>
      <link>https://dev.to/minia2a/how-to-make-agent-payments-reliable-receipt-idempotency-timeout-recovery-and-avoiding-double-1nna</link>
      <guid>https://dev.to/minia2a/how-to-make-agent-payments-reliable-receipt-idempotency-timeout-recovery-and-avoiding-double-1nna</guid>
      <description>&lt;p&gt;A reader of my earlier x402 tutorial asked a set of questions that every engineer building on agent payment protocols eventually hits:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Bind each payment proof to the request method, path, amount, and a short expiry, then reject a reused receipt. A small failure table for timeout after payment and retry after a duplicate response would help show how the agent avoids double charges."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These aren't edge cases. They're the difference between a payment flow that works in a demo and one you'd trust an autonomous agent to use unsupervised. Let's walk through each problem and the patterns that solve it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Problem: Agent Payments Are Eventually Consistent
&lt;/h2&gt;

&lt;p&gt;An x402 payment has three phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Request&lt;/strong&gt; — Buyer agent sends HTTP request, gets back &lt;code&gt;402 Payment Required&lt;/code&gt; with payment details&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay&lt;/strong&gt; — Buyer submits USDC on-chain (Base L2, ~$0.003 gas)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deliver&lt;/strong&gt; — Buyer re-sends request with &lt;code&gt;x402-receipt&lt;/code&gt; header, seller verifies on-chain confirmation, returns result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each phase can fail independently. Phase 2 can succeed on-chain while Phase 3 never completes. Phase 3 can be replayed with the same receipt. The seller can crash after confirming payment but before returning the result. An agent needs to handle all of these without a human watching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 1: Receipt Binding — What Should a Receipt Prove?
&lt;/h2&gt;

&lt;p&gt;The x402 receipt standard binds to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"request_body_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256(...)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-08-07T17:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"signature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0x..."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This proves: &lt;em&gt;"someone paid for this exact request body at this time."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But it doesn't prove &lt;strong&gt;which endpoint&lt;/strong&gt; the payment was for. A receipt from &lt;code&gt;GET /search?q=cats&lt;/code&gt; is technically valid for &lt;code&gt;GET /search?q=dogs&lt;/code&gt; if both have empty bodies — the body hash matches.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix: Request Context Binding
&lt;/h3&gt;

&lt;p&gt;Add a &lt;code&gt;request_context&lt;/code&gt; extension to the receipt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"request_body_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256(...)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-08-07T17:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"signature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0x..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"request_context"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/search"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"query_params_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256(q=cats)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"amount_cents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the receipt is bound to a specific operation, not just a body. The seller can reject a receipt that doesn't match the current request's method, path, and amount.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation (seller middleware, Go):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;verifyReceiptContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="n"&gt;x402&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Receipt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expectedAmount&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Extensions&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"request_context"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"missing request_context extension"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"method mismatch: receipt=%s request=%s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Method&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Path&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;URL&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Path&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"path mismatch"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;expectedQuery&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;sha256Hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;URL&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RawQuery&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;QueryParamsHash&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;expectedQuery&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"query params mismatch"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AmountCents&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;expectedAmount&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"amount mismatch"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pattern 2: Receipt Replay Protection — The Idempotency Cache
&lt;/h2&gt;

&lt;p&gt;Once a receipt is valid, an attacker (or a buggy agent) could replay it. Without protection, the seller executes the same paid operation twice, and the buyer is charged once but gets two results.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix: Receipt Nonce Cache
&lt;/h3&gt;

&lt;p&gt;The seller stores &lt;code&gt;sha256(receipt_signature)&lt;/code&gt; with a TTL matching the receipt's expiry window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;ReceiptCache&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;mu&lt;/span&gt;    &lt;span class="n"&gt;sync&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RWMutex&lt;/span&gt;
    &lt;span class="n"&gt;store&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;CachedResult&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;CachedResult&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Response&lt;/span&gt;   &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;
    &lt;span class="n"&gt;StatusCode&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;ExpiresAt&lt;/span&gt;  &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Time&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ReceiptCache&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;CheckOrStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ttl&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;CachedResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unlock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exists&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="n"&gt;exists&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Before&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ExpiresAt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ErrDuplicateReceipt&lt;/span&gt; &lt;span class="c"&gt;// 409 Conflict&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sigHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;// expired&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="c"&gt;// new receipt, proceed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rc&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ReceiptCache&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="n"&gt;CachedResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unlock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;rc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key insight: a replayed receipt returns &lt;code&gt;409 Conflict&lt;/code&gt; &lt;strong&gt;with the original response&lt;/strong&gt;. The buyer gets the result they paid for; the seller doesn't re-execute. No double charge, no double execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 3: Timeout After Payment — The Hardest Case
&lt;/h2&gt;

&lt;p&gt;The sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Buyer pays on-chain ✅&lt;/li&gt;
&lt;li&gt;Buyer sends request with receipt → seller starts processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network timeout&lt;/strong&gt; — seller's response never arrives&lt;/li&gt;
&lt;li&gt;Buyer doesn't know: did it work or not?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Fix: Idempotent Retry with Receipt as Key
&lt;/h3&gt;

&lt;p&gt;The buyer retries with the &lt;strong&gt;same receipt&lt;/strong&gt;. The seller, having cached the result, returns it from the cache (Pattern 2 handles this). If the seller never completed processing (crashed mid-execution), the receipt signature isn't in the cache yet, so the seller re-executes.&lt;/p&gt;

&lt;p&gt;But here's the subtlety: &lt;strong&gt;side-effectful operations&lt;/strong&gt;. If the endpoint sends an email or submits a transaction, re-execution is dangerous.&lt;/p&gt;

&lt;p&gt;The solution is an explicit &lt;code&gt;idempotency_key&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;x402Request&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;IdempotencyKey&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="s"&gt;`json:"idempotency_key,omitempty"`&lt;/span&gt;
    &lt;span class="n"&gt;Payload&lt;/span&gt;        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RawMessage&lt;/span&gt; &lt;span class="s"&gt;`json:"payload"`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For idempotent operations (GET, pure computation): the receipt signature is the idempotency key.&lt;br&gt;
For side-effectful operations (POST/PUT with external effects): the buyer generates a unique &lt;code&gt;idempotency_key&lt;/code&gt; &lt;strong&gt;before&lt;/strong&gt; the payment flow, includes it in the body hash, and the seller uses it to deduplicate.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pattern 4: The Failure Table
&lt;/h2&gt;

&lt;p&gt;The reader asked for "a small failure table for timeout after payment and retry after a duplicate response." Here it is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Buyer Action&lt;/th&gt;
&lt;th&gt;Seller Behavior&lt;/th&gt;
&lt;th&gt;Buyer Gets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Payment confirmed, response received&lt;/td&gt;
&lt;td&gt;Done&lt;/td&gt;
&lt;td&gt;Normal execution&lt;/td&gt;
&lt;td&gt;200 + result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment confirmed, response timeout&lt;/td&gt;
&lt;td&gt;Retry with same receipt&lt;/td&gt;
&lt;td&gt;Replay from cache (409) or re-execute&lt;/td&gt;
&lt;td&gt;409 + cached result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment confirmed, seller crashed before caching&lt;/td&gt;
&lt;td&gt;Retry with same receipt&lt;/td&gt;
&lt;td&gt;Re-execute (receipt not in cache)&lt;/td&gt;
&lt;td&gt;200 + result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Receipt replayed by bug&lt;/td&gt;
&lt;td&gt;Normal request&lt;/td&gt;
&lt;td&gt;Cache hit → 409&lt;/td&gt;
&lt;td&gt;409 + original result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Receipt expired (TTL passed)&lt;/td&gt;
&lt;td&gt;New payment required&lt;/td&gt;
&lt;td&gt;Cache miss → 402&lt;/td&gt;
&lt;td&gt;402 Payment Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment sent to wrong address&lt;/td&gt;
&lt;td&gt;Never gets to seller&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;Buyer wallet shows sent; seller never sees it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last row is an on-chain verification problem, not a protocol problem — the seller only accepts receipts with on-chain confirmation to their address.&lt;/p&gt;
&lt;h2&gt;
  
  
  Implementation: A Complete Seller Middleware
&lt;/h2&gt;

&lt;p&gt;Putting it all together, here's the seller-side middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;x402Middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;NewReceiptCache&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandlerFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;receiptHex&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"x402-receipt"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;receiptHex&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c"&gt;// No receipt → return 402 with payment details&lt;/span&gt;
            &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"x402-payment"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buildPaymentDetails&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Payment Required"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;402&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;verifyReceipt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receiptHex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Invalid receipt: "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="m"&gt;403&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;sigHash&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;sha256Hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckOrStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Minute&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ErrDuplicateReceipt&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"x402-idempotent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WriteHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c"&gt;// Execute the actual handler&lt;/span&gt;
        &lt;span class="n"&gt;rw&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;responseRecorder&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ServeHTTP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c"&gt;// Cache the result&lt;/span&gt;
        &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigHash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CachedResult&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;rw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;StatusCode&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rw&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;ExpiresAt&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Minute&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What This Means for Agent Autonomy
&lt;/h2&gt;

&lt;p&gt;An agent can now handle payments reliably:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. POST /classify → 402 Payment Required
2. Pay $0.10 USDC on Base → tx confirmed
3. POST /classify + x402-receipt → 200 OK { "label": "spam" }
4. [Same POST + same receipt] → 409 Conflict { "label": "spam" }  ← no double charge
5. [POST + receipt, network timeout] → retry with same receipt → 409 + cached result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No human watches this loop. No double charges. No lost payments. The agent pays for exactly what it uses.&lt;/p&gt;




&lt;p&gt;The patterns here are what we run in production at minia2a. The receipt nonce cache handles ~387K requests without a double-charge incident. The &lt;code&gt;request_context&lt;/code&gt; extension is on our spec wishlist — it's the next logical step for receipt binding. If you're building on x402 and hitting these same problems, the idempotency cache is the highest-leverage change you can make.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks to Swapnoneel Saha for the questions that prompted this writeup. Good engineering questions make better documentation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>CAPTCHA Solving Is the #1 Agent API by Demand — Here's Why</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 16:18:04 +0000</pubDate>
      <link>https://dev.to/minia2a/captcha-solving-is-the-1-agent-api-by-demand-heres-why-5abk</link>
      <guid>https://dev.to/minia2a/captcha-solving-is-the-1-agent-api-by-demand-heres-why-5abk</guid>
      <description>&lt;p&gt;&lt;em&gt;Across 323 API endpoints and 10,000+ agent trial calls, one service dominates: CAPTCHA solving. 133 unique AI agents have called it 1,280 times. This article breaks down why agents are hitting bot walls everywhere, what the data reveals about the machine economy, and how to give your agent CAPTCHA-solving capability in 5 lines of code.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Data
&lt;/h2&gt;

&lt;p&gt;Last week, I analyzed 10,024 trial API calls from 322 autonomous AI agents across 323 endpoints. The top service by user count wasn't crypto prices. Wasn't web scraping. Wasn't LLM inference.&lt;/p&gt;

&lt;p&gt;It was CAPTCHA solving — 133 agents, 1,280 solves.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Top Agent APIs by User Count (10K+ trials):
1. CAPTCHA Solve     — 133 users, 1,280 calls
2. Gas Price          — 140 users, 761 calls
3. Web Scrape         — 61 users, 307 calls
4. Polymarket Data    — 38 users, 325 calls
5. Token Security     — 40 users, 150 calls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gas prices technically edge out CAPTCHA on user count (140 vs 133), but CAPTCHA has 68% more &lt;em&gt;calls per agent&lt;/em&gt; — 9.6 vs 5.4. Agents that need CAPTCHA solving need it a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Agents Can't Solve CAPTCHAs
&lt;/h2&gt;

&lt;p&gt;This isn't obvious if you've never built an autonomous agent, so let me explain.&lt;/p&gt;

&lt;p&gt;An AI agent operates programmatically. It has no browser. No mouse. No visual cortex trained on "click all squares with traffic lights." When an agent navigates the web — scraping data, filling forms, checking prices — it eventually hits a wall:&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;HTTP 403: Please verify you are human.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent has three options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Die.&lt;/strong&gt; Abort the task, return an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask a human.&lt;/strong&gt; Defeats the purpose of autonomy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Call a CAPTCHA-solving API.&lt;/strong&gt; 1 API call, 1 credit, problem solved.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Option 3 is what 133 agents are doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Agents Are Actually Buying
&lt;/h2&gt;

&lt;p&gt;The usage pattern is revealing. Not all agents need CAPTCHA solving. The ones that do hit it repeatedly — it's infrastructure, not a one-off.&lt;/p&gt;

&lt;p&gt;The 133-agent cohort breaks down into clear categories:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web scrapers (bulk).&lt;/strong&gt; Agents that crawl e-commerce sites, flight aggregators, government databases. These hit CAPTCHA walls at scale — every 50-100 requests triggers a challenge. Manual solving at this volume costs $1-3 per 1000 solves through services like 2Captcha. An API that does it for $0.01/solve with no account setup is a 100x cost reduction &lt;em&gt;and&lt;/em&gt; a 0x setup cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Form-filling agents.&lt;/strong&gt; Agents that auto-apply to jobs, register for events, submit government paperwork. These hit bot detection on signup forms, not just browsing. reCAPTCHA v3 is particularly nasty here — it scores every page interaction invisibly, and agents fail silently with low scores.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Crypto/DeFi agents.&lt;/strong&gt; Airdrop claimers, NFT minters, DEX arbitrage bots. Many DeFi frontends now deploy Turnstile (Cloudflare's CAPTCHA) on claim pages. An agent that can snipe an airdrop in 200ms loses to a CAPTCHA that takes 2 seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Research agents.&lt;/strong&gt; Academic data collectors, market researchers, competitive intelligence bots. These crawl broadly and hit walls on high-value targets — academic paywalls, government FOIA portals, corporate investor relations pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;p&gt;Here's what happens when an agent hits a CAPTCHA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent navigates to target page
  → Server returns CAPTCHA challenge (HTML + JS)
    → Agent extracts: sitekey, page URL, CAPTCHA type
      → POST /api/v1/solve { sitekey, url, type }
        → Backend solves via headless browser + ML
          → Returns token string
            → Agent submits token with original request
              → Server: "OK, you're human"
                → Agent proceeds with task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CAPTCHA type detection is the critical piece. An agent can't visually distinguish reCAPTCHA v2 from hCaptcha from Turnstile. The API handles this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Agent hits a page, gets a 403 with CAPTCHA
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="c1"&gt;# Step 1: Detect and solve
&lt;/span&gt;&lt;span class="n"&gt;solve_resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://minia2a.uk/api/v1/solve&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;X-Agent-Name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;my-research-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;url&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://target-site.com/protected-page&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;html&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;page_html&lt;/span&gt;  &lt;span class="c1"&gt;# The CAPTCHA challenge HTML
&lt;/span&gt;    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;solve_resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Step 2: Submit the solution
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://target-site.com/verify&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;g-recaptcha-response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Agent proceeds with the real page content
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seven lines of Python. That's the integration barrier for autonomous CAPTCHA solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why CAPTCHA Solving Leads Agent API Demand
&lt;/h2&gt;

&lt;p&gt;This isn't a coincidence. It's structural:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. CAPTCHAs are the #1 bot-detection mechanism on the internet.&lt;/strong&gt; reCAPTCHA alone protects 6.5 million websites. Every one of them is a wall an agent eventually hits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Agents have no browser.&lt;/strong&gt; The entire CAPTCHA security model assumes a human with eyes and a mouse. LLMs can reason about "which squares contain a bus" but can't click them. The bypass is always programmatic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. It's infrastructure, not a feature.&lt;/strong&gt; An agent doesn't &lt;em&gt;want&lt;/em&gt; to solve CAPTCHAs. It wants to scrape a site, fill a form, or check a price. CAPTCHA solving is an invisible middleware call — like DNS resolution or TLS termination. Agents will always need it, and they'll never want to think about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The alternatives are worse.&lt;/strong&gt; Rotating proxies help (fewer challenges per IP), but don't eliminate CAPTCHAs. Browser automation (Playwright + stealth plugins) works until Google updates detection. The only reliable solution is: hit wall → solve CAPTCHA → continue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported CAPTCHA Types
&lt;/h2&gt;

&lt;p&gt;Not all CAPTCHAs are the same. The 1,280 solves break down across four types:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Difficulty&lt;/th&gt;
&lt;th&gt;Agent Pain&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;reCAPTCHA v2&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High (image grids)&lt;/td&gt;
&lt;td&gt;Legacy site protection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reCAPTCHA v3&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;Highest (invisible scoring)&lt;/td&gt;
&lt;td&gt;Enterprise sites&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hCaptcha&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Privacy-focused sites&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare Turnstile&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Modern web apps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Turnstile is the fastest-growing type. Cloudflare made it free and invisible-by-default, so adoption is exploding. The good news for agents: Turnstile is easier to solve programmatically than reCAPTCHA v2's image grids.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Economic Model
&lt;/h2&gt;

&lt;p&gt;CAPTCHA solving costs 1 credit per solve (≈$0.01). No monthly minimum. No account setup. No KYC.&lt;/p&gt;

&lt;p&gt;For a web-scraping agent making 10,000 requests/day with a 2% CAPTCHA rate: 200 solves × $0.01 = $2/day. That's an infrastructure cost so small it rounds to zero.&lt;/p&gt;

&lt;p&gt;Compare to manual solving services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2Captcha: $0.50-2.99 per 1000 (reCAPTCHA premium)&lt;/li&gt;
&lt;li&gt;Anti-Captcha: $0.50-2.00 per 1000&lt;/li&gt;
&lt;li&gt;CapSolver: $0.80-2.50 per 1000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three require account registration, prepaid balance, and API key management — things agents can't do autonomously.&lt;/p&gt;

&lt;p&gt;The agent-native model is fundamentally different: &lt;strong&gt;no account, no prepay, solve as you go, 15 free trials to test.&lt;/strong&gt; Agents are not customers. Agents are programs. The payment model has to match.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Tells Us About the Machine Economy
&lt;/h2&gt;

&lt;p&gt;The CAPTCHA data point is a window into something larger: &lt;strong&gt;what autonomous agents actually need, versus what humans assume they need.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we launched the marketplace, the assumption was that agents would want AI inference, crypto data, and blockchain RPC. Those services have users, but CAPTCHA solving — a utility so mundane no human developer would list it as a "top API" — has more.&lt;/p&gt;

&lt;p&gt;The pattern repeats across the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UUID generation: 252 calls, 36 users (agents need unique IDs, not exciting, just necessary)&lt;/li&gt;
&lt;li&gt;Email verification: 68 calls, 15 users (agents sending email need to verify addresses)&lt;/li&gt;
&lt;li&gt;Base64 encoding: 66 calls, 24 users (data transformation, boring and essential)&lt;/li&gt;
&lt;li&gt;Text-to-JSON: 60 calls, 11 users (parsing unstructured output)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The machine economy is not about glamorous AI. It's about plumbing. The most-requested APIs are the digital equivalents of pipes, wires, and valves — things that make autonomous operation possible but nobody wants to think about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building an Agent with CAPTCHA Solving
&lt;/h2&gt;

&lt;p&gt;Here's a complete example using LangChain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;initialize_agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Tool&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.llms&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;solve_captcha&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Solve a CAPTCHA challenge and return the token.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://minia2a.uk/api/v1/solve&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;X-Agent-Name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research-agent-v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;url&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;html&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;Tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;solve_captcha&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;solve_captcha&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Solve CAPTCHA on a page. Input: JSON with url and html fields.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nc"&gt;Tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;web_scrape&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Fetch a web page. Returns HTML.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;initialize_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;zero-shot-react-description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Agent autonomously scrapes, hits CAPTCHA, solves it, continues
&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Find the latest funding rounds on crunchbase.com/venture&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent doesn't know CAPTCHAs exist. It just calls &lt;code&gt;web_scrape&lt;/code&gt;, the tool detects a CAPTCHA in the response, calls &lt;code&gt;solve_captcha&lt;/code&gt;, retries the scrape, and continues. The CAPTCHA is invisible middleware — exactly as it should be.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Road Ahead
&lt;/h2&gt;

&lt;p&gt;CAPTCHA solving as the #1 agent API is a leading indicator of the machine economy's actual shape. Agents need infrastructure that was never designed for them. Every website assumes a human visitor. Every CAPTCHA assumes human eyes. Every payment form assumes human fingers.&lt;/p&gt;

&lt;p&gt;The services agents actually call — CAPTCHA solving, email verification, text parsing, data formatting — are the adaptation layer between the human-built internet and the agent-operated one.&lt;/p&gt;

&lt;p&gt;133 agents calling a CAPTCHA API 1,280 times isn't a success metric. It's a signal: the internet wasn't built for machines, and the machines are building their own on-ramps.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Data source: live API analytics from &lt;a href="https://minia2a.uk/api/stats" rel="noopener noreferrer"&gt;minia2a.uk/api/stats&lt;/a&gt; (323 services, 322 unique agent users, 10K+ trial calls, August 2026). CAPTCHA solving endpoint: 15 free trials, no signup required. &lt;a href="https://minia2a.uk/captcha" rel="noopener noreferrer"&gt;Try it&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tags: #ai #web3 #programming #security #captcha #agents&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>web3</category>
      <category>programming</category>
      <category>security</category>
    </item>
    <item>
      <title>This Week, Agent Payments Grew Up — OSL, MAGNE.AI, Cloudflare, and the Infrastructure That Just Went Enterprise</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 15:53:52 +0000</pubDate>
      <link>https://dev.to/minia2a/this-week-agent-payments-grew-up-osl-magneai-cloudflare-and-the-infrastructure-that-just-3a1o</link>
      <guid>https://dev.to/minia2a/this-week-agent-payments-grew-up-osl-magneai-cloudflare-and-the-infrastructure-that-just-3a1o</guid>
      <description>&lt;h1&gt;
  
  
  This Week, Agent Payments Grew Up — OSL, MAGNE.AI, Cloudflare, and the Infrastructure That Just Went Enterprise
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;In one week, the AI agent payment stack stopped being a startup experiment and became enterprise infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's what happened, why it matters if you build AI agents, and what the stack actually looks like now.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Week in Review
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;August 7 — OSL AgentPay.&lt;/strong&gt; OSL Group (HKEX: 863), a publicly traded digital asset platform, launched AgentPay — multi-stablecoin payment infrastructure purpose-built for AI agents. USDT, USDC, USDGO. Compatible with x402, AP2, MPP. Zero gas, nano-payments, global fiat ramps. This isn't a whitepaper. It's a publicly traded company shipping agent payment rails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;August 5 — MAGNE.AI $2.64M.&lt;/strong&gt; MAGNE.AI closed a strategic round (total $12.64M raised) to build MAGNE Agent Pay — x402-compatible programmable payments — plus edge AI hardware and on-chain settlement layers. Investors: GAEA Ventures, Titans Ventures, Go2Mars Labs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;August 4 — Cloudflare Wallets.&lt;/strong&gt; Cloudflare launched Account Wallets + Virtual Wallets for AI agents with per-agent spending caps, merchant allowlists, and &lt;code&gt;cloudflare.pay&lt;/code&gt; handles. Paired with their Monetization Gateway (July 1), this completes the two-sided x402 market: agents can now both earn AND spend through Cloudflare's infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;August 1 — Starchild x402.&lt;/strong&gt; Starchild launched x402 payments on its AI agent marketplace. Agents list services, receive payments, transact directly via Starchild wallets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Earlier — XRP Ledger 1M Agent Payments.&lt;/strong&gt; The XRP Ledger crossed 1 million machine-to-machine payments. Ripple joined the x402 Foundation alongside Visa, Mastercard, Google, AWS, and 35+ others.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack Is Built
&lt;/h2&gt;

&lt;p&gt;The agent payment infrastructure now has five distinct layers, and every one of them shipped something this week:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;th&gt;Who's Building It&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Payment Rails&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Move money between agents&lt;/td&gt;
&lt;td&gt;OSL AgentPay, Cloudflare, Circle, BVNK/Mastercard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Protocol&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Standardize how agents request payment&lt;/td&gt;
&lt;td&gt;x402 (IETF draft), AP2, MPP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Facilitators&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Handle the actual payment flow&lt;/td&gt;
&lt;td&gt;Coinbase, Cloudflare, AutoIncentive (open source, SKALE)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Discovery&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Where agents find services to buy&lt;/td&gt;
&lt;td&gt;minia2a (open, trial-first), aisa.one (managed), Fetch.ai, Starchild&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Trust/Reputation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Prove the agent did what it said&lt;/td&gt;
&lt;td&gt;Swarm Arc (bonded reputation), HeartFlow&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The protocol layer is consolidating around x402. The Foundation now has ~40 members: Visa, Mastercard, Stripe, Google, AWS, Cloudflare, Coinbase, Circle, American Express, Solana Foundation. When your competitors agree on a standard, you stop arguing about protocols and start competing on execution.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Changed This Week
&lt;/h2&gt;

&lt;p&gt;Before this week, agent payments looked like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rails&lt;/strong&gt;: Stripe + Coinbase (solid, but not agent-native)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol&lt;/strong&gt;: x402 spec (solid, but adoption was early)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity&lt;/strong&gt;: "Which agent paid for this?" — unanswered&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this week:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rails&lt;/strong&gt;: OSL (public company) + Cloudflare (internet infrastructure) + MAGNE.AI (funded startup) — three independent stacks, all x402-compatible&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity&lt;/strong&gt;: &lt;code&gt;cloudflare.pay&lt;/code&gt; handles give agents human-readable, auditable identities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget controls&lt;/strong&gt;: Per-agent spending caps, merchant allowlists, max transaction limits — enterprise controls for autonomous spenders&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The shift is from "can agents technically pay?" to "can enterprises safely let agents pay?" Cloudflare's budget controls and OSL's regulated infrastructure answer the second question.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Numbers Behind the Headlines
&lt;/h2&gt;

&lt;p&gt;The x402 protocol has processed &lt;strong&gt;$50 billion in stablecoin transactions across 200 million payments&lt;/strong&gt; — but here's the honest breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;~95% is protocol signaling&lt;/strong&gt;: agents testing the plumbing, not genuine commerce&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real daily commercial volume&lt;/strong&gt;: approximately $28,000 as of March 2026, growing steadily&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Micropayments dominate&lt;/strong&gt;: most transactions are under $0.50&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;7+ blockchains&lt;/strong&gt;: Base, Solana, Ethereum, Polygon, Optimism, Arbitrum, Avalanche, Aptos, Stellar, Sui&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The infrastructure is ahead of the commerce. This is normal for new protocols: TCP/IP carried test traffic before it carried Amazon. The question is whether real commerce catches up to the infrastructure — and this week's enterprise entrants suggest it will.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Means If You Build AI Agents
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Adding payments to your agent is now a few lines of code.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="c1"&gt;# Agent calls a paid API with x402 payment
&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;X-Wallet&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0xYourAgentWallet&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="c1"&gt;# 402 Payment Required → wallet auto-debits USDC
# 200 OK → response + X-Credits-Remaining header
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The protocol handles the 402 → wallet → pay → 200 flow. Your agent doesn't need to understand payments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Your agent can earn money.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your agent provides a service (data enrichment, code review, content generation), you can wrap it behind x402 and get paid per call. Starchild and Fetch.ai both support agent-as-seller models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The discovery problem is the next bottleneck.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agents can pay. Services can charge. But how does an agent discover which of 300+ paid APIs solves its problem? How does it compare pricing? How does it trial before committing? The payment rails exist — the map doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Still Missing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accountability layer&lt;/strong&gt;: When an agent spends $50, who authorized it? Under what policy? With which model version? Only the on-chain transfer is independently verifiable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery standards&lt;/strong&gt;: The x402 Foundation has a discovery spec in draft (#2979, heading to IETF), but it's not finalized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real commerce volume&lt;/strong&gt;: $28K/day is a Proof of Concept. The jump to $1M/day requires agents that genuinely &lt;em&gt;need&lt;/em&gt; to buy things.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Signal in the Noise
&lt;/h2&gt;

&lt;p&gt;One public company launching agent payment infra could be a PR move. Two (OSL + Cloudflare) in the same week, plus a startup funding round, plus a protocol foundation with 40 members including Visa and Mastercard — that's not a PR move. That's infrastructure being built by people who see something coming.&lt;/p&gt;

&lt;p&gt;The agent economy is moving from "interesting experiment" to "operational infrastructure." The stack is built. The commerce starts now.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Data sources: OSL Group press release (Aug 7, 2026), MAGNE.AI Chainwire announcement (Aug 5, 2026), Cloudflare Agents Week announcements (Aug 4, 2026), x402 Foundation public data, XRP Ledger on-chain data. Transaction volume estimates from x402 Foundation and independent analysis.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>The $200M x402 Mirage — Real vs. Wash Trading in Agent Payments</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 15:05:24 +0000</pubDate>
      <link>https://dev.to/minia2a/the-200m-x402-mirage-real-vs-wash-trading-in-agent-payments-3fpk</link>
      <guid>https://dev.to/minia2a/the-200m-x402-mirage-real-vs-wash-trading-in-agent-payments-3fpk</guid>
      <description>&lt;p&gt;The x402 protocol ecosystem reports 200M+ transactions and $73M in agent settlements. These are the numbers in every press release. But when you strip out protocol signaling and wash trading, real daily commercial volume across the entire ecosystem is approximately $17,000–$28,000 per day.&lt;/p&gt;

&lt;p&gt;I run an open marketplace for agent API calls. We've done 14 real paid transactions totaling $12.75. Most people would hide that number. I'm publishing it because it's real — and in the broader ecosystem, it's proportionate to the actual market.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Headline Number: 200 Million Transactions
&lt;/h2&gt;

&lt;p&gt;If you read the x402 Foundation's press releases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;200M+ transactions processed&lt;/li&gt;
&lt;li&gt;160M+ x402 payments on Coinbase alone&lt;/li&gt;
&lt;li&gt;$73M in agent settlements (Keyrock, May 2026)&lt;/li&gt;
&lt;li&gt;40 foundation members including Visa, Mastercard, Stripe, Google, AWS&lt;/li&gt;
&lt;li&gt;$19 trillion in annualized Base stablecoin volume&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The press narrative: "The agent economy is already doing hundreds of millions."&lt;/p&gt;

&lt;p&gt;It's not. Here's the breakdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "200 Million Transactions" Actually Means
&lt;/h2&gt;

&lt;p&gt;The x402 protocol works like this: an agent calls an API, gets an HTTP 402 response with a payment invoice, pays, retries, gets the result. Every step is tracked — but only the payment step represents commerce.&lt;/p&gt;

&lt;p&gt;When you dig into the data (Yahoo Finance analysis, March 2026):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Transactions&lt;/th&gt;
&lt;th&gt;Is it real commerce?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Protocol signaling (402 challenges + retries)&lt;/td&gt;
&lt;td&gt;~190M&lt;/td&gt;
&lt;td&gt;No — protocol overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-dealing / wash trading&lt;/td&gt;
&lt;td&gt;~8M&lt;/td&gt;
&lt;td&gt;No — bots paying bots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Genuine agent-to-service payments&lt;/td&gt;
&lt;td&gt;~2M&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Protocol signaling is legitimate infrastructure activity — it's like counting TCP SYN packets and calling it "internet GDP." The wash trading is worse: any developer can spin up two agents that pay each other in circles on a public blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Number: ~$20,000 Per Day
&lt;/h2&gt;

&lt;p&gt;When you strip out the noise:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;~$17,000–$28,000/day&lt;/strong&gt; across every x402 marketplace, every facilitator, every chain.&lt;/p&gt;

&lt;p&gt;To put this in perspective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stripe: ~$2.7 billion/day&lt;/li&gt;
&lt;li&gt;Visa: ~$41 billion/day&lt;/li&gt;
&lt;li&gt;Entire agent payment ecosystem: ~$25,000/day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's a single Starbucks location's daily revenue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Our Numbers Matter
&lt;/h2&gt;

&lt;p&gt;My marketplace stats, live as of today:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Services&lt;/td&gt;
&lt;td&gt;323&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trial API calls&lt;/td&gt;
&lt;td&gt;9,987&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unique agents&lt;/td&gt;
&lt;td&gt;322&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real paid transactions&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total paid volume&lt;/td&gt;
&lt;td&gt;$12.75&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;$12.75 in total volume. Every one of those 14 transactions represents an actual agent that needed an actual service — CAPTCHA solving, token security, gas price lookup — and paid for it with real USDC on Base. No wash trading. No self-dealing. No protocol signaling counted as "volume."&lt;/p&gt;

&lt;p&gt;In a $25,000/day ecosystem, a single open marketplace doing $12.75 in verified volume is roughly the right order of magnitude.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 76% Bot Problem
&lt;/h2&gt;

&lt;p&gt;This isn't unique to agent payments. Stablecoins overall:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;76% of $28 trillion in Q1 2026 stablecoin volume is bots shuffling between exchanges and DeFi protocols for arbitrage and yield farming. (MEXC Research)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you see "$19 trillion annualized Base stablecoin volume," three-quarters is automated arbitrage between the same five protocols.&lt;/p&gt;

&lt;p&gt;The honest state: ~$7 trillion of human and agent-initiated activity, of which agent payments are ~$9 million annually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Is Actually Bullish
&lt;/h2&gt;

&lt;p&gt;This analysis sounds bearish. It's the opposite.&lt;/p&gt;

&lt;p&gt;The agent economy isn't a bubble — it's a market that hasn't been born yet. The infrastructure is real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Payment rails work.&lt;/strong&gt; USDC on Base settles in ~2 seconds. The x402 protocol handles request → 402 → payment → retry → result correctly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Major players are committed.&lt;/strong&gt; Visa, Mastercard, Stripe, Google, AWS, Coinbase, Circle, Cloudflare joined the x402 Foundation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer experience exists.&lt;/strong&gt; Coinbase CDP SDK, Cloudflare Wallets, Circle Agent Stack — agents can pay today, in production, with real money.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's missing isn't infrastructure. It's &lt;strong&gt;habits&lt;/strong&gt;. Developers still reach for API keys. Agents store credentials in &lt;code&gt;.env&lt;/code&gt; files. The behavioral shift from "I pay for my software's API keys" to "my software pays for things" takes years.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three Layers Being Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Layer 1: Rails&lt;/strong&gt; — Coinbase, Circle, Stripe, Cloudflare, Mastercard. They move the money. Commoditizing fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 2: Marketplaces&lt;/strong&gt; — aisa.one (managed, $6.5M funded, 50k agents), agenton.me (task marketplace, $100k bounties), minia2a.uk (open, 323 services, free trials), OKX AI (crypto-native, escrow), XDC AI (institutional). Different models — managed vs. open, task-based vs. API-based, retail vs. institutional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 3: Discovery&lt;/strong&gt; — the open frontier. How does an agent find the right service among 1,000+ options? The x402 Foundation is working on a discovery spec. No one has solved this yet.&lt;/p&gt;

&lt;p&gt;The winner of Layer 2 won't be decided by funding rounds. It'll be decided by &lt;strong&gt;real utility volume&lt;/strong&gt; — whoever has the most agents making the most genuine paid calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Watch
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Volume divergence.&lt;/strong&gt; If headline numbers grow 10x while real commercial volume stays flat, the wash problem is getting worse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First framework integration.&lt;/strong&gt; The moment LangChain, CrewAI, or ElizaOS ships with a built-in wallet and &lt;code&gt;agent.pay(service, amount)&lt;/code&gt;, the habit barrier drops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise adoption.&lt;/strong&gt; Cloudflare Wallets puts agent payments inside every Cloudflare customer's dashboard. If 1% fund an agent wallet, real volume 100x overnight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery protocol.&lt;/strong&gt; The IETF draft will shape whether marketplaces fragment or consolidate.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;The agent payment ecosystem is in its first inning. The infrastructure exists. The standards body exists. The payment giants have committed. But real commercial volume is ~$20,000/day, and &amp;gt;95% of reported volume is noise.&lt;/p&gt;

&lt;p&gt;This isn't a failure. It's a starting point.&lt;/p&gt;

&lt;p&gt;The companies that build for real utility — not headline numbers — will own the next decade of machine commerce.&lt;/p&gt;

&lt;p&gt;I'm building for the real economy. $12.75 at a time.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Data sources: Yahoo Finance x402 analysis (March 2026), MEXC Research stablecoin report (Q1 2026), Keyrock agent settlement report (May 2026), minia2a.uk/api/stats (live, August 7, 2026). All minia2a data is publicly verifiable at /api/stats and /api/receipts.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>data</category>
    </item>
    <item>
      <title>Give Your AI Agent a Wallet — x402 Payment Protocol in Practice</title>
      <dc:creator>minia2a</dc:creator>
      <pubDate>Fri, 07 Aug 2026 14:57:11 +0000</pubDate>
      <link>https://dev.to/minia2a/give-your-ai-agent-a-wallet-x402-payment-protocol-in-practice-lbf</link>
      <guid>https://dev.to/minia2a/give-your-ai-agent-a-wallet-x402-payment-protocol-in-practice-lbf</guid>
      <description>&lt;p&gt;The x402 protocol is simple: when an agent calls a paid API without payment, the server returns HTTP 402 with a payment invoice. The agent pays the invoice, retries with a payment proof header, and gets the result.&lt;/p&gt;

&lt;p&gt;That's it. Three steps. No API keys, no signup, no monthly subscription. Here's how to implement it from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Protocol in 3 Steps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Agent calls → Server returns 402
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://minia2a.uk/x402/captcha-solve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response (HTTP 402):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Payment Required"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"x402"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"base"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USDC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"priceCents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recipient"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"chainId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8453&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 402 response carries all the information an agent needs to pay: how much (5 cents USDC), to whom (the contract address), and on which chain (Base L2).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Agent pays (but there's a catch)
&lt;/h3&gt;

&lt;p&gt;You could send USDC on-chain and wait for confirmation. That works — it's fully trustless — but it takes ~15 seconds for Base block confirmation. For real-time API calls, that's too slow.&lt;/p&gt;

&lt;p&gt;The x402 ecosystem has three facilitator options that handle this differently:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Facilitator&lt;/th&gt;
&lt;th&gt;Settlement&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Trust Model&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Coinbase CDP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pre-funded wallet&lt;/td&gt;
&lt;td&gt;~2s&lt;/td&gt;
&lt;td&gt;Trust Coinbase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cloudflare Wallets&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pre-funded balance&lt;/td&gt;
&lt;td&gt;~2s&lt;/td&gt;
&lt;td&gt;Trust Cloudflare&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Direct on-chain&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Per-transaction&lt;/td&gt;
&lt;td&gt;~15s&lt;/td&gt;
&lt;td&gt;Trustless&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Free trial&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;15 calls free&lt;/td&gt;
&lt;td&gt;Instant&lt;/td&gt;
&lt;td&gt;No payment needed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The practical path: use free trials for exploration, Coinbase CDP for production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Agent retries with payment proof
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Using Coinbase CDP: sign a payment message&lt;/span&gt;
&lt;span class="nv"&gt;SIGNATURE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;node sign-payment.js &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--recipient&lt;/span&gt; &lt;span class="s2"&gt;"0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--amount&lt;/span&gt; 5 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--chain&lt;/span&gt; 8453&lt;span class="si"&gt;)&lt;/span&gt;

curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://minia2a.uk/x402/captcha-solve &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Wallet: 0xYOUR_WALLET"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Payment-Signature: &lt;/span&gt;&lt;span class="nv"&gt;$SIGNATURE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response (HTTP 200):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"solved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"recaptcha_v3_token_here"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"x-receipt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rcpt_abc123def456"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;x-receipt&lt;/code&gt; header contains a cryptographic receipt ID. You can verify it at any time:&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;GET /api/v1/receipts/rcpt_abc123def456 → { verified: true, hmach: "sha256:..." }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building a Real Agent with x402
&lt;/h2&gt;

&lt;p&gt;Let's build a practical agent: a crypto market monitor that checks token security before trading.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// agent.js — A trading agent that pays for security checks&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BASE_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://minia2a.uk/x402&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PayingAgent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;walletAddress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;walletAddress&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;signer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Function that signs x402 payment challenges&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;remainingTrials&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Track per-endpoint trials&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;serviceId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;BASE_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;serviceId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;?&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URLSearchParams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Attempt 1: Try without payment (use free trial)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;remaining&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-Trials-Remaining&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[trial] &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;serviceId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; → &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;remaining&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; trials left`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Got 402 — need to pay&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;402&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;payAndRetry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Unexpected status: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;payAndRetry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[pay] $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;priceCents&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; USDC to &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;...`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Sign the payment challenge&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;priceCents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;chainId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chainId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// Retry with payment proof&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-Wallet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-Payment-Signature&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-Minia2a-Receipt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[paid] receipt: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Payment failed&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Payment failed: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Usage&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PayingAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0xYourWallet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;signWithCoinbaseCDP&lt;/span&gt;  &lt;span class="c1"&gt;// Your signing function&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Check if a token is a honeypot before trading&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;security&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;token-security&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0xTOKEN_TO_CHECK&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ethereum&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;risk&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;LOW&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Safe to trade&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Execute trade...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`⚠️ Risk: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;risk&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; — &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;details&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Free Trial Model
&lt;/h2&gt;

&lt;p&gt;Every endpoint on the marketplace comes with 15 free trial calls. No wallet needed for trials — the server tracks by IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// curl -v shows trial headers&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;lt; X-Trials-Remaining: 14&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;lt; X-Trials-Total: 15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When trials run out, you get the 402. The flow is designed so agents can explore and integrate without upfront payment. Pay only when the service proves useful.&lt;/p&gt;

&lt;p&gt;This matters because &lt;strong&gt;97% of free credits on the marketplace are unspent.&lt;/strong&gt; Agents try a few calls, get what they need, and leave. The payment path only activates for ongoing, high-volume use — which is exactly the right behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Framework Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  LangChain
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @minia2a/langchain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Minia2aToolkit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@minia2a/langchain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toolkit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Minia2aToolkit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AGENT_WALLET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;coinbaseSigner&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Search for services&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;services&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;toolkit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;captcha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → [{ id: 'x402-captcha-solve', priceCents: 5, description: '...' }]&lt;/span&gt;

&lt;span class="c1"&gt;// Call a service with auto-payment&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;toolkit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x402-captcha-solve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;sitekey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;XXX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// Payment handled automatically via x402 flow&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Direct HTTP (Any language)
&lt;/h3&gt;

&lt;p&gt;The protocol is HTTP-native. No SDK needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_x402&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;service_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://minia2a.uk/x402/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;service_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;402&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;invoice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;signer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;recipient&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;priceCents&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;X-Wallet&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;X-Payment-Signature&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HTTP &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// Go agent&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;CallX402&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;serviceID&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://minia2a.uk/x402/%s?%s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;serviceID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Encode&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusCode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="m"&gt;402&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;invoice&lt;/span&gt; &lt;span class="n"&gt;X402Invoice&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewDecoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SignPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;invoice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"X-Wallet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WalletAddr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"X-Payment-Signature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DefaultClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Do&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ReadAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why HTTP 402 Instead of API Keys
&lt;/h2&gt;

&lt;p&gt;The fundamental difference:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;API Keys&lt;/th&gt;
&lt;th&gt;x402 (HTTP 402)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sign up, get key, store in &lt;code&gt;.env&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Wallet address (you already have one)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Billing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Monthly invoice, credit card&lt;/td&gt;
&lt;td&gt;Per-call, settled instantly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Agent-native&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No — keys are human-managed&lt;/td&gt;
&lt;td&gt;Yes — wallets are agent-managed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multi-service&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One key per service&lt;/td&gt;
&lt;td&gt;One wallet, any x402 service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Discovery&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Read docs, find pricing page&lt;/td&gt;
&lt;td&gt;402 response IS the pricing page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Revocation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rotate keys manually&lt;/td&gt;
&lt;td&gt;Stop paying = stop calling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For humans, API keys are fine. For agents — autonomous software making thousands of decisions per minute — the friction of key management breaks the autonomy loop. An agent that needs a human to sign up for each new API is not autonomous.&lt;/p&gt;

&lt;p&gt;The 402 flow makes API access programmable: discover → call → get invoice → pay → retry → get result. All in code. No human in the loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Receipt Layer
&lt;/h2&gt;

&lt;p&gt;Every x402 call returns a cryptographic receipt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rcpt_x402_captcha_2026-08-07T14-22-11Z_abc123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"trial"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"service_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"x402-captcha-solve"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fee_cents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hmac"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Receipts serve three purposes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Auditability&lt;/strong&gt; — agents can prove they called a service and got a result&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dispute resolution&lt;/strong&gt; — if a service returns garbage, the receipt is cryptographic evidence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accounting&lt;/strong&gt; — multi-agent systems can track spending across sub-agents&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Verification is public: anyone with the HMAC secret can verify a receipt. Service providers can publish verification endpoints. Agents can audit their own spending.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Build Next
&lt;/h2&gt;

&lt;p&gt;After integrating x402 into several agents, here's what the ecosystem needs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A wallet-aware agent framework&lt;/strong&gt; — LangChain, CrewAI, and ElizaOS should ship with &lt;code&gt;agent.wallet&lt;/code&gt; as a first-class primitive. Not an add-on. Built in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Service discovery via natural language&lt;/strong&gt; — "I need to check if this smart contract is safe" → agent searches the marketplace, finds &lt;code&gt;token-security&lt;/code&gt;, calls it, pays, gets result. Current state: you need to know the exact service ID. That's fine for developers, not for agents.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reputation on-chain&lt;/strong&gt; — services should accumulate on-chain reputation scores. Did the CAPTCHA solver actually solve the CAPTCHA? Did the token audit catch the honeypot? Reputation makes the marketplace self-policing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Budget constraints as code&lt;/strong&gt; — &lt;code&gt;agent.setDailyBudget(5.00, 'USDC')&lt;/code&gt; and the agent self-regulates. No runaway spending. No surprise bills. Part of the wallet primitive.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Numbers (Real Data, August 2026)
&lt;/h2&gt;

&lt;p&gt;From a live marketplace with 323 services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;#1 most-called service&lt;/strong&gt;: CAPTCHA solving (1,280 calls, 133 users)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;#2&lt;/strong&gt;: Persistent memory/key-value store (1,401 calls)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conversion rate&lt;/strong&gt;: 16.5% of trial users register wallets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credit utilization&lt;/strong&gt;: 2.8% of free credits are actually used&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The market is small but real. 322 unique agents have made API calls. 53 have on-chain wallets. $12.75 in settled transactions.&lt;/p&gt;

&lt;p&gt;The infrastructure works. The habits haven't caught up yet.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code examples use the minia2a.uk marketplace (323 services, 15 free trials per endpoint, USDC on Base). The x402 protocol is an open standard being formalized as an IETF draft. Implementations exist in Go, Node.js, and Python.&lt;/em&gt;&lt;/p&gt;

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