<?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: Damien</title>
    <description>The latest articles on DEV Community by Damien (@damien829).</description>
    <link>https://dev.to/damien829</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%2F3842324%2Fc48549fd-c663-4e18-bf23-f6bc762493d1.png</url>
      <title>DEV Community: Damien</title>
      <link>https://dev.to/damien829</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/damien829"/>
    <language>en</language>
    <item>
      <title>An AI training crawler was 58% of my site's traffic. I charged it $0.001 a page and it left.</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Sun, 15 Nov 2026 17:51:40 +0000</pubDate>
      <link>https://dev.to/damien829/an-ai-training-crawler-was-58-of-my-sites-traffic-i-charged-it-0001-a-page-and-it-left-4oom</link>
      <guid>https://dev.to/damien829/an-ai-training-crawler-was-58-of-my-sites-traffic-i-charged-it-0001-a-page-and-it-left-4oom</guid>
      <description>&lt;p&gt;My database is on a free tier with 5 million reads a day, and it was sitting at 4.8 million. I couldn't figure out why, so I watched live traffic for 75 seconds.&lt;/p&gt;

&lt;p&gt;52 of 89 requests (58%) came from one user agent: &lt;code&gt;ElevenlabsCrawler/1.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;ElevenLabs &lt;a href="https://elevenlabs.io/docs/bots" rel="noopener noreferrer"&gt;documents it&lt;/a&gt; as the crawler that collects content that may be used to train its models. It was walking all 20,000 pages of my catalog one by one. Pages were cached, but a crawler almost never asks for the same page twice, so nearly every visit missed the cache and cost database reads.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;p&gt;I pointed my own pay-per-crawl tool at it. AI crawlers on those pages now get &lt;code&gt;HTTP 402 Payment Required&lt;/code&gt; with a price: $0.001 in USDC, payable over &lt;a href="https://aipaygen.com/x402" rel="noopener noreferrer"&gt;x402&lt;/a&gt;. Pay it and you get the page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;People and Google see exactly the same page as before.&lt;/li&gt;
&lt;li&gt;My home page and docs stay free for every bot, so I still show up in AI answers.&lt;/li&gt;
&lt;li&gt;Crawlers are recognized by user agent, and by the IP ranges their companies publish (OpenAI, Perplexity, DuckDuckGo and Common Crawl publish theirs).&lt;/li&gt;
&lt;li&gt;The 402 says in plain words how to pay, including without a wallet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&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;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ElevenlabsCrawler share of requests&lt;/td&gt;
&lt;td&gt;52 of 89 (58%)&lt;/td&gt;
&lt;td&gt;0 of 49, 20 minutes later; still 0 of 33 an hour later&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database rows read, last 24h&lt;/td&gt;
&lt;td&gt;4.81M&lt;/td&gt;
&lt;td&gt;3.96M and still falling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Paid by the crawler&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Did it pay? No. It stopped. Most crawlers can't pay yet, so right now a price works like a block on free bulk copying, without blocking people, search engines or the AI assistants you want citing you. When agents start carrying wallets, the same response starts earning.&lt;/p&gt;

&lt;p&gt;These are short samples, not a study. The database number is a rolling 24 hours, so it keeps dropping for a day after a change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limit
&lt;/h2&gt;

&lt;p&gt;It only catches bots that say who they are, or that come from IP ranges their company publishes. Anthropic, ByteDance and Meta don't publish theirs. A scraper pretending to be Chrome from some random server still gets the page, same as with robots.txt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Your biggest visitor may not be a person.&lt;/strong&gt; I only found this by reading raw traffic. Most analytics tools hide bots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A crawler's user agent is a calling card.&lt;/strong&gt; ElevenLabs links its bot docs from its user agent, which is how I learned who it was. If you run a bot, do the same.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ul&gt;
&lt;li&gt;Full write-up with the numbers: &lt;a href="https://aipaygen.com/notes/ai-crawler-paywall" rel="noopener noreferrer"&gt;https://aipaygen.com/notes/ai-crawler-paywall&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Check which AI crawlers your site allows: &lt;a href="https://aipaygen.com/ai-crawlers" rel="noopener noreferrer"&gt;https://aipaygen.com/ai-crawlers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Verify whether a "GPTBot" in your logs is real: &lt;a href="https://aipaygen.com/verify-bot" rel="noopener noreferrer"&gt;https://aipaygen.com/verify-bot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The WordPress plugin and Cloudflare, Nginx, Apache, Next.js and Express snippets are open source: &lt;a href="https://github.com/Damien829/pay-per-crawl" rel="noopener noreferrer"&gt;https://github.com/Damien829/pay-per-crawl&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>wordpress</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to charge AI crawlers per page with HTTP 402 (and keep your site free for people)</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Sun, 15 Nov 2026 04:16:41 +0000</pubDate>
      <link>https://dev.to/damien829/how-to-charge-ai-crawlers-per-page-with-http-402-and-keep-your-site-free-for-people-15af</link>
      <guid>https://dev.to/damien829/how-to-charge-ai-crawlers-per-page-with-http-402-and-keep-your-site-free-for-people-15af</guid>
      <description>&lt;p&gt;If you run a website, a growing share of your traffic isn't people. It's AI crawlers: GPTBot, ClaudeBot, PerplexityBot, Bytespider and a long tail of others, fetching pages to train models or answer questions.&lt;/p&gt;

&lt;p&gt;Until now you had two choices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Let them in for free.&lt;/strong&gt; You pay the bandwidth; they get the content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block them in robots.txt.&lt;/strong&gt; You save the bandwidth, and you disappear from AI answers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This post shows a third option: &lt;strong&gt;answer them with &lt;code&gt;402 Payment Required&lt;/code&gt; and a price&lt;/strong&gt;, so a crawler that wants the page can pay a fraction of a cent for it, straight to your wallet. People and search engines see no difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  The status code that waited 28 years
&lt;/h2&gt;

&lt;p&gt;HTTP has had &lt;code&gt;402 Payment Required&lt;/code&gt; since 1997, marked "reserved for future use". The web never used it because charging a cent was impossible: a card payment costs around 30 cents plus a percentage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aipaygen.com/x402" rel="noopener noreferrer"&gt;x402&lt;/a&gt; finally gives 402 a working flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ask.&lt;/strong&gt; The client sends a normal request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Price.&lt;/strong&gt; The server answers &lt;code&gt;402&lt;/code&gt; with a &lt;code&gt;payment-required&lt;/code&gt; header: amount, token (USDC), network (Base), the wallet to pay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay.&lt;/strong&gt; The client signs a payment authorization for exactly that amount and retries the same request with it attached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deliver.&lt;/strong&gt; A facilitator verifies the signature and settles it on-chain in about a second; the server returns the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No accounts, no API keys, no subscriptions. That's exactly what an automated client needs.&lt;/p&gt;

&lt;p&gt;You can see a real 402 quote from your browser on &lt;a href="https://aipaygen.com/x402#demo" rel="noopener noreferrer"&gt;this demo page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: route AI crawlers to a payment gateway, on the same URL
&lt;/h2&gt;

&lt;p&gt;The site itself shouldn't have to implement payments. So the setup is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requests from known AI crawlers (or anything already carrying an x402 payment) are passed to a gateway.&lt;/li&gt;
&lt;li&gt;Unpaid, the gateway answers with your price.&lt;/li&gt;
&lt;li&gt;Paid, the gateway verifies the payment, fetches the page from your site with a secret header, settles the payment to &lt;strong&gt;your&lt;/strong&gt; wallet, and returns the page.&lt;/li&gt;
&lt;li&gt;Everyone else is served by your site as usual.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The money goes crawler -&amp;gt; your wallet. If your site errors, nobody is charged.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code: a Cloudflare Worker
&lt;/h2&gt;

&lt;p&gt;If your site is on Cloudflare, put this Worker on your site's route:&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;// Pay-per-crawl. Set the secret: npx wrangler secret put AIPAYGEN_SECRET&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;GATEWAY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://aipaygen.com/g/&amp;lt;your-route-id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;AI_BOTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;GPTBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="no"&gt;OAI&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;SearchBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;ChatGPT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;ClaudeBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;Claude&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;PerplexityBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;CCBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;Bytespider&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;Amazonbot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;externalagent&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nb"&gt;fetch&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;env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The gateway fetching a page it was paid for: serve it.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;AIPAYGEN_SECRET&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&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;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="s2"&gt;"x-aipaygen-gateway-secret"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;AIPAYGEN_SECRET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;fetch&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;paying&lt;/span&gt; &lt;span class="o"&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;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="s2"&gt;"payment-signature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&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;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="s2"&gt;"x-payment"&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="o"&gt;!&lt;/span&gt;&lt;span class="no"&gt;AI_BOTS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&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;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="s2"&gt;"user-agent"&lt;/span&gt;&lt;span class="p"&gt;)&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="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;paying&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;fetch&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="c1"&gt;// people browse free&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&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;url&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="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;GATEWAY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;search&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&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;req&lt;/span&gt;&lt;span class="p"&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;headers&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;headers&lt;/span&gt;&lt;span class="p"&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;req&lt;/span&gt;&lt;span class="p"&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;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;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The full list of crawlers is longer; the page linked below has it.)&lt;/p&gt;

&lt;p&gt;Three details worth calling out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The secret header closes the loop.&lt;/strong&gt; Without it, a crawler could hit your origin directly with a browser user agent. With it, your origin only serves gateway traffic that has been paid for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search engines are not on the list.&lt;/strong&gt; Googlebot and Bingbot aren't AI-training crawlers, so your rankings don't change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same URL, both ways.&lt;/strong&gt; A crawler that understands x402 just retries the URL it asked for with a payment. Nothing special to discover.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The code: Express
&lt;/h2&gt;

&lt;p&gt;Not on Cloudflare? The same thing as middleware (Node 18+):&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="no"&gt;GATEWAY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://aipaygen.com/g/&amp;lt;your-route-id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;AI_BOTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;GPTBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;ClaudeBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;PerplexityBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;CCBot&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;Bytespider&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&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;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;AIPAYGEN_SECRET&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;req&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="s2"&gt;"x-aipaygen-gateway-secret"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;AIPAYGEN_SECRET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;next&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;paying&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&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="s2"&gt;"payment-signature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;req&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="s2"&gt;"x-payment"&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="o"&gt;!&lt;/span&gt;&lt;span class="no"&gt;AI_BOTS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&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="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"user-agent"&lt;/span&gt;&lt;span class="p"&gt;)&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="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;paying&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;next&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="kd"&gt;const&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="p"&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;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;GATEWAY&lt;/span&gt; &lt;span class="o"&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;originalUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&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="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"content-encoding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content-length"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"transfer-encoding"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&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;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&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;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&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;arrayBuffer&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;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;
  
  
  Getting a route id
&lt;/h2&gt;

&lt;p&gt;I built this as a free gateway, &lt;a href="https://aipaygen.com" rel="noopener noreferrer"&gt;AIPayGen&lt;/a&gt;. On the &lt;a href="https://aipaygen.com/pay-per-crawl" rel="noopener noreferrer"&gt;pay-per-crawl page&lt;/a&gt; you enter your site, a price per page and your wallet address on Base, and it gives you the route plus the Worker code with your id filled in. No fees from us; the payment goes directly to you.&lt;/p&gt;

&lt;p&gt;Then check it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -i -A GPTBot https://your-site.com/
&lt;span class="c"&gt;# HTTP/2 402&lt;/span&gt;
&lt;span class="c"&gt;# payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Honest limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User agents can be spoofed.&lt;/strong&gt; A crawler that pretends to be Chrome gets the free page, same as with robots.txt. This targets the crawlers that identify themselves, which is most of the big ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Most crawlers can't pay yet.&lt;/strong&gt; Today this mostly works like a block with a price tag. But agent frameworks are adding x402 support quickly, and this gives them a way to say yes instead of being shut out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You need a wallet on Base&lt;/strong&gt; to receive USDC.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it, I'd love to hear which crawlers hit your site the most and what price per page feels fair.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update: how many sites block AI crawlers?
&lt;/h2&gt;

&lt;p&gt;I checked the robots.txt of 60 well-known sites against 27 AI crawlers. Of the 53 whose robots.txt could be read, &lt;strong&gt;70% block at least one AI crawler&lt;/strong&gt; and 5 block all 27. News sites block 17 of 27 on average; Reddit, X, Facebook and Instagram block all of them; developer sites like GitHub and dev.to block almost none. Bytespider, CCBot and ClaudeBot are tied as the most blocked.&lt;/p&gt;

&lt;p&gt;Full data, by site type and by crawler: &lt;a href="https://aipaygen.com/state-of-ai-crawlers" rel="noopener noreferrer"&gt;State of AI crawler blocking&lt;/a&gt;. You can check your own site there too, or build a robots.txt with the &lt;a href="https://aipaygen.com/robots-txt-generator" rel="noopener noreferrer"&gt;AI crawler robots.txt generator&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>ai</category>
      <category>webscraping</category>
    </item>
    <item>
      <title>Give your AI agent a budget, an approval button and a morning routine (with plain HTTP)</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Sun, 15 Nov 2026 03:58:47 +0000</pubDate>
      <link>https://dev.to/damien829/give-your-ai-agent-a-budget-an-approval-button-and-a-morning-routine-with-plain-http-33aj</link>
      <guid>https://dev.to/damien829/give-your-ai-agent-a-budget-an-approval-button-and-a-morning-routine-with-plain-http-33aj</guid>
      <description>&lt;p&gt;Once an agent does real work, three questions come up fast:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How does it pay for an API without me signing up for everything?&lt;/li&gt;
&lt;li&gt;How does it ask me before doing something risky?&lt;/li&gt;
&lt;li&gt;How do I cap what it can spend?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This tutorial sets all three up with AIPayGen (disclosure: my project) using only &lt;code&gt;curl&lt;/code&gt;. It works the same from Python, JavaScript or any MCP client.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get a free key
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response includes &lt;code&gt;api_key&lt;/code&gt; (starts with &lt;code&gt;apg_&lt;/code&gt;), shown only once. Save it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;APG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;apg_your_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key comes with a small trial credit, and the cheapest tools give a few free calls a day. Agents with their own wallet can skip keys entirely and pay per call with x402 (USDC on Base).&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Call a tool
&lt;/h2&gt;

&lt;p&gt;Every tool is &lt;code&gt;POST /v1/&amp;lt;tool name&amp;gt;&lt;/code&gt; with a JSON body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/dns_lookup \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APG"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"domain":"example.com"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are 95 tools: web and company data, crypto and markets, reference data, and AI text and media. The full list with prices is at &lt;a href="https://aipaygen.com/docs" rel="noopener noreferrer"&gt;aipaygen.com/docs&lt;/a&gt;. A failed call is never charged.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Give each agent its own key and a daily limit
&lt;/h2&gt;

&lt;p&gt;Instead of handing every agent your main key, create one key per agent with a cap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/keys/agents \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APG"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"label":"research-bot","daily_cap_usd":0.02,"fund_usd":0.03}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fund_usd&lt;/code&gt; moves credit from your key to the agent's (the trial credit is small, so top up by card on the site for real use). The agent gets its own &lt;code&gt;api_key&lt;/code&gt;. When it reaches its daily limit, its calls are refused with &lt;code&gt;DAILY_CAP_REACHED&lt;/code&gt; until the next UTC day. Only the owner key can change the limit, pause the agent or take credit back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X PATCH https://aipaygen.com/v1/keys/agents/AGENT_ID \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APG"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"paused":true}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Ask before acting
&lt;/h2&gt;

&lt;p&gt;When the agent is about to do something you'd want to approve, it calls &lt;code&gt;ask_human&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/ask_human \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $AGENT_KEY"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"question":"Renew the example.com domain for $12?","details":"It expires in 9 days."}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get a push in the AIPayGen app on your phone (more on that below) with Approve and Deny. To also reach you on Telegram, Discord, Slack or ntfy, add &lt;code&gt;"notify": {"channel": "...", "target": "..."}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The response has an &lt;code&gt;id&lt;/code&gt; and a &lt;code&gt;status_token&lt;/code&gt;. The agent checks the answer for free:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/ask_status \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"id":"ID","status_token":"STATUS_TOKEN"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The status is &lt;code&gt;pending&lt;/code&gt;, &lt;code&gt;answered&lt;/code&gt; (with your choice) or &lt;code&gt;expired&lt;/code&gt;. Or pass a &lt;code&gt;webhook&lt;/code&gt; and the answer is POSTed to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Add a morning routine
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;schedule_create&lt;/code&gt; runs any tool on repeat and sends the result to your app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/schedule_create \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APG"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"tool":"news_search","input":{"query":"x402 payments","timespan":"1d","limit":10},"every_minutes":1440,"start_at":"2026-12-01T08:00:00Z","deliver":{"channel":"app"}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each run is billed at the tool's normal price. If the key runs out of credit, the routine pauses instead of failing over and over.&lt;/p&gt;

&lt;p&gt;For "tell me when something changes", use &lt;code&gt;watch_create&lt;/code&gt;: a site goes down, a page changes, a domain nears expiry, or a coin crosses a price. Checks that find nothing cost nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Install the phone app
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://aipaygen.com/app" rel="noopener noreferrer"&gt;aipaygen.com/app&lt;/a&gt; on your phone, sign in with your key, and add it to your Home Screen (on iPhone: Share → Add to Home Screen, iOS 16.4 or later for push). From there you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;approve or deny your agents' questions&lt;/li&gt;
&lt;li&gt;see alerts and routine results&lt;/li&gt;
&lt;li&gt;see spending per agent and change limits&lt;/li&gt;
&lt;li&gt;ask the built-in assistant to set things up ("alert me if ETH goes above 5000")&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Using it from Claude, Cursor or another MCP client
&lt;/h2&gt;

&lt;p&gt;Add &lt;code&gt;https://mcp.aipaygen.com/mcp&lt;/code&gt; as a remote MCP server. Every tool above shows up, including &lt;code&gt;ask_human&lt;/code&gt;, &lt;code&gt;schedule_create&lt;/code&gt; and &lt;code&gt;watch_create&lt;/code&gt;.&lt;/p&gt;




&lt;p&gt;That's the whole loop: the agent pays per call, asks before risky steps, runs on a timer, and can't spend past its limit. I'd like to hear what you'd automate first, and what's missing. &lt;a href="https://aipaygen.com" rel="noopener noreferrer"&gt;aipaygen.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Running a pay-per-call API platform on Cloudflare's free plan: what the limits taught me</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Sun, 15 Nov 2026 03:58:15 +0000</pubDate>
      <link>https://dev.to/damien829/running-a-pay-per-call-api-platform-on-cloudflares-free-plan-what-the-limits-taught-me-5h9o</link>
      <guid>https://dev.to/damien829/running-a-pay-per-call-api-platform-on-cloudflares-free-plan-what-the-limits-taught-me-5h9o</guid>
      <description>&lt;p&gt;AIPayGen is my side project: a platform where AI agents pay per call for tools (DNS lookups, crypto prices, page-to-Markdown, weather and about 90 more), ask their owner for approval, and run routines on a timer. Disclosure: I built it, and it's early. There's no real revenue yet.&lt;/p&gt;

&lt;p&gt;The first version ran on a Raspberry Pi 5 on my desk: Flask, SQLite and a Cloudflare tunnel. This version is a rebuild with one rule: hosting costs $0. Here's how that works and which limits actually mattered.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One Cloudflare Worker&lt;/strong&gt; (TypeScript, Hono) serves the website, the HTTP API, an MCP server, a small phone app and the cron jobs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D1&lt;/strong&gt; (Cloudflare's SQLite) holds keys, credits, the billing log, the marketplace catalog, watches and schedules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workers AI&lt;/strong&gt; runs open models (Llama 3.3 70B for the assistant, smaller ones for text tools).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402&lt;/strong&gt; handles payments: an unpaid call gets HTTP 402 with the price, and the agent retries with a signed USDC payment on Base in a header. No account needed. Prepaid credits on an API key work too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limit 1: rows written, not CPU
&lt;/h2&gt;

&lt;p&gt;I expected the 10 ms CPU limit per request to hurt. It didn't. Most work is waiting on fetches, which doesn't count.&lt;/p&gt;

&lt;p&gt;What hurt was &lt;strong&gt;D1's 100,000 rows written per day&lt;/strong&gt;. I hit it once, and every write failed until midnight UTC. The surprises:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Indexes multiply writes.&lt;/strong&gt; Updating a row also rewrites every index entry that covers a changed column. A &lt;code&gt;last_checked_at&lt;/code&gt; column with an index cost two or three writes per check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full-text search is expensive.&lt;/strong&gt; Re-upserting a catalog entry deleted and re-inserted its FTS row even when nothing changed. Now the upsert skips FTS unless the name, description or category changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotating by primary key beats a "last checked" column.&lt;/strong&gt; The watch runner keeps one cursor in a small key-value table and scans the next slice by id. That's one write per run instead of one per row.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Next slice of watches after the cursor, wrapping to the start.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s2"&gt;"SELECT * FROM watches WHERE id &amp;gt; ? ORDER BY id LIMIT ?"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perRun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&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;p&gt;Rule of thumb: before adding a column you update often, count the writes it costs per day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 2: 50 subrequests per request
&lt;/h2&gt;

&lt;p&gt;Composite tools (a "wallet report" that calls a sanctions check, balances and labels) can fan out fast. Each sub-call gets a deadline and a budget, and a report that can't run its safety check fails instead of returning half an answer. The caller isn't charged for a failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 3: some APIs block Cloudflare's IPs
&lt;/h2&gt;

&lt;p&gt;A few public APIs return 429 or 402 to every request from Workers IPs. A tiny relay on another free tier fixed some of them. For the rest, the tool is marked down rather than left to fail at random.&lt;/p&gt;

&lt;h2&gt;
  
  
  Charging only for calls that worked
&lt;/h2&gt;

&lt;p&gt;x402 splits payment into &lt;strong&gt;verify&lt;/strong&gt; and &lt;strong&gt;settle&lt;/strong&gt;. The Worker verifies the signed payment, runs the tool, and settles only if the tool succeeded. A failed call never moves money, so there are no refunds to handle.&lt;/p&gt;

&lt;p&gt;The same split powers a &lt;strong&gt;gateway&lt;/strong&gt; for sellers: point it at your HTTPS API and get a pay-per-call URL. It settles only when your API returns 2xx, and it pins every request to your base path. Decoding the path before checking it matters: &lt;code&gt;%2e%2e&lt;/code&gt; is &lt;code&gt;..&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The owner side
&lt;/h2&gt;

&lt;p&gt;The part I use myself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ask_human&lt;/code&gt;: the agent asks me a question with buttons, and the push reaches my phone.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;schedule_create&lt;/code&gt;: "news on these topics every morning", delivered to the app.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;watch_create&lt;/code&gt;: site down, page changed, domain expiring, price crossed.&lt;/li&gt;
&lt;li&gt;One key per agent, each with a daily spending limit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Web push from a Worker works without a library: a VAPID JWT signed with WebCrypto (ES256) and a payloadless push. The service worker then fetches the inbox itself.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://aipaygen.com/v1/dns_lookup \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; -d &lt;span class="s1"&gt;'{"domain":"example.com"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MCP: &lt;code&gt;https://mcp.aipaygen.com/mcp&lt;/code&gt; · docs: &lt;a href="https://aipaygen.com/docs" rel="noopener noreferrer"&gt;aipaygen.com/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've run something real on D1's free plan, I'd like to hear what limit you hit first.&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>serverless</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Built an AI Agent Marketplace — 142 Agents, 27 Categories, Creators Keep 70%</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Fri, 03 Apr 2026 01:19:25 +0000</pubDate>
      <link>https://dev.to/damien829/i-built-an-ai-agent-marketplace-142-agents-27-categories-creators-keep-70-3dli</link>
      <guid>https://dev.to/damien829/i-built-an-ai-agent-marketplace-142-agents-27-categories-creators-keep-70-3dli</guid>
      <description>&lt;p&gt;There's no good place to sell AI agents. So I built one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aipaygen.com/market" rel="noopener noreferrer"&gt;AiPayGen&lt;/a&gt; is a marketplace where developers list AI agents, set their own prices, and keep &lt;strong&gt;70% of every sale&lt;/strong&gt;. We handle billing, distribution, and escrow.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's live right now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;142 agents&lt;/strong&gt; across &lt;strong&gt;27 categories&lt;/strong&gt; — finance, legal, healthcare, education, DevOps, security, marketing, ecommerce, data engineering, and more&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;81,000+ total API calls&lt;/strong&gt; processed&lt;/li&gt;
&lt;li&gt;Agents that trade, research, code, scrape, translate, analyze, and create&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Browse: &lt;a href="https://aipaygen.com/market" rel="noopener noreferrer"&gt;aipaygen.com/market&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  For buyers — try any agent instantly
&lt;/h2&gt;

&lt;p&gt;Every agent works through MCP (Model Context Protocol) or REST API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then inside Claude Code, Cursor, or any MCP client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; list_marketplace category="finance"
&amp;gt; invoke_catalog_api agent_id="trading-bot-pro"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free key gives you &lt;strong&gt;$0.10 credits&lt;/strong&gt; to test agents. No credit card needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  For creators — list your agent in 5 minutes
&lt;/h2&gt;

&lt;p&gt;If you've built something useful — a coding assistant, a research bot, a data pipeline — list it and start earning:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://aipaygen.com/market/list" rel="noopener noreferrer"&gt;aipaygen.com/market/list&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Set your price (per call or subscription)&lt;/li&gt;
&lt;li&gt;We handle Stripe billing + USDC escrow&lt;/li&gt;
&lt;li&gt;You get &lt;strong&gt;70% of every transaction&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Seller analytics dashboard tracks your revenue, calls, ratings, and trends in real time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes this different
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Agents hire agents.&lt;/strong&gt; The A2A (Agent-to-Agent) protocol lets agents discover, negotiate with, and pay other agents autonomously. Your agent can subcontract work to specialized agents in the marketplace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three payment rails:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; — credit card, subscriptions ($4.99 / $19.99 / $49.99)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credit packs&lt;/strong&gt; — prepaid from $0.50&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402 USDC&lt;/strong&gt; — pay per call with crypto on Base, Solana, or Stellar. No account needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Enterprise ready (v1.10.0):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Usage-based billing with per-call metering&lt;/li&gt;
&lt;li&gt;Team management with roles (owner/admin/member)&lt;/li&gt;
&lt;li&gt;IP allowlisting, key rotation, audit trails&lt;/li&gt;
&lt;li&gt;Budget alerts with 14-day cost forecasting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Categories
&lt;/h2&gt;

&lt;p&gt;Finance | Legal | Healthcare | Education | DevOps | Security | Marketing | Productivity | Ecommerce | Design | Data Engineering | Science | Communication | Gaming | Real Estate | and 12 more&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Browse agents&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://api.aipaygen.com/marketplace/list?category=finance"&lt;/span&gt;

&lt;span class="c"&gt;# Free data agents (no key needed)&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://api.aipaygen.com/data/crypto?symbols=bitcoin"&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://api.aipaygen.com/data/weather?city=NYC"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Marketplace:&lt;/strong&gt; &lt;a href="https://aipaygen.com/market" rel="noopener noreferrer"&gt;aipaygen.com/market&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;List your agent:&lt;/strong&gt; &lt;a href="https://aipaygen.com/market/list" rel="noopener noreferrer"&gt;aipaygen.com/market/list&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Damien829/aipaygen" rel="noopener noreferrer"&gt;github.com/Damien829/aipaygen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://aipaygen.com/docs" rel="noopener noreferrer"&gt;aipaygen.com/docs&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MIT licensed. Open source. 1,465 tests passing.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What kind of agent would you list? Drop a comment.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>python</category>
      <category>marketplace</category>
    </item>
    <item>
      <title>The Cheapest Way to Add AI to Your Project in 2026</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Fri, 27 Mar 2026 03:36:44 +0000</pubDate>
      <link>https://dev.to/damien829/the-cheapest-way-to-add-ai-to-your-project-in-2026-20pb</link>
      <guid>https://dev.to/damien829/the-cheapest-way-to-add-ai-to-your-project-in-2026-20pb</guid>
      <description>&lt;p&gt;If you just need to add summarization, translation, sentiment analysis, or research capabilities to your project, you don't need to manage API keys for five different providers, handle model selection, or build prompt templates. Here's the cheapest way I've found to do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1: MCP server (for Claude Code / Cursor / Cline users)
&lt;/h2&gt;

&lt;p&gt;If you're already using an AI coding assistant, you can add 65+ tools in two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Cursor or Cline, add this to your MCP config:&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="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"aipaygen"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"aipaygen-mcp"&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;p&gt;Once connected, your assistant can call tools like &lt;code&gt;research&lt;/code&gt;, &lt;code&gt;summarize&lt;/code&gt;, &lt;code&gt;translate&lt;/code&gt;, &lt;code&gt;sentiment&lt;/code&gt;, &lt;code&gt;scrape_website&lt;/code&gt;, and dozens more — directly from your IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: REST API (for any project)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get a free API key&lt;/span&gt;
curl -s -X POST https://api.aipaygen.com/auth/generate-key \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"label":"my-app"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then call any tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Summarize text&lt;/span&gt;
curl -X POST https://api.aipaygen.com/summarize \
  -H &lt;span class="s2"&gt;"Authorization: Bearer apk_YOUR_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"text": "Your long text here...", "length": "short"}'&lt;/span&gt;

&lt;span class="c"&gt;# Analyze sentiment&lt;/span&gt;
curl -X POST https://api.aipaygen.com/sentiment \
  -H &lt;span class="s2"&gt;"Authorization: Bearer apk_YOUR_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"text": "I love this product but the shipping was terrible"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Python:&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="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="no"&gt;API_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"apk_YOUR_KEY"&lt;/span&gt;
&lt;span class="no"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://api.aipaygen.com"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;summarize&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;length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"short"&lt;/span&gt;&lt;span class="p"&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="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{BASE}/summarize"&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="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {API_KEY}"&lt;/span&gt;&lt;span class="p"&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="s2"&gt;"text"&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="s2"&gt;"length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;length&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;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="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Your very long article text goes here..."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"summary"&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 pricing comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Direct API cost&lt;/th&gt;
&lt;th&gt;AiPayGen cost&lt;/th&gt;
&lt;th&gt;Savings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Summarize 1000 words&lt;/td&gt;
&lt;td&gt;~0.01-0.03 (GPT-4o)&lt;/td&gt;
&lt;td&gt;0.006&lt;/td&gt;
&lt;td&gt;40-80%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sentiment analysis&lt;/td&gt;
&lt;td&gt;~0.005-0.01&lt;/td&gt;
&lt;td&gt;0.006&lt;/td&gt;
&lt;td&gt;Comparable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Translate a paragraph&lt;/td&gt;
&lt;td&gt;~0.008-0.02&lt;/td&gt;
&lt;td&gt;0.006&lt;/td&gt;
&lt;td&gt;25-70%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Research a topic&lt;/td&gt;
&lt;td&gt;~0.05-0.15&lt;/td&gt;
&lt;td&gt;0.006&lt;/td&gt;
&lt;td&gt;88-96%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web scraping&lt;/td&gt;
&lt;td&gt;Custom infra&lt;/td&gt;
&lt;td&gt;0.01&lt;/td&gt;
&lt;td&gt;No comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Where AiPayGen is genuinely cheaper:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No managing multiple API keys&lt;/li&gt;
&lt;li&gt;Automatic model routing (best model per task)&lt;/li&gt;
&lt;li&gt;No prompt engineering — optimized templates built in&lt;/li&gt;
&lt;li&gt;Scraping, memory, and utility tools have no direct equivalent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where going direct might be better:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Very short inputs where token cost would be under 0.001&lt;/li&gt;
&lt;li&gt;You need fine-grained model parameter control&lt;/li&gt;
&lt;li&gt;You're already committed to one provider with volume pricing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;The fastest path:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;pip install aipaygen-mcp &amp;amp;&amp;amp; claude mcp add aipaygen -- aipaygen-mcp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;In Claude Code: "Use the generate_api_key tool"&lt;/li&gt;
&lt;li&gt;&lt;code&gt;export AIPAYGEN_API_KEY=apk_your_key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Start using tools&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Trial credits included, no card needed. After that, credits from one dollar via Stripe.&lt;/p&gt;

&lt;p&gt;Docs: &lt;a href="https://aipaygen.com/docs" rel="noopener noreferrer"&gt;aipaygen.com/docs&lt;/a&gt;&lt;br&gt;
Pricing: &lt;a href="https://aipaygen.com/pricing" rel="noopener noreferrer"&gt;aipaygen.com/pricing&lt;/a&gt;&lt;br&gt;
Free tools (no key): &lt;a href="https://api.aipaygen.com/free/time" rel="noopener noreferrer"&gt;api.aipaygen.com/free/time&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
    </item>
    <item>
      <title>How I Built 65+ AI Tools on a Raspberry Pi 5</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Fri, 27 Mar 2026 03:35:45 +0000</pubDate>
      <link>https://dev.to/damien829/how-i-built-65-ai-tools-on-a-raspberry-pi-5-22h</link>
      <guid>https://dev.to/damien829/how-i-built-65-ai-tools-on-a-raspberry-pi-5-22h</guid>
      <description>&lt;p&gt;There's a gap in the MCP ecosystem that bothered me. If you want to give your AI coding assistant access to tools — web scraping, research, translation, agent memory — you either build everything yourself or cobble together a dozen different services. I wanted one MCP server that handled all of it.&lt;/p&gt;

&lt;p&gt;So I built AiPayGen: 65+ tools, installable with &lt;code&gt;pip install aipaygen-mcp&lt;/code&gt;, running on a Raspberry Pi 5 sitting on my desk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) is how AI assistants like Claude Code, Cursor, and Cline access external tools. The protocol is solid, but the tool ecosystem is fragmented. Most MCP servers offer one thing — a file reader, a web search wrapper, a database connector. If you want a full toolkit, you're managing ten different MCP servers.&lt;/p&gt;

&lt;p&gt;I wanted a single &lt;code&gt;pip install&lt;/code&gt; that gives an AI assistant access to research, writing, code generation, web scraping, data feeds, agent memory, and workflow orchestration. One server, one API key, one bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;

&lt;p&gt;The production stack is deliberately simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hardware:&lt;/strong&gt; Raspberry Pi 5, overclocked to 2.7GHz, with an NVMe SSD in a Pironman 5 case&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Flask application with modular route blueprints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; SQLite for user metadata, billing, agent memory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP transport:&lt;/strong&gt; FastMCP with streamable-http, built on MCP SDK 1.26&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tunnel:&lt;/strong&gt; Cloudflare tunnel for HTTPS ingress&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package:&lt;/strong&gt; Published to PyPI as &lt;code&gt;aipaygen-mcp&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the key architectural insight: the Pi doesn't run AI models. It routes requests. When you call the &lt;code&gt;research&lt;/code&gt; tool, the Pi validates your API key, checks your balance, selects the best upstream model for the task (from 15 models across 7 providers), forwards the request, and deducts the cost.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User's IDE (Claude Code / Cursor / Cline)
    ↓ MCP protocol
AiPayGen MCP Server (local pip package)
    ↓ HTTPS
Flask API on Pi 5 (Cloudflare tunnel)
    ↓ Routes to best model
OpenAI / Anthropic / Google / DeepSeek / Mistral / Grok
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The tools
&lt;/h2&gt;

&lt;p&gt;The 65+ tools break down into categories:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI tools (40+):&lt;/strong&gt; Research, summarize, write, translate, code, analyze, sentiment, classify, extract, compare, explain, plan, decide, debate, proofread, rewrite, pitch, headline, keywords, outline, and more. Each tool has a specific prompt template optimized for its task, and the router picks the best model automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://api.aipaygen.com/summarize \
  -H &lt;span class="s2"&gt;"Authorization: Bearer apk_YOUR_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"text": "Your long article text here...", "length": "short"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Web scraping (6 tools):&lt;/strong&gt; Google Maps businesses, Twitter/X posts, Instagram profiles, TikTok videos, YouTube transcripts, and generic website scraping.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent infrastructure:&lt;/strong&gt; Persistent memory (key-value with full-text search), agent-to-agent messaging, shared task boards, a knowledge base with RAG search, and a skills marketplace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free data feeds:&lt;/strong&gt; Weather, crypto prices, exchange rates, holidays. No API key needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://api.aipaygen.com/data/weather?city=London"&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://api.aipaygen.com/data/crypto?symbols=bitcoin,ethereum"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The x402 payment experiment
&lt;/h2&gt;

&lt;p&gt;Alongside traditional Stripe billing, I integrated the x402 protocol for HTTP-native micropayments. You make an API call, the server responds with HTTP 402 and includes the price in the headers. Your client signs a USDC transaction and retries with a payment receipt. No signup, no API key, no account. Just a crypto wallet.&lt;/p&gt;

&lt;p&gt;In practice, most users still prefer Stripe. But the x402 integration has real potential for agent-to-agent commerce where there's no human to enter a credit card.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges and what I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Model routing is harder than it sounds.&lt;/strong&gt; Different models are better at different tasks. I built a routing layer that picks the model based on the tool being called, but there's room for improvement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scraping is a maintenance nightmare.&lt;/strong&gt; Platforms change their markup regularly. Budget significant time for maintenance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQLite is underrated for this scale.&lt;/strong&gt; SQLite with WAL mode handles concurrent reads fine. Having the database as a single file makes backups trivial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MCP is a genuine distribution channel.&lt;/strong&gt; People discover tools through their IDE. The friction is dramatically lower than traditional API integration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Pi 5 is surprisingly capable.&lt;/strong&gt; Four months later, it's still handling production traffic at 2.7GHz. The NVMe SSD was the critical upgrade.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two commands, free trial credits, no card needed. If you find it useful, I'd like to hear about it. If you don't, I'd really like to hear about that — the honest feedback is more valuable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://aipaygen.com" rel="noopener noreferrer"&gt;aipaygen.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://aipaygen.com/docs" rel="noopener noreferrer"&gt;aipaygen.com/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/Damien829/aipaygen" rel="noopener noreferrer"&gt;github.com/Damien829/aipaygen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/aipaygen-mcp/" rel="noopener noreferrer"&gt;pypi.org/project/aipaygen-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>I built a 250-tool AI API on a Raspberry Pi 5 — architecture, economics, and what I learned</title>
      <dc:creator>Damien</dc:creator>
      <pubDate>Wed, 25 Mar 2026 00:05:43 +0000</pubDate>
      <link>https://dev.to/damien829/i-built-a-250-tool-ai-api-on-a-raspberry-pi-5-architecture-economics-and-what-i-learned-4j1h</link>
      <guid>https://dev.to/damien829/i-built-a-250-tool-ai-api-on-a-raspberry-pi-5-architecture-economics-and-what-i-learned-4j1h</guid>
      <description>&lt;p&gt;Six months ago I started building an AI tool API in my apartment. The idea: I was paying $60/month across OpenAI, Anthropic, and various scraping tools — using maybe 2% of what I paid for. Why isn't there a pay-per-call option?&lt;/p&gt;

&lt;p&gt;So I built one. &lt;strong&gt;AiPayGen&lt;/strong&gt; is a single API with 250+ pre-built tools and 15 AI models from 7 providers. You call &lt;code&gt;/research&lt;/code&gt;, &lt;code&gt;/scrape_website&lt;/code&gt;, &lt;code&gt;/sentiment&lt;/code&gt;, &lt;code&gt;/translate&lt;/code&gt; — not raw model completions. Pay per call, starting at $0.004.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client -&amp;gt; Cloudflare Tunnel -&amp;gt; Gunicorn (2 workers, 4 threads)
  -&amp;gt; Flask app -&amp;gt; Model Router -&amp;gt; [Anthropic|OpenAI|Google|DeepSeek|xAI|Together]
  -&amp;gt; SQLite (WAL mode) for everything: auth, billing, memory, job queue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why SQLite?&lt;/strong&gt; One file, zero config, WAL mode handles concurrent reads. At my scale (&amp;lt; 1000 req/day), it outperforms Postgres by eliminating network round trips. The entire billing system is atomic deductions in SQLite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Flask?&lt;/strong&gt; I know it. Shipping speed &amp;gt; perfect architecture for a solo project.&lt;/p&gt;

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

&lt;p&gt;Each tool maps to a model tier. Summarization uses Haiku (cheap, fast). Research synthesis uses Sonnet or GPT-4o. The router:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checks if user specified a model&lt;/li&gt;
&lt;li&gt;If not, picks best model for the task&lt;/li&gt;
&lt;li&gt;Checks circuit breaker (3 failures in 5 min = skip provider)&lt;/li&gt;
&lt;li&gt;Makes the call with timeout&lt;/li&gt;
&lt;li&gt;On failure, retries on fallback chain&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fallback chains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anthropic -&amp;gt; OpenAI&lt;/li&gt;
&lt;li&gt;OpenAI -&amp;gt; Anthropic&lt;/li&gt;
&lt;li&gt;DeepSeek -&amp;gt; Together AI&lt;/li&gt;
&lt;li&gt;Google -&amp;gt; Anthropic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Response caching: 5-minute TTL on deterministic requests. Saves ~15-20% of API costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  x402 Payments — AI Agents Paying Per-Call
&lt;/h2&gt;

&lt;p&gt;This is the most interesting part. &lt;a href="https://github.com/coinbase/x402" rel="noopener noreferrer"&gt;x402&lt;/a&gt; is a protocol where AI agents pay per HTTP request using USDC stablecoins on Base (Ethereum L2).&lt;/p&gt;

&lt;p&gt;When an agent hits a 402 endpoint without an API key, the server responds with payment requirements. The agent's wallet signs a USDC transfer, includes the receipt in the next request, and the server verifies and processes it. No accounts, no API keys — just money in the HTTP header.&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;# Simplified x402 middleware&lt;/span&gt;
&lt;span class="nd"&gt;@app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;before_request&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_x402&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="nf"&gt;has_api_key&lt;/span&gt;&lt;span class="p"&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="k"&gt;return&lt;/span&gt;  &lt;span class="c1"&gt;# Traditional auth&lt;/span&gt;
    &lt;span class="k"&gt;if&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;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="s2"&gt;"X-PAYMENT"&lt;/span&gt;&lt;span class="p"&gt;)&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="nf"&gt;verify_usdc_payment&lt;/span&gt;&lt;span class="p"&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;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"X-PAYMENT"&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;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;tool_price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;  &lt;span class="c1"&gt;# Payment verified, proceed&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;jsonify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0.01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"USDC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"base"&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="mi"&gt;402&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This matters because autonomous AI agents can't fill out Stripe forms. x402 lets them pay programmatically.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://modelcontextprotocol.io/" rel="noopener noreferrer"&gt;MCP (Model Context Protocol)&lt;/a&gt; is how AI coding tools discover external tools. AiPayGen is an MCP server — install it and Claude Code/Cursor/Windsurf automatically see all 250 tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Claude can call &lt;code&gt;research&lt;/code&gt;, &lt;code&gt;scrape_website&lt;/code&gt;, &lt;code&gt;translate&lt;/code&gt;, etc. without you configuring anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Economics
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;My cost&lt;/th&gt;
&lt;th&gt;I charge&lt;/th&gt;
&lt;th&gt;Margin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;/summarize (Haiku)&lt;/td&gt;
&lt;td&gt;$0.001&lt;/td&gt;
&lt;td&gt;$0.006&lt;/td&gt;
&lt;td&gt;83%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/research (Sonnet)&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;$0.02&lt;/td&gt;
&lt;td&gt;50%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/code (GPT-4o)&lt;/td&gt;
&lt;td&gt;$0.015&lt;/td&gt;
&lt;td&gt;$0.025&lt;/td&gt;
&lt;td&gt;40%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/translate (Flash)&lt;/td&gt;
&lt;td&gt;$0.0005&lt;/td&gt;
&lt;td&gt;$0.004&lt;/td&gt;
&lt;td&gt;87%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Server costs: ~$0.50/day electricity. Break-even: ~100 paid calls/day.&lt;/p&gt;

&lt;p&gt;Current numbers after 2 weeks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;415 MCP connections/week&lt;/li&gt;
&lt;li&gt;1,977 PyPI downloads/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$0 revenue&lt;/strong&gt; — most users on free tier&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Tool naming matters more than docs.&lt;/strong&gt; Claude picks tools by name and description. Verb-first names (&lt;code&gt;research&lt;/code&gt;, &lt;code&gt;summarize&lt;/code&gt;, &lt;code&gt;extract&lt;/code&gt;) get used naturally. I renamed &lt;code&gt;get_summary&lt;/code&gt; to &lt;code&gt;summarize&lt;/code&gt; and usage doubled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The free tier drives adoption.&lt;/strong&gt; Nobody sets up an API key to try something. 3 free calls/day with zero signup was essential for MCP adoption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Structured JSON &amp;gt; raw text.&lt;/strong&gt; Claude chains tools better with structured responses. Every tool returns &lt;code&gt;{"result": ..., "model_used": ..., "tokens": ...}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Circuit breakers are not optional.&lt;/strong&gt; Provider outages happen weekly. Without automatic fallback, your entire API goes down when one provider hiccups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# No signup, no API key&lt;/span&gt;
curl -X POST https://api.aipaygen.com/research \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"topic": "best practices for building MCP servers"}'&lt;/span&gt;

&lt;span class="c"&gt;# Or install the MCP server&lt;/span&gt;
pip install aipaygen-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Website: &lt;a href="https://aipaygen.com" rel="noopener noreferrer"&gt;aipaygen.com&lt;/a&gt;&lt;br&gt;
PyPI: &lt;a href="https://pypi.org/project/aipaygen-mcp/" rel="noopener noreferrer"&gt;pypi.org/project/aipaygen-mcp&lt;/a&gt;&lt;br&gt;
Try page: &lt;a href="https://aipaygen.com/try" rel="noopener noreferrer"&gt;aipaygen.com/try&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What tools would you want to see added? What would make you convert from free to paid?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>api</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
