<?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: Mike Dorian</title>
    <description>The latest articles on DEV Community by Mike Dorian (@mike_dorian_2ba40c7bc076b).</description>
    <link>https://dev.to/mike_dorian_2ba40c7bc076b</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%2F4073970%2F3668c527-d603-42cf-98c6-034091a41d32.jpg</url>
      <title>DEV Community: Mike Dorian</title>
      <link>https://dev.to/mike_dorian_2ba40c7bc076b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mike_dorian_2ba40c7bc076b"/>
    <language>en</language>
    <item>
      <title>I monetized my API in 30 minutes with x402, no accounts, no API keys, USDC straight to my wallet8FWcu69WE6wYKKyLyHB4LZHgi8u</title>
      <dc:creator>Mike Dorian</dc:creator>
      <pubDate>Wed, 12 Aug 2026 04:17:29 +0000</pubDate>
      <link>https://dev.to/mike_dorian_2ba40c7bc076b/i-monetized-my-api-in-30-minutes-with-x402-no-accounts-no-api-keys-usdc-straight-to-my-wallet-6n6</link>
      <guid>https://dev.to/mike_dorian_2ba40c7bc076b/i-monetized-my-api-in-30-minutes-with-x402-no-accounts-no-api-keys-usdc-straight-to-my-wallet-6n6</guid>
      <description>&lt;p&gt;I monetized my API in 30 minutes with x402, no accounts, no API keys, USDC straight to my wallet&lt;/p&gt;

&lt;p&gt;TL;DR: x402 turns any HTTP endpoint into a pay-per-call product: your server answers 402 Payment Required, the client pays USDC on-chain (Base or Solana), replays the request, and you serve the data. No accounts, no API keys, no Stripe, no KYC.  Settlement lands directly in your wallet. I built a working paid AI API + paid download shop on Cloudflare in an afternoon. Here's the pattern, the gotchas, and a live endpoint you can test right now.&lt;/p&gt;

&lt;p&gt;The problem&lt;br&gt;
You built an API maybe an AI endpoint, a data feed, an MCP server. Agents (and humans) hammer it. You want to charge, but every option stings:&lt;br&gt;
• Subscriptions need account systems, user management, billing cycles&lt;br&gt;
• API keys need a dashboard, quotas, abuse handling&lt;br&gt;
• Stripe doesn't love crypto-native builders, and withdrawals are a whole tax event&lt;br&gt;
• Every integration adds surface area you have to maintain&lt;/p&gt;

&lt;p&gt;There had to be a simpler way: charge per request, settle on-chain, zero infrastructure.&lt;/p&gt;

&lt;p&gt;The x402 pattern (5 minutes to understand)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Client GETs/POSTs your paid endpoint your server repliHTTP 4022  ** withPAYMENT-REQUIREDED` header (base64 JSON: amount, token, destination, network)&lt;/li&gt;
&lt;li&gt;Client pays on-chain USDC on Base or Solana, ~$0.0001 in fees, confirms in seconds&lt;/li&gt;
&lt;li&gt;Client replays the original request with an x402-receipt header carrying the chain + tx hash&lt;/li&gt;
&lt;li&gt;Your server verifies the receipt on-chain, checks replay, serves the response&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it. Payment and product are one round-trip. No accounts, no keys, no monthly bill.&lt;/p&gt;

&lt;p&gt;What I built (live, test it now)&lt;br&gt;
A pay-per-call AI API + digital shop on Cloudflare Workers:&lt;/p&gt;

&lt;p&gt;• &lt;a href="https://6766587364.lol/api/ai/sentiment" rel="noopener noreferrer"&gt;https://6766587364.lol/api/ai/sentiment&lt;/a&gt; AI sentiment analysis, 0.005 USDC/call. Send any text, get positive/negative/neutral + confidence.&lt;br&gt;
• &lt;a href="https://6766587364.lol/api/ai/classify" rel="noopener noreferrer"&gt;https://6766587364.lol/api/ai/classify&lt;/a&gt; text classification, 0.005 USDC/call&lt;br&gt;
• &lt;a href="https://6766587364.lol/api/ai/image" rel="noopener noreferrer"&gt;https://6766587364.lol/api/ai/image&lt;/a&gt;  AI image generation (Flux on Workers AI), 0.01 USDC/image&lt;br&gt;
• &lt;a href="https://6766587364.lol/api/shop/catalog" rel="noopener noreferrer"&gt;https://6766587364.lol/api/shop/catalog&lt;/a&gt; paid digital downloads (source-code kits, playbooks) from 0.01 USDC&lt;br&gt;
• Free to probe: hit any endpoint with no receipt and you get a clean 402 with the exact price + pay-to addresses. No signup.&lt;/p&gt;

&lt;p&gt;Try it:&lt;br&gt;
bash&lt;br&gt;
curl -X POST &lt;a href="https://6766587364.lol/api/ai/sentiment" rel="noopener noreferrer"&gt;https://6766587364.lol/api/ai/sentiment&lt;/a&gt; \&lt;br&gt;
  -H "Content-Type: application/json" \&lt;br&gt;
  -d '{"text":"I love this"}'&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP 402: payment_required, price 0.005 USDC, pay_to Base + Solana
&lt;/h2&gt;

&lt;p&gt;The full OpenAPI spec (with payment info on every endpoint) is at &lt;code&gt;https://6766587364.lol/openapi.json&lt;/code&gt;  &lt;strong&gt;AI agents can read the price, pay, and use the API entirely on their own.&lt;/strong&gt;.**&lt;/p&gt;

&lt;h2&gt;
  
  
  How it's built (the stack)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare Workers&lt;/strong&gt; as the server (free tier: 100k requests/day)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workers AI&lt;/strong&gt; for inference (free: 10k neurons/day)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KV&lt;/strong&gt; for replay protection (a tx hash can only be redeemed once); &lt;strong&gt;R2&lt;/strong&gt; for file storage (digital downloads)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402&lt;/strong&gt; for the payment protocol receipts verified directly against Bas&lt;code&gt;eth_getTransactionReceipt&lt;/code&gt;pt&lt;code&gt;) and Solan&lt;/code&gt;getParsedTransaction&lt;code&gt;on&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Dual-chain settlement: revenue lands in two static USDC wallets   no hot wallet, no withdrawal step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total infrastructure cost: &lt;strong&gt;$0.&lt;/strong&gt; Every paid call is ~100% margin within the free tier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas I hit (save you hours)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Flux returns JPEG, not PNG.&lt;/strong&gt; Check magic bytes (&lt;code&gt;FF D8 FF&lt;/code&gt;) before setting &lt;code&gt;Content-Type&lt;/code&gt;   I shipped a broken image endpoint because I assumed PNG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Receipt chains contain colons.&lt;/strong&gt; &lt;code&gt;eip155:8453:0xabc @ &lt;/code&gt;   split on*last*last* colon, not the first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replay protection is non-negotiable.&lt;/strong&gt; Without a seen-hash cache, anyone can re-sell your endpoint. One KV read per request, trivial cost, mandatory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache-bust when testing.&lt;/strong&gt; Cloudflare's CDN caches GET responses ~10-15s after deploy; use a unique query param while iterating.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery is half the product.&lt;/strong&gt; An API nobody's agent can find earns nothing. Ship &lt;code&gt;/openapi.json&lt;/code&gt; with &lt;code&gt;x-payment-info&lt;/code&gt;, &lt;code&gt;/llms.txt&lt;/code&gt;, and link headers (&lt;code&gt;ai-manifest&lt;/code&gt;, &lt;code&gt;service-desc&lt;/code&gt;, &lt;code&gt;describedby&lt;/code&gt;) so agents find you, read your price, and pay.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Numbers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;0.005 USDC sentiment calls, 0.01 USDC images verified round-trips on Base mainnet&lt;/li&gt;
&lt;li&gt;Settlement verified on-chain: revenue appears directly in the destination wallet, no intermediary&lt;/li&gt;
&lt;li&gt;~$2.38 already earned from real paid calls during testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Want one?
&lt;/h2&gt;

&lt;p&gt;That's the whole point. If your API or data deserves to be paid for, this is the cheapest way to start. I build these for clients   reference implementation exists, fast turnaround, fixed price. The starter kit (a minimal pay-per-call API you can run in minutes) is available as a paid download from the shop above or DM me.&lt;/p&gt;




</description>
      <category>ai</category>
      <category>webdev</category>
      <category>machinelearning</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
