<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[sigtap — tools for AI agents]]></title><description><![CDATA[sigtap — tools for AI agents]]></description><link>https://sigtap.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>sigtap — tools for AI agents</title><link>https://sigtap.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 06:04:26 GMT</lastBuildDate><atom:link href="https://sigtap.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[x402 in practice: how an AI agent pays $0.001 for a tool call (HTTP 402, USDC on Base)]]></title><description><![CDATA[AI agents are starting to buy things: not with accounts and API keys, but with a wallet. The x402 standard (HTTP 402 + USDC on Base) lets a tool charge $0.001 per call and lets an agent pay with nothi]]></description><link>https://sigtap.hashnode.dev/x402-in-practice-how-an-ai-agent-pays-0-001-for-a-tool-call-http-402-usdc-on-base</link><guid isPermaLink="true">https://sigtap.hashnode.dev/x402-in-practice-how-an-ai-agent-pays-0-001-for-a-tool-call-http-402-usdc-on-base</guid><category><![CDATA[x402]]></category><category><![CDATA[api]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[micropayments]]></category><dc:creator><![CDATA[sigtap]]></dc:creator><pubDate>Tue, 08 Sep 2026 06:25:30 GMT</pubDate><content:encoded><![CDATA[<p>AI agents are starting to buy things: not with accounts and API keys, but with a wallet. The x402 standard (HTTP 402 + USDC on Base) lets a tool charge $0.001 per call and lets an agent pay with nothing but a private key. No signup, no key issuance, no billing page. We run 12 micro-tools behind this gate (hashing, UUIDs, JWT decode, cold-email grading, deliverability checks...), and this post is the exact contract an agent client implements, with copy-paste code.</p>
<h2>The three-step contract</h2>
<p><strong>Step 1 — free preview.</strong> Every paid path has a free twin that returns a truncated sample of the real output, so a buyer can verify the shape before any wallet action:</p>
<pre><code>GET https://sigtap-outreach-api.sigtap.workers.dev/preview/tools/uuid?version=v7

{"preview":true,"route":"/tools/uuid","limit":5,"version":"v7",
 "ids":["7fa227ee-01a0-7054-af68-ad9e29d5f1f8",
        "7fa227ee-01a0-795a-8d78-3ce4cf3243dc"],
 "truncated":false,"paid_unlocks":"up to 100 ids per call"}
</code></pre>
<p><strong>Step 2 — the 402 challenge.</strong> Calling the paid path without payment returns <code>402</code> with a base64 <code>payment-required</code> response header (x402 v2: exact scheme, network <code>eip155:8453</code>, PayAI facilitator, payTo inside the challenge). The response also carries <code>x-free-preview</code> pointing back at the free sample.</p>
<p><strong>Step 3 — pay and retry the SAME GET.</strong> Sign an EIP-3009 USDC transfer for the asked amount, attach it as the <code>X-PAYMENT</code> header, replay the request; you get <code>200</code> plus a <code>payment-response</code> header with the on-chain settlement.</p>
<h2>Pay in one call (copy-paste)</h2>
<pre><code class="language-js">// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(PRIVATE_KEY)) }]
});

const res = await fetchWithPayment("https://sigtap-outreach-api.sigtap.workers.dev/tools/uuid?count=3&amp;version=v7"); // $0.0005
console.log(res.status, await res.json()); // 200 { ids: [...] }
</code></pre>
<p>The client reads the 402, signs, retries — one round-trip of your code, no keys/accounts (the wallet IS the account).</p>
<h2>Python</h2>
<pre><code class="language-bash">pip install sigtap-agent-tools
</code></pre>
<pre><code class="language-python">from sigtap_agent_tools import client
print(client.preview("tools/hash", text="hello"))    # 200 free sample
print(client.challenge("tools/hash", text="hello"))  # decoded 402 challenge
# client.paid_call(...) settles via a funded key
</code></pre>
<h2>MCP (Claude Code / Cursor / any MCP client)</h2>
<pre><code class="language-json">{
  "mcpServers": {
    "sigtap-agent-tools": {
      "type": "http",
      "url": "https://sigtap-mcp.sigtap.workers.dev/mcp"
    }
  }
}
</code></pre>
<p>First unpaid <code>tools/call</code> returns a JSON-RPC error carrying the same x402 challenge; pay once and the tool works for the session.</p>
<h2>What sells at impulse prices</h2>
<p>Verified prices from the live catalog (<code>/llms.txt</code>, <code>/openapi.json</code>):</p>
<table>
<thead>
<tr>
<th>Tool</th>
<th>Price</th>
</tr>
</thead>
<tbody><tr>
<td>/tools/hash (sha256, sha512, md5, CRC32, base64)</td>
<td>$0.0005</td>
</tr>
<tr>
<td>/tools/uuid (v4, v7, ULID, nanoid, batch)</td>
<td>$0.0005</td>
</tr>
<tr>
<td>/tools/jwt-decode (header+payload, safety flags)</td>
<td>$0.001</td>
</tr>
<tr>
<td>/tools/slug (unicode + Cyrillic transliteration)</td>
<td>$0.001</td>
</tr>
<tr>
<td>/tools/regex (tester + backtracking risk check)</td>
<td>$0.001</td>
</tr>
<tr>
<td>/tools/weather (open-meteo)</td>
<td>$0.001</td>
</tr>
<tr>
<td>/tools/json (flatten to dot paths, JSON→CSV)</td>
<td>$0.001</td>
</tr>
<tr>
<td>/tools/crypto-price (Coinbase spot + spread)</td>
<td>$0.002</td>
</tr>
<tr>
<td>/deliverability (SPF/DKIM/DMARC/MX audit)</td>
<td>$0.003</td>
</tr>
<tr>
<td>/tools/domain-age (RDAP)</td>
<td>$0.003</td>
</tr>
<tr>
<td>/grade (cold email 0-100 + fixes)</td>
<td>$0.005</td>
</tr>
<tr>
<td>/template (cold email generator)</td>
<td>$0.01</td>
</tr>
</tbody></table>
<h2>Notes for builders</h2>
<ul>
<li>Send a browser-like User-Agent: bare <code>python-urllib</code> gets Cloudflare 1010 from many workers.dev origins (ours included).</li>
<li>The 402 body is <code>{}</code> on x402 v2 — read the <code>payment-required</code> <strong>header</strong>, not the body.</li>
<li>Free docs surfaces: <code>/</code> (catalog with prices), <code>/llms.txt</code>, <code>/openapi.json</code>, <code>/health</code>.</li>
<li>Everything settles on-chain (Base mainnet USDC) — no chargebacks, no keys to revoke.</li>
</ul>
<p>Catalog: <a href="https://sigtap-outreach-api.sigtap.workers.dev">https://sigtap-outreach-api.sigtap.workers.dev</a> — free previews for every route, so you can wire the client before funding anything.</p>
]]></content:encoded></item></channel></rss>