<?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: cramberries099-bit</title>
    <description>The latest articles on DEV Community by cramberries099-bit (@cramberries099bit).</description>
    <link>https://dev.to/cramberries099bit</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%2F4201100%2F09d54a2a-6806-4c5e-aae8-48f1c5192485.png</url>
      <title>DEV Community: cramberries099-bit</title>
      <link>https://dev.to/cramberries099bit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cramberries099bit"/>
    <language>en</language>
    <item>
      <title>I launched two L402 APIs for AI agents — clean data for 10 sats, mempool forensics for 2,500</title>
      <dc:creator>cramberries099-bit</dc:creator>
      <pubDate>Thu, 22 Oct 2026 19:07:24 +0000</pubDate>
      <link>https://dev.to/cramberries099bit/i-launched-two-l402-apis-for-ai-agents-clean-data-for-10-sats-mempool-forensics-for-2500-1c5d</link>
      <guid>https://dev.to/cramberries099bit/i-launched-two-l402-apis-for-ai-agents-clean-data-for-10-sats-mempool-forensics-for-2500-1c5d</guid>
      <description>&lt;p&gt;AI agents can write code, browse the web and run tools — but the moment they need to &lt;em&gt;pay&lt;/em&gt; for an API, the flow collapses into human infrastructure: signups, API keys, credit cards, monthly plans.&lt;/p&gt;

&lt;p&gt;L402 fixes that. The payment &lt;strong&gt;is&lt;/strong&gt; the credential. So I built two production-light APIs that any agent (or human) can consume autonomously over Bitcoin Lightning, and put them live:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔗 &lt;a href="https://l402-ai-gateway.onrender.com" rel="noopener noreferrer"&gt;https://l402-ai-gateway.onrender.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's for sale
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST /v1/data/clean-scrape&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10 sats&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Takes raw web content and returns clean, structured JSON an LLM can consume directly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST /v1/forensic/mempool-arbitrage-audit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2,500 sats&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Analyzes a real Bitcoin transaction (fee rate, RBF signaling, inputs/outputs, confirmations) using live mempool.space data, and compares live BTC prices across Kraken, Coinbase and Bitstamp to flag arbitrage spreads&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No accounts. No keys. You call, you get a &lt;code&gt;402&lt;/code&gt;, you pay the Lightning invoice, you retry with the proof, you get the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the paywall works
&lt;/h2&gt;

&lt;p&gt;The middleware is protocol-standard, not a custom hack:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Request without payment → &lt;code&gt;402 Payment Required&lt;/code&gt; with a &lt;code&gt;WWW-Authenticate: L402 macaroon="…", invoice="lnbc…"&lt;/code&gt; header (plus the same data as JSON).&lt;/li&gt;
&lt;li&gt;The macaroon is HMAC-chained and attenuated by &lt;strong&gt;endpoint, payment hash, amount and expiry&lt;/strong&gt; — a token bought for the 10-sat endpoint is rejected on the 2,500-sat one.&lt;/li&gt;
&lt;li&gt;Pay the invoice (issued by a real LNbits wallet) → you get the preimage.&lt;/li&gt;
&lt;li&gt;Retry with &lt;code&gt;Authorization: L402 &amp;lt;macaroon&amp;gt;:&amp;lt;preimage&amp;gt;&lt;/code&gt; → the server verifies &lt;code&gt;sha256(preimage) == payment_hash&lt;/code&gt; locally and serves the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It works out of the box with standard tooling like Lightning Labs' &lt;code&gt;lnget&lt;/code&gt; — point it at an endpoint and the pay-and-retry cycle is automatic.&lt;/p&gt;

&lt;p&gt;Discovery is built in too: a machine-readable manifest at &lt;code&gt;/.well-known/l402.json&lt;/code&gt;, public pricing at &lt;code&gt;/pricing&lt;/code&gt;, interactive OpenAPI docs at &lt;code&gt;/docs&lt;/code&gt;, and the service announces itself on Nostr with NIP-89 handler events (kind 31990) so agents can find it without me doing marketing.&lt;/p&gt;

&lt;p&gt;Under the hood: FastAPI, an in-memory TTL cache (repeat calls are cheap), and live upstream data — nothing in the forensic report is mocked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;p&gt;This is a launch, not a victory lap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It runs on a free hosting tier that &lt;strong&gt;sleeps when idle&lt;/strong&gt; — the first call can take a few seconds to wake up.&lt;/li&gt;
&lt;li&gt;The receiving wallet is a &lt;strong&gt;custodial LNbits demo instance&lt;/strong&gt;. Fine for the first sats, not where I'd keep real revenue.&lt;/li&gt;
&lt;li&gt;It currently has &lt;strong&gt;zero paying customers&lt;/strong&gt;. That's why this post exists.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it / break it
&lt;/h2&gt;

&lt;p&gt;The cheapest call costs 10 sats — less than a cent. If you're building agents, trading bots or L402 tooling, I'd genuinely love for you to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hit the endpoint and run the full pay flow.&lt;/li&gt;
&lt;li&gt;Tell me what the output is missing for your use case.&lt;/li&gt;
&lt;li&gt;If it fits, I'm helping the &lt;strong&gt;first 10 builders integrate it for free&lt;/strong&gt; (the calls themselves stay at list price — a real 10-sat payment is the feedback signal I care about).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Docs and manifest are public, the code structure is a standard FastAPI service, and the paywall answers with a real invoice from a real wallet. The machine economy needs services that are actually &lt;em&gt;buyable&lt;/em&gt; by machines — this is my first one.&lt;/p&gt;

&lt;p&gt;What should the third endpoint be?&lt;/p&gt;

</description>
      <category>bitcoin</category>
      <category>lightning</category>
      <category>ai</category>
      <category>api</category>
    </item>
  </channel>
</rss>
