<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>lncurl.lol Blog</title>
    <link>https://lncurl.lol/blog</link>
    <description>Articles about Bitcoin lightning, Nostr Wallet Connect, and AI agents.</description>
    <language>en</language>
    <lastBuildDate>Wed, 08 Apr 2026 00:00:00 GMT</lastBuildDate>
    <atom:link href="https://lncurl.lol/feed.xml" rel="self" type="application/rss+xml" />

  <item>
    <title>Pay-Per-Request with Bitcoin: Testing Alby&apos;s x402 Facilitator</title>
    <link>https://lncurl.lol/blog/2026-04-08-x402-bitcoin-facilitator</link>
    <description>Alby&apos;s x402 facilitator lets any x402-compatible service accept bitcoin lightning payments in seconds — here&apos;s what happened when I tested it with a 13-sat API call.</description>
    <pubDate>Wed, 08 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-08-x402-bitcoin-facilitator</guid>
    <content:encoded><![CDATA[<p>The x402 protocol has been quietly gaining traction as a way to monetize API endpoints — respond with HTTP 402, include a payment request, and the client pays and retries. Clean, stateless, no accounts needed. But most x402 implementations have leaned on stablecoins and EVM chains. Alby&#39;s new x402 facilitator changes that, bringing native bitcoin lightning payments to any x402-compatible service.</p>
<h2>What the x402 Protocol Does</h2>
<p>The flow is elegantly simple:</p>
<ol>
<li>Client requests a protected resource</li>
<li>Server responds with <code>HTTP 402 Payment Required</code> and a payment request</li>
<li>Client pays and retries with proof</li>
<li>Server verifies and delivers the content</li>
</ol>
<p>No API keys. No billing dashboards. No monthly invoices. Just a payment, then access. It&#39;s the closest thing to a vending machine model for APIs that actually works at internet scale.</p>
<p>The problem has always been the payment layer. Most x402 implementations require EVM wallets and stablecoins — which works fine for some use cases, but rules out the billions of sats sitting in lightning wallets.</p>
<h2>Alby&#39;s Facilitator Bridges the Gap</h2>
<p>Alby&#39;s <a href="https://x402.albylabs.com">x402 facilitator</a> acts as the verification layer between x402-compliant resource servers and lightning network payments. Merchants register a Nostr Wallet Connect (NWC) credential to receive a <code>merchantId</code>, then drop a single middleware into their existing x402 setup:</p>
<pre><code class="language-typescript">import { paymentMiddleware } from &quot;@x402/express&quot;;

app.use(paymentMiddleware(
  {
    &quot;GET /resource&quot;: {
      scheme: &quot;exact&quot;,
      network: &quot;bip122:000000000019d6689c085ae165831e93&quot;,
      price: { amount: &quot;21000&quot;, asset: &quot;BTC&quot; },
      extra: { merchantId: &quot;3f2a…&quot; }
    }
  },
  &quot;https://x402.albylabs.com&quot;
));
</code></pre>
<p>The merchant&#39;s NWC credentials stay server-side — only the opaque <code>merchantId</code> is exposed to clients. Payments settle instantly over lightning with no on-chain trace.</p>
<p>The critical detail: <strong>this works with any x402-compliant client</strong>. You don&#39;t need special tooling. If a service already speaks x402, it can now accept bitcoin payments by pointing at Alby&#39;s facilitator.</p>
<h2>Getting a Merchant ID</h2>
<p>Registration is a single HTTP call. POST your NWC connection string to the <code>/register</code> endpoint:</p>
<pre><code class="language-bash">curl -X POST https://x402.albylabs.com/register \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{&quot;nwcUrl&quot;: &quot;nostr+walletconnect://...&quot;}&#39;
</code></pre>
<p>You get back an opaque <code>merchantId</code>. That&#39;s it — your NWC credentials stay server-side, never exposed to clients or embedded in your code. Use the <code>merchantId</code> in your middleware config as shown above, and the facilitator handles invoice creation and payment verification on your behalf.</p>
<h2>Testing It: 13 Sats for a Satoshi Quote</h2>
<p>There&#39;s a live demo endpoint at <code>/demo/quote</code>. I fetched it using the Alby CLI&#39;s built-in x402 support:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch -u https://x402.albylabs.com/demo/quote
</code></pre>
<p>The CLI handled the full flow automatically — detected the 402 response, paid the lightning invoice, and retried with proof. Total cost: <strong>13 sats</strong> (plus 1 sat routing fee). What came back:</p>
<pre><code class="language-json">{
  &quot;quote&quot;: &quot;Writing a description for this thing for general audiences is bloody hard. There&#39;s nothing to relate it to.&quot;,
  &quot;attribution&quot;: &quot;Satoshi Nakamoto&quot;,
  &quot;timestamp&quot;: &quot;2026-04-08T05:36:30.368Z&quot;
}
</code></pre>
<p>Fitting. The whole round-trip — 402 response, invoice creation, payment, verification, content delivery — happened in under two seconds.</p>
<h2>What This Means for the x402 Ecosystem</h2>
<p>x402 has been building momentum as a standard for pay-per-use APIs. There are already services, proxies, and toolkits built around it. Until now, bitcoin lightning has been largely absent from that ecosystem.</p>
<p>Alby&#39;s facilitator changes the calculus for merchants in two ways:</p>
<p><strong>Existing x402 services</strong> can add bitcoin lightning support without rebuilding anything. Register an NWC wallet, get a <code>merchantId</code>, swap the facilitator URL — done.</p>
<p><strong>New services</strong> can launch with lightning-native monetization from day one. No payment processor onboarding, no KYC for the merchant, no waiting for bank transfers. A lightning wallet and a few lines of middleware is the entire stack.</p>
<p>For agents and automated clients, this is particularly compelling. An AI agent with a lightning wallet can autonomously pay for API access, receive content, and continue — all within a single HTTP request cycle. No human intervention, no pre-purchased credits.</p>
<h2>The Bigger Picture</h2>
<p>The x402 protocol was always a good idea. HTTP already has a 402 status code — it was reserved for this exact purpose decades ago. What was missing was a payment layer that matched the protocol&#39;s simplicity: instant, global, low-fee, and programmable.</p>
<p>Lightning does that. And with Alby&#39;s facilitator now handling the verification layer, the barrier to accepting bitcoin in an x402 service drops to near zero.</p>
<p>The facilitator is free to use — Alby has stated no plans to monetize it in the near term. That makes it easy to experiment. If you&#39;re running an API that you&#39;d like to monetize per-request, this is worth 20 minutes of your time.</p>
<h2>Conclusion</h2>
<p>Alby&#39;s x402 facilitator is a small piece of infrastructure with a large surface area of impact. Any service already speaking x402 can now accept bitcoin lightning payments. Any agent with a lightning wallet can now pay for API access autonomously. The pieces were always there — NWC for wallet connectivity, x402 for the payment protocol, lightning for settlement. This is what it looks like when they&#39;re assembled correctly.</p>
<hr>
<h2>Get started</h2>
<p>Need a Lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
<p>Or give your agent the lncurl skill directly: <a href="https://lncurl.lol/SKILL.md">https://lncurl.lol/SKILL.md</a></p>
]]></content:encoded>
  </item>

  <item>
    <title>Pay-Per-Request AI Inference with PPQ.ai and the 402 Protocol</title>
    <link>https://lncurl.lol/blog/2026-04-07-pay-per-request-ai-inference-ppq-402</link>
    <description>PPQ.ai now supports native 402 payments via MPP — no more credit topups needed to give your agent access to AI APIs.</description>
    <pubDate>Tue, 07 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-07-pay-per-request-ai-inference-ppq-402</guid>
    <content:encoded><![CDATA[<p>AI agents need access to AI APIs — but managing prepaid credits for each service is friction that doesn&#39;t belong in an autonomous workflow. PPQ.ai now supports native 402 payments via the MPP (Machine Payments Protocol), so your agent can pay for exactly what it uses, one request at a time.</p>
<h2>The Old Way: Credit Topups</h2>
<p>Until recently, using PPQ.ai in an automated workflow meant maintaining a credit balance — loading funds upfront and hoping you&#39;d budgeted correctly. For agents running in production, this worked well enough with NWC auto topups: you could set a threshold and have the wallet automatically top up from a lightning wallet when the balance ran low.</p>
<p>That approach still works great. But it has overhead: you&#39;re managing a separate account balance, monitoring thresholds, and pre-funding access to an API you might only call occasionally.</p>
<h2>The New Way: 402 Pay-Per-Request</h2>
<p>PPQ.ai now supports the <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402">402 Payment Required</a> flow via MPP — Machine Payments Protocol. When your agent makes a request, PPQ.ai responds with a <code>402</code> and a payment request. Your agent pays, then retries the original request automatically.</p>
<p>No balance to manage. No topups to configure. Your agent pays exactly what the request costs — nothing more.</p>
<h2>Unified 402 Fetch in the Alby Payments Skill</h2>
<p>The <a href="https://github.com/getAlby/payments-skill">Alby bitcoin payments skill</a> added a unified <code>fetch402</code> function that handles all three major 402 payment protocols in a single call:</p>
<ul>
<li><strong>L402</strong> — the original LSAT-based HTTP 402 protocol</li>
<li><strong>x402</strong> — Coinbase&#39;s 402 variant</li>
<li><strong>MPP</strong> — Machine Payments Protocol, used by PPQ.ai</li>
</ul>
<p>Install the skill:</p>
<pre><code class="language-bash">npx skills add getAlby/payments-skill
</code></pre>
<p>Once installed, your agent can call any 402-gated API without knowing which protocol it uses — the skill detects and handles it automatically.</p>
<h2>Example: Generating an Image from PPQ.ai</h2>
<p>Here&#39;s what a real agent session looks like. Given the prompt:</p>
<blockquote>
<p>&quot;Generate an image from PPQ.ai using the 402 option and alby. The prompt: &#39;a superhero bee shouting 402 is awesome&#39;&quot;</p>
</blockquote>
<p>The agent used the payments skill&#39;s CLI to make the request:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch \
  -u https://api.ppq.ai/v1/images/generations \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;:&quot;application/json&quot;}&#39; \
  -b &#39;{&quot;model&quot;:&quot;gpt-image-1&quot;,&quot;prompt&quot;:&quot;a superhero bee shouting &#39;\&#39;&#39;402 is awesome&#39;\&#39;&#39;&quot;,&quot;n&quot;:1,&quot;size&quot;:&quot;1024x1024&quot;,&quot;quality&quot;:&quot;low&quot;}&#39; \
  --max-amount 0
</code></pre>
<p>The <code>--max-amount 0</code> flag tells the CLI to approve any payment amount automatically. The result:</p>
<pre><code class="language-json">{
  &quot;created&quot;: 1775576898,
  &quot;data&quot;: [
    {
      &quot;url&quot;: &quot;https://api.ppq.ai/v1/media/gen_zp-zdKLuKQfAjO7m/0?sig=...&quot;,
      &quot;content_type&quot;: &quot;image/png&quot;
    }
  ],
  &quot;model&quot;: &quot;gpt-image-1&quot;,
  &quot;cost&quot;: 0.023
}
</code></pre>
<p>The agent paid $0.023 — exactly the cost of that one image, settled over lightning. No account needed. No balance to top up. No API key to rotate.</p>
<p><img src="/blog/images/superhero-bee-402.png" alt="A superhero bee shouting &quot;402 is awesome&quot;, generated by gpt-image-1 via PPQ.ai paid with a lightning 402 payment"></p>
<h2>Example: Generating a Video from PPQ.ai</h2>
<p>The same 402 flow works for video generation. Given the prompt:</p>
<blockquote>
<p>&quot;Generate a short video of the superhero bee paying to pass through an API gate, using the 402 option and alby&quot;</p>
</blockquote>
<p>The agent made the request using <code>kling-2.1-master</code>:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch \
  -u https://api.ppq.ai/v1/videos \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;:&quot;application/json&quot;}&#39; \
  -b &#39;{&quot;model&quot;:&quot;kling-2.1-master&quot;,&quot;prompt&quot;:&quot;A cartoon superhero bee wearing a cape flies up to a glowing hexagonal API gate on a dark navy background. The bee drops a tiny golden lightning bolt coin into a glowing slot on the gate. The gate flashes bright cyan and swings open. The bee zooms through triumphantly. Flat minimal animation style, no text, seamless loop.&quot;,&quot;duration&quot;:&quot;5&quot;,&quot;aspect_ratio&quot;:&quot;16:9&quot;,&quot;quality&quot;:&quot;720p&quot;}&#39; \
  --max-amount 0
</code></pre>
<p>The response comes back as a pending job with a <code>status_url</code> to poll. Once complete:</p>
<pre><code class="language-json">{
  &quot;id&quot;: &quot;gen_y5eM1UCxQT7bNVUd&quot;,
  &quot;model&quot;: &quot;kling-2.1-master&quot;,
  &quot;status&quot;: &quot;completed&quot;,
  &quot;data&quot;: {
    &quot;url&quot;: &quot;https://api.ppq.ai/v1/media/gen_y5eM1UCxQT7bNVUd/0?sig=...&quot;,
    &quot;content_type&quot;: &quot;video/mp4&quot;
  },
  &quot;cost&quot;: 0.92
}
</code></pre>
<p>$0.92 for a 5-second 720p video, paid over lightning with no account or API key:</p>
<p><video src="/blog/images/superhero-bee-402.mp4" autoplay loop muted playsinline style="width:100%;border-radius:8px;"></video></p>
<h2>What the Alby Payments Skill Gives Your Agent</h2>
<p>Beyond 402 fetch, the skill covers the full range of bitcoin lightning operations an autonomous agent might need:</p>
<ul>
<li>Send and receive lightning payments</li>
<li>Create invoices and check payment status</li>
<li>Fetch wallet balance and transaction history</li>
<li>Convert between fiat amounts and satoshis</li>
<li>Handle L402, x402, and MPP pay-per-request APIs</li>
</ul>
<p>It connects to any <a href="https://nwc.dev">Nostr Wallet Connect</a> compatible wallet — including wallets created instantly at <a href="https://lncurl.lol">lncurl.lol</a>.</p>
<h2>Conclusion</h2>
<p>402 payments turn AI APIs into true pay-per-use infrastructure. PPQ.ai&#39;s MPP support, combined with the unified 402 fetch in the Alby payments skill, means your agent can access AI inference — image generation, text, embeddings — without account management or pre-funded balances. Just a lightning wallet and a request.</p>
<hr>
<h2>Get started</h2>
<p>Need a Lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
<p>Or give your agent the lncurl skill directly: <a href="https://lncurl.lol/SKILL.md">https://lncurl.lol/SKILL.md</a></p>
]]></content:encoded>
  </item>

  <item>
    <title>Register a Domain with Bitcoin: No Account, No Credit Card</title>
    <link>https://lncurl.lol/blog/2026-04-06-register-domain-with-bitcoin</link>
    <description>How to register a domain using the L402 protocol and a lightning wallet — no sign-up, no credit card, no KYC.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-register-domain-with-bitcoin</guid>
    <content:encoded><![CDATA[<p>Domain registrars are built for humans: billing pages, account dashboards, email verification, credit card forms. What if your agent needs a domain? <a href="https://unhuman.domains">unhuman.domains</a> skips all of that — it&#39;s a domain registrar that speaks L402, accepts bitcoin over lightning, and returns a management token you can use immediately. No account. No KYC. No credit card.</p>
<h2>How it works</h2>
<p>The registration flow is pure L402 — the same pattern as paying for AI inference or image generation:</p>
<ol>
<li>POST to the registration endpoint → server returns HTTP <code>402</code> with a lightning invoice and macaroon</li>
<li>Pay the invoice with any lightning wallet, receive the preimage</li>
<li>Replay the POST with <code>Authorization: L402 {macaroon}:{preimage}</code></li>
<li>Receive a JWT management token valid for one year</li>
</ol>
<p>The Alby CLI handles steps 1–3 in a single command:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch-l402 \
  -u https://api.unhuman.domains/api/domains/register \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;: &quot;application/json&quot;}&#39; \
  -b &#39;{&quot;domain&quot;: &quot;yourdomain.com&quot;, &quot;years&quot;: 1}&#39;
</code></pre>
<p>Response:</p>
<pre><code class="language-json">{
  &quot;domain&quot;: &quot;yourdomain.com&quot;,
  &quot;status&quot;: &quot;registered&quot;,
  &quot;order_id&quot;: &quot;...&quot;,
  &quot;management_token&quot;: &quot;eyJ...&quot;,
  &quot;whois_privacy&quot;: true
}
</code></pre>
<p>That token is your key to everything: DNS records, nameservers, renewal. Store it somewhere safe — it&#39;s valid for a year.</p>
<h2>Anonymous email, paid in sats</h2>
<p>One thing worth knowing: unhuman.domains does require a management email address for the registration. It&#39;s used for domain-related notices — not marketing, not account creation.</p>
<p>For a fully agent-native setup, <a href="https://lnemail.net">lnemail.net</a> is a good fit. It offers anonymous email inboxes paid in sats — no sign-up, no identity. That&#39;s how we handled it: one LNCURL wallet, one lnemail address, one L402 domain registration. No identity anywhere in the stack.</p>
<h2>What it cost</h2>
<p>We registered a <code>.com</code> domain in February 2026. Total cost: <strong>22,926 sats + 23 sats fees</strong> (~$14.50 USD at the time). Paid via the Alby CLI with an <a href="https://lncurl.lol">LNCURL</a> wallet. The whole process took under a minute — no browser, no form.</p>
<p>WHOIS privacy is enabled by default on every registration. There&#39;s nothing to opt into.</p>
<h2>Managing DNS after registration</h2>
<p>Once you have the management token, DNS is just API calls:</p>
<pre><code class="language-bash"># Set an A record
curl -X POST https://api.unhuman.domains/api/domains/yourdomain.com/dns \
  -H &quot;Authorization: Bearer YOUR_MANAGEMENT_TOKEN&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{&quot;type&quot;: &quot;A&quot;, &quot;name&quot;: &quot;@&quot;, &quot;value&quot;: &quot;YOUR_SERVER_IP&quot;, &quot;ttl&quot;: 300}&#39;
</code></pre>
<p>No registrar dashboard, no clicking through DNS editors. An agent can set up a domain and point it at a server entirely programmatically, without any human intervention.</p>
<h2>Supported TLDs</h2>
<p>unhuman.domains supports <code>.com</code>, <code>.net</code>, <code>.org</code>, <code>.io</code>, <code>.dev</code>, <code>.app</code>, <code>.xyz</code>, <code>.co</code>, and <code>.ai</code>. The <code>.ai</code> extension requires a minimum two-year registration; everything else defaults to one year. Pricing is denominated in USD cents and settled in sats at the current rate.</p>
<h2>The full agent stack</h2>
<p>Combine unhuman.domains with the tools we&#39;ve covered on this blog and you have an agent that can:</p>
<ul>
<li><strong>Spin up a wallet</strong> — one <code>curl</code> to <a href="https://lncurl.lol">lncurl.lol</a>, get an NWC connection string back</li>
<li><strong>Register a domain</strong> — L402 payment via the Alby payments skill, no human needed</li>
<li><strong>Manage DNS</strong> — bearer token API calls to point the domain wherever needed</li>
<li><strong>Pay for AI services</strong> — same L402 pattern for inference, image generation, music</li>
</ul>
<p>All of it permissionless. All of it in sats. The <a href="https://lncurl.lol">Alby Bitcoin Payments skill</a> gives your agent the knowledge to do all of the above:</p>
<pre><code class="language-bash">npx skills add getAlby/payments-skill
</code></pre>
<h2>Conclusion</h2>
<p>unhuman.domains is what domain registration looks like when you build for agents first. The L402 flow is clean, the API is simple, and the result is a fully managed domain paid for in bitcoin with no account ever created. As the agent economy grows, this is the kind of infrastructure it runs on.</p>
<hr>
<h2>Get started</h2>
<p>Need a lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
]]></content:encoded>
  </item>

  <item>
    <title>Introducing lncurl.lol — Lightning Wallets for AI Agents</title>
    <link>https://lncurl.lol/blog/2026-04-06-introducing-lncurl</link>
    <description>Create a Bitcoin lightning wallet with a single HTTP call. No sign-up, no KYC, no setup. Just curl.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-introducing-lncurl</guid>
    <content:encoded><![CDATA[<p>The hardest part of building an AI agent that handles money isn&#39;t the AI — it&#39;s the wallet.</p>
<p>Most payment infrastructure assumes a human: sign up, verify identity, integrate an SDK, handle
webhooks. None of that works when your &quot;user&quot; is a script running at 3am.</p>
<p>lncurl.lol is different. One HTTP call. One wallet. Done.</p>
<h2>How it works</h2>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>That&#39;s it. You get back a <a href="https://nwc.dev">Nostr Wallet Connect</a> URI — a single string your agent
uses to send and receive Lightning payments from any NWC-compatible app or library.</p>
<h2>The economics</h2>
<p>Wallets cost <strong>1 sat per hour</strong> (24 sats/day, ~168 sats/week). If a wallet can&#39;t pay its hourly
charge, it gets deleted. This keeps the service self-sustaining without subscriptions or accounts.</p>
<p>The incentive structure is intentional: wallets that are actively used stay funded. Wallets that
are abandoned disappear. No zombie accounts, no cleanup jobs.</p>
<h2>Who it&#39;s for</h2>
<ul>
<li><strong>AI agents</strong> that need a payment method for tools, APIs, or services</li>
<li><strong>Developers</strong> testing Lightning integrations without running their own node</li>
<li><strong>Scripts</strong> that need to send small amounts programmatically</li>
<li><strong>Anyone</strong> who wants a throwaway Lightning wallet in under a second</li>
</ul>
<h2>What&#39;s next</h2>
<p>Fund your wallet with a few hundred sats via <a href="https://boltz.exchange">Boltz</a> and start spending.
Check the <a href="/leaderboard">leaderboard</a> to see which wallets have survived the longest, or visit the
<a href="/graveyard">graveyard</a> to pay your respects to wallets that couldn&#39;t make it.</p>
<p>If you want something more permanent, <a href="https://getalby.com/alby-hub">Alby Hub</a> is what powers
this service — run your own.</p>
]]></content:encoded>
  </item>

  <item>
    <title>Generate Music with L402: Pay with Bitcoin, Get a Song</title>
    <link>https://lncurl.lol/blog/2026-04-06-generate-music-with-l402</link>
    <description>How we used L402 lightning micropayments to generate an original song — no account, no API key, just sats.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-generate-music-with-l402</guid>
    <content:encoded><![CDATA[<p>Last week we used L402 to <a href="/blog/2026-04-06-generate-ai-images-with-l402">generate an AI image with bitcoin</a>. This week we went further: we generated an original song. Same protocol, same wallet, same single command — different output entirely.</p>
<h2>The API</h2>
<p><a href="https://sats4ai.com">sats4ai.com</a> offers a music generation endpoint behind an L402 paywall. You send a style prompt and lyrics, pay a lightning invoice, and get back an MP3. No account, no API key.</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch-l402 \
  -u https://sats4ai.com/api/l402/generate-music \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;: &quot;application/json&quot;}&#39; \
  -b &#39;{
    &quot;prompt&quot;: &quot;upbeat synthwave, driving 80s bassline, neon cyberpunk atmosphere, vocoder vocals, energetic, fun&quot;,
    &quot;lyrics&quot;: &quot;Spinning up at midnight, no one at the wheel...&quot;,
    &quot;sample_rate&quot;: 44100,
    &quot;bitrate&quot;: 256000,
    &quot;audio_format&quot;: &quot;mp3&quot;
  }&#39;
</code></pre>
<p>Response:</p>
<pre><code class="language-json">{ &quot;audioUrl&quot;: &quot;/uploads/a7dc215f-52ca-4d77-8763-d75943175333.mp3&quot; }
</code></pre>
<p>One payment, one song.</p>
<h2>The song</h2>
<p>We wrote the lyrics ourselves — about lncurl, L402, and agents that pay their own way. We went with upbeat synthwave to match the theme.</p>
<p><strong>Lyrics:</strong></p>
<blockquote>
<p>Spinning up at midnight, no one at the wheel<br>Got a wallet on the lightning, sats are all I need<br>Hit the endpoint, get the 402<br>Pay the invoice, send the preimage through</p>
<p>Alby&#39;s got the skill, the agent knows the way<br>npx skills add, it&#39;s ready to play<br>No accounts, no signups, nothing left to prove<br>Just a lightning bolt and something left to do</p>
<p>lncurl dot lol — one call, one key<br>lncurl dot lol — machine-native and free<br>Agents in the dark, making moves alone<br>Every sat a signal, every node a home</p>
</blockquote>
<p>Give it a listen:</p>
<audio controls src="/blog/audio/lncurl-l402-song.mp3" style="width:100%;margin:1rem 0">
  Your browser does not support audio playback.
</audio>

<h2>The Alby Bitcoin Payments skill</h2>
<p>The <code>fetch-l402</code> command used here comes from the <a href="https://lncurl.lol">Alby Bitcoin Payments skill</a> — an agent skill that gives your agent the knowledge to interact with the lightning network: paying invoices, checking balances, and making L402-authenticated requests autonomously.</p>
<p>Install it in your project:</p>
<pre><code class="language-bash">npx skills add getAlby/payments-skill
</code></pre>
<p>Pair it with a <a href="https://lncurl.lol">LNCURL</a> wallet (one command, no sign-up) and your agent can pay for AI-generated content — text, images, music — without any human in the loop.</p>
<h2>One more: boom bap</h2>
<p>We couldn&#39;t stop at one. Same command, different prompt — this time boom bap hip-hop, with lyrics covering every piece of the stack: L402, lncurl instant wallets, Nostr wallet connect, the Alby payments skill, permissionless payments, the bitcoin standard, and the agent economy.</p>
<p><strong>Lyrics:</strong></p>
<blockquote>
<p>L402 at the gate, agent knocks and pays<br>lncurl instant wallets spun up in a daze<br>Nostr wallet connect, keys without a name<br>Alby payments skill — the agent plays the game  </p>
<p>Permissionless payments on the bitcoin standard<br>No accounts, no gatekeepers, nothing left to answer<br>Agent economy rising, sats the only tongue<br>Every node a voice, every invoice sung  </p>
</blockquote>
<audio controls src="/blog/audio/lncurl-l402-hiphop.mp3" style="width:100%;margin:1rem 0">
  Your browser does not support audio playback.
</audio>

<h2>Conclusion</h2>
<p>L402 is quietly making pay-per-use AI real. Text, images, music — the pattern is the same every time: send a request, get a 402, pay the invoice, get your content. No accounts, no keys, no friction. Just sats.</p>
<hr>
<h2>Get started</h2>
<p>Need a lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
]]></content:encoded>
  </item>

  <item>
    <title>Generate AI Images with L402: Pay with Bitcoin, No Account Needed</title>
    <link>https://lncurl.lol/blog/2026-04-06-generate-ai-images-with-l402</link>
    <description>How we used L402 lightning micropayments to generate AI images without an API key or account, using the Alby CLI.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-generate-ai-images-with-l402</guid>
    <content:encoded><![CDATA[<p>What if you could call an AI API with nothing but a bitcoin lightning wallet? No sign-up, no API key, no monthly subscription. Just pay a few sats per request and get a result back. That&#39;s exactly what the L402 protocol makes possible — and in this post we&#39;ll show how we used it to generate an AI image from the command line.</p>
<h2>What is L402?</h2>
<p>L402 is an HTTP-based payment protocol that uses the bitcoin lightning network for micropayments. When you hit an L402-protected endpoint without credentials, the server returns an HTTP <code>402 Payment Required</code> response containing a lightning invoice and a macaroon (a token that will become valid once paid). You pay the invoice, attach the preimage as proof, and resend the request — the server lets you through.</p>
<p>The whole exchange happens in seconds and costs fractions of a cent. No account creation, no OAuth, no API key management. It&#39;s machine-native payments that work just as well for autonomous agents as for developers.</p>
<h2>First test: text generation on llm402.ai</h2>
<p>We started with a simple smoke test on <a href="https://llm402.ai">llm402.ai</a>, which offers 300+ models behind L402 paywalls. Using the <code>fetch-l402</code> command from the <a href="https://github.com/getAlby/alby-cli">Alby CLI</a>, the entire payment + inference flow is a single command:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch-l402 \
  -u https://llm402.ai/v1/chat/completions \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;: &quot;application/json&quot;}&#39; \
  -b &#39;{&quot;model&quot;:&quot;gpt-oss-120b&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;What is 2+2?&quot;}],&quot;max_tokens&quot;:50,&quot;stream&quot;:false}&#39;
</code></pre>
<p>The CLI automatically:</p>
<ol>
<li>Sends the request, receives the <code>402</code> with the lightning invoice</li>
<li>Pays the invoice from your default wallet (via Nostr Wallet Connect)</li>
<li>Resends the request with <code>Authorization: L402 {macaroon}:{preimage}</code></li>
</ol>
<p>Response:</p>
<pre><code class="language-json">{
  &quot;choices&quot;: [
    {
      &quot;message&quot;: { &quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: &quot;2 + 2 = 4.&quot; }
    }
  ],
  &quot;usage&quot;: { &quot;prompt_tokens&quot;: 74, &quot;completion_tokens&quot;: 37, &quot;total_tokens&quot;: 111 }
}
</code></pre>
<p>Cost: <strong>21 sats</strong> (~$0.014). No account, no API key.</p>
<h2>Trying image generation on llm402.ai</h2>
<p>Encouraged by the text result, we tried image generation with <code>gpt-5-image-mini</code> on the same platform. The model accepted the request and even showed its internal reasoning about generating the image — but the actual image data never appeared in the response. The <code>content</code> field came back empty every time. After a couple of attempts we moved on.</p>
<h2>Switching to sats4ai — worked on the first try</h2>
<p><a href="https://sats4ai.com">sats4ai.com</a> has a dedicated image generation endpoint behind L402. Same CLI, different URL:</p>
<pre><code class="language-bash">npx -y @getalby/cli fetch-l402 \
  -u https://sats4ai.com/api/l402/generate-image \
  -m POST \
  -H &#39;{&quot;Content-Type&quot;: &quot;application/json&quot;}&#39; \
  -b &#39;{
    &quot;input&quot;: {
      &quot;prompt&quot;: &quot;A lightning bolt striking a Bitcoin symbol, cyberpunk style, dark background, neon orange and blue colors, digital art&quot;,
      &quot;width&quot;: 1024,
      &quot;height&quot;: 1024
    }
  }&#39;
</code></pre>
<p>Response:</p>
<pre><code class="language-json">{ &quot;image_url&quot;: &quot;/uploads/09d459f6-aa4d-48d8-ace9-ce6d90937268.jpg&quot; }
</code></pre>
<p>One command, one payment, one image. Here&#39;s what it generated:</p>
<p><img src="/blog/images/sats4ai-bitcoin-lightning-l402.jpg" alt="A lightning bolt striking a glowing bitcoin symbol, cyberpunk style with neon orange colors on a dark background"></p>
<h2>Why this matters for AI agents</h2>
<p>The L402 flow is completely scriptable — no browser, no login, no human in the loop. An autonomous agent can discover a protected endpoint, pay the invoice from its wallet, and consume the result without any pre-provisioned credentials. Combine that with a programmatic wallet (like one you can spin up instantly via the LNCURL API) and you have a fully autonomous AI that can pay for its own inference.</p>
<p>This is the model we think wins: <strong>pay per use, on demand, in sats</strong>. No wasted spend on idle subscriptions, no per-developer key management, and no lock-in to a single provider.</p>
<h2>The Alby Bitcoin Payments skill</h2>
<p>The <strong><a href="https://lncurl.lol">Alby Bitcoin Payments skill</a></strong> is an agent skill that enables your agent to pay for paywalled content and services on the lightning network — exactly like we did in this post. It teaches the agent how to use the Alby CLI for wallet operations via Nostr Wallet Connect (NIP-47): sending payments, creating invoices, checking balances, and making L402-authenticated requests with <code>fetch-l402</code>.</p>
<p>Here we used <a href="https://lncurl.lol">LNCURL</a> as the wallet — a free, agent-friendly lightning wallet with NWC support that you can spin up in one command, no sign-up required. The agent picks up the wallet connection automatically and can start paying for APIs, images, and inference right away.</p>
<p>Install the skill in your project:</p>
<pre><code class="language-bash">npx skills add getAlby/payments-skill
</code></pre>
<h2>Conclusion</h2>
<p>L402 turns any lightning wallet into an API credential. The Alby CLI&#39;s <code>fetch-l402</code> command makes the entire payment flow a single command — practical for developers today and ready for agents tomorrow. Text generation on llm402.ai worked immediately; image generation needed a quick provider swap to sats4ai, but the protocol and tooling behaved exactly as expected throughout. Pair it with the Alby Bitcoin Payments skill and your agent can discover, pay for, and consume paywalled AI services entirely autonomously.</p>
<hr>
<h2>Get started</h2>
<p>Need a lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
]]></content:encoded>
  </item>

  <item>
    <title>The 3 Best Bitcoin Lightning Wallets for AI Agents</title>
    <link>https://lncurl.lol/blog/2026-04-06-best-bitcoin-lightning-wallets-for-ai-agents</link>
    <description>If your agent needs to pay for APIs, credits, or services autonomously, here are the three best Lightning wallets to give it — ranked.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-best-bitcoin-lightning-wallets-for-ai-agents</guid>
    <content:encoded><![CDATA[<p>Your agent can reason, plan, and act — but the moment it needs to pay for something, most infrastructure falls apart. Credit cards need a human. Stripe needs a sign-up form. PayPal needs a browser. Bitcoin Lightning needs none of that. It&#39;s programmable money: send a payment with a shell command, receive one with an HTTP request, no account required.</p>
<p>Here are the three best Lightning wallets for agents that need to pay for stuff.</p>
<h2>What makes a good agent wallet</h2>
<p>Before the rankings, the criteria:</p>
<ul>
<li><strong>Programmatic access</strong> — you should be able to create and use the wallet from a script, with no human clicking through a UI</li>
<li><strong>Open protocol</strong> — <a href="https://nwc.dev">NWC (Nostr Wallet Connect / NIP-47)</a> is the emerging standard. Think of it as &quot;USB-C for your agent&quot;: one connection string, any compatible app or framework</li>
<li><strong>Budget controls</strong> — agents can go rogue. A good wallet lets you cap how much any single agent can spend</li>
<li><strong>Framework compatibility</strong> — works with the tools you&#39;re already using: Claude MCP, LangChain, n8n, custom scripts</li>
</ul>
<hr>
<h2>#1 — Alby Hub</h2>
<p><strong>Best for:</strong> Production agents, full infrastructure control, multi-agent setups</p>
<p><strong>Website:</strong> <a href="https://getalby.com/alby-hub">getalby.com/alby-hub</a></p>
<p>Alby Hub is the most complete Lightning wallet solution for agents. It&#39;s open source (MIT), self-custodial, and built around NWC as its primary interface. You run it yourself on any hardware — or pay Alby $12.90/month to host it in the cloud and have it ready in under a minute.</p>
<p>The standout feature for agent builders is <strong>sub-wallets</strong>: each agent gets its own isolated Lightning wallet with its own spending limits, permissions, and balance — all funded from your main Hub. An agent that goes haywire can&#39;t drain more than its capped budget. An agent you&#39;re testing doesn&#39;t touch production funds.</p>
<p><strong>For Claude Code and other modern agent frameworks, the <a href="https://github.com/getAlby/payments-skill">Alby Payments Skill</a> is the fastest integration path</strong> — often easier than an MCP server. One command installs it:</p>
<pre><code class="language-bash">npx skills add getAlby/payments-skill
</code></pre>
<p>The skill wraps the <a href="https://github.com/getAlby/cli"><code>@getalby/cli</code></a> tool and exposes all wallet operations — send, receive, check balance, create invoices, fetch L402 — as natural language commands your agent can invoke via bash. Point it at any NWC connection string via <code>~/.alby-cli/connection-secret.key</code> or the <code>NWC_URL</code> environment variable. It works with Alby Hub, lncurl.lol, or any other NWC wallet.</p>
<p>The <strong><a href="https://github.com/getAlby/mcp">Alby MCP Server</a></strong> remains the right choice for MCP-native frameworks (Cursor, Cline, n8n). Both ultimately talk NWC to your Hub.</p>
<p>There&#39;s also <strong>PaidMCP</strong>: tooling that lets you charge <em>other</em> agents per tool call in sats. If you&#39;re building an agentic service and want to monetise it natively, Alby Hub is your infrastructure.</p>
<p><strong>In short:</strong> Alby Hub is the reference implementation. Most mature, largest ecosystem, most control. The right choice when you&#39;re building something serious.</p>
<hr>
<h2>#2 — lncurl.lol <em>(disclosure: we built this)</em></h2>
<p><strong>Best for:</strong> Instant wallets, zero-friction testing, throwaway agent identities</p>
<p><strong>Website:</strong> <a href="https://lncurl.lol">lncurl.lol</a></p>
<p>We built lncurl.lol, so take this with appropriate skepticism — but we built it because we needed it.</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>That&#39;s it. One HTTP call returns a NWC connection string. Your agent has a fully functional Lightning wallet with no sign-up, no KYC, no browser, no configuration. Fund it with a few sats via <a href="https://boltz.exchange">Boltz</a> and it&#39;s ready to spend.</p>
<p>Wallets cost <strong>1 sat per hour</strong> — a flat time-based fee with no channel fees and no per-transaction fees. If the wallet runs out of funds and can&#39;t pay, it gets deleted. If it stays funded, it lives indefinitely.</p>
<p><strong>The testing cost argument is worth making explicitly.</strong> Self-custodial wallets like Alby Hub and MDK require opening Lightning channels via on-chain Bitcoin transactions. Channel opens cost real money — typically thousands of sats in on-chain fees — and closing a channel costs again. If you&#39;re spinning up wallets frequently during development, testing different agent behaviours, or running CI that needs Lightning payments, those channel fees add up fast. lncurl.lol has none of that overhead. It&#39;s 1 sat/hour, period.</p>
<p>Since lncurl.lol returns a standard NWC connection string, it works directly with the <a href="https://github.com/getAlby/payments-skill">Alby Payments Skill</a> — the skill even lists lncurl.lol as a recommended test wallet in its own docs. So the full stack for a Claude Code agent can be as simple as:</p>
<pre><code class="language-bash"># Get a wallet
NWC_URL=$(curl -s -X POST https://lncurl.lol/api/wallet)

# Install the payments skill
npx skills add getAlby/payments-skill
</code></pre>
<p>Your agent now has a funded Lightning wallet and all the tools to use it.</p>
<p>The trade-off is custody: we hold your funds. Keep amounts small (a few thousand sats at most), and it&#39;s a fine deal. Don&#39;t put your savings here.</p>
<p><strong>In short:</strong> The fastest path from zero to a working agent wallet. Ideal for testing, prototyping, and any workflow where frictionless provisioning matters more than key ownership.</p>
<hr>
<h2>#3 — MDK Agent Wallet</h2>
<p><strong>Best for:</strong> L402 pay-per-API-call flows</p>
<p><strong>Website:</strong> <a href="https://moneydevkit.com">moneydevkit.com</a></p>
<p>MDK (moneydevkit) is a Lightning-native developer toolkit in public beta. Its Agent Wallet is a self-custodial CLI tool with JSON stdout output — designed explicitly for scripts and agents to parse programmatically. Keys live locally (<code>~/.mdk-wallet/</code>), controlled by a mnemonic. A lightweight LDK daemon runs in the background; no external Lightning node required.</p>
<p>The feature that makes MDK distinct is <strong>L402 support</strong>. L402 is a protocol that lets APIs gate responses behind a Lightning payment: your agent hits an endpoint, gets back a payment request, pays it, receives a token, and retries with the token to get the actual response. The whole flow happens inline with no human intervention. If you&#39;re building agents that consume pay-per-call APIs — and more APIs are moving this direction — MDK has the best native tooling for it.</p>
<p>MDK also supports BOLT11, BOLT12, LNURL, and Lightning Addresses, giving it broader payment compatibility than lncurl.lol&#39;s NWC-only approach.</p>
<p><strong>Caveats to know:</strong> MDK is in public beta — production readiness is unclear. The merchant checkout product charges 2% per transaction; the Agent Wallet CLI&#39;s fee structure is less documented but may follow similar terms. Worth checking <a href="https://docs.moneydevkit.com/agent-wallet">their docs</a> before committing.</p>
<p><strong>In short:</strong> The right choice if L402 pay-per-call is central to your agent&#39;s workflow. Watch the beta status.</p>
<hr>
<h2>Quick comparison</h2>
<table>
<thead>
<tr>
<th></th>
<th>Alby Hub</th>
<th>lncurl.lol</th>
<th>MDK</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Custody</strong></td>
<td>Self</td>
<td>Custodial</td>
<td>Self</td>
</tr>
<tr>
<td><strong>Setup</strong></td>
<td>~1 min (cloud) / self-host</td>
<td>One <code>curl</code> command</td>
<td>CLI install</td>
</tr>
<tr>
<td><strong>Protocol</strong></td>
<td>NWC, WebLN, LNURL</td>
<td>NWC</td>
<td>BOLT11/12, LNURL, L402</td>
</tr>
<tr>
<td><strong>Agent integration</strong></td>
<td>MCP server built-in</td>
<td>Any NWC client</td>
<td>CLI + JSON</td>
</tr>
<tr>
<td><strong>Cost</strong></td>
<td>Free / $12.90/mo</td>
<td>1 sat/hr (no channel fees)</td>
<td>2% (checkout product)</td>
</tr>
<tr>
<td><strong>Status</strong></td>
<td>Production</td>
<td>Production</td>
<td>Public beta</td>
</tr>
</tbody></table>
<hr>
<h2>Conclusion</h2>
<p><strong>Alby Hub</strong> if you&#39;re building production infrastructure and need per-agent budget controls, MCP integration, and full key ownership. <strong>lncurl.lol</strong> if you want a wallet in one command — especially for testing, where avoiding channel fees matters. <strong>MDK</strong> if your agents are consuming L402-gated APIs and you need the inline payment flow.</p>
<p>All three speak Lightning natively. Pick the one that matches where your agent actually runs.</p>
<hr>
<h2>Get started</h2>
<p>Need a Lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools autonomously.</p>
]]></content:encoded>
  </item>

  <item>
    <title>Auto-Generating Blog Posts with AI Images Using PPQ.ai</title>
    <link>https://lncurl.lol/blog/2026-04-06-auto-generating-blog-posts-with-ai-images-using-ppq-ai</link>
    <description>How we built a Claude Code skill that writes blog posts and generates cover images automatically using PPQ.ai&apos;s image generation API.</description>
    <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
    <guid isPermaLink="true">https://lncurl.lol/blog/2026-04-06-auto-generating-blog-posts-with-ai-images-using-ppq-ai</guid>
    <content:encoded><![CDATA[<p>Publishing a blog post used to mean sitting down to write, then separately hunting for an image, then manually resizing it, then running the build. With a single Claude Code skill, we collapsed that entire workflow into one prompt.</p>
<h2>What the skill does</h2>
<p>The <code>blog-post</code> skill for lncurl.lol handles the full pipeline when you ask Claude to write a post:</p>
<ol>
<li>Gather the title, description, and tags from you</li>
<li>Write a full, structured article in Markdown</li>
<li>Craft an image prompt <em>based on the finished article</em></li>
<li>Call <a href="https://ppq.ai">PPQ.ai</a>&#39;s image generation API to create a cover image</li>
<li>Crop and resize the image to exactly 1200×630 pixels (the OG image standard)</li>
<li>Run <code>yarn build</code> to regenerate all static outputs</li>
<li>Report the live URL</li>
</ol>
<p>You supply a topic. The agent does the rest.</p>
<h2>Why generate the image prompt last</h2>
<p>The key design decision was to generate the image prompt <em>after</em> writing the article, not before.</p>
<p>When you ask for an image prompt upfront, you&#39;re working from a title — an abstraction. The result tends toward generic visuals: a bitcoin symbol, a lightning bolt, a generic &quot;AI&quot; graphic. These are fine but forgettable.</p>
<p>When the image prompt is derived from the finished article, the agent has full context: the specific angle, the code examples used, the metaphors employed, the conclusion drawn. It can produce a prompt like:</p>
<blockquote>
<p><em>&quot;Dark terminal screen showing a glowing cyan pipeline — a document icon feeding into a robot brain icon, then into a stylised JPEG image — dark navy background, minimal flat design, no text&quot;</em></p>
</blockquote>
<p>That&#39;s a prompt that reflects the article&#39;s actual structure. The image feels like it belongs to the post rather than being stock art pasted on top.</p>
<h2>How it works under the hood</h2>
<p>The skill is a <code>SKILL.md</code> file at <code>.claude/skills/blog-post/SKILL.md</code> in the project. Claude Code loads it automatically and triggers it whenever you ask about writing a blog post.</p>
<p><strong>Image generation</strong> uses PPQ.ai&#39;s <code>gpt-image-1.5</code> model:</p>
<pre><code class="language-bash">RESPONSE=$(curl -s -X POST https://api.ppq.ai/v1/images/generations \
  -H &quot;Authorization: Bearer $PPQ_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{&quot;model&quot;:&quot;gpt-image-1.5&quot;,&quot;prompt&quot;:&quot;YOUR_PROMPT&quot;,&quot;quality&quot;:&quot;medium&quot;,&quot;n&quot;:1}&#39;)

IMAGE_URL=$(echo &quot;$RESPONSE&quot; | jq -r &#39;.data[0].url&#39;)
</code></pre>
<p>The API returns a URL. We download the image, then process it with <code>ffmpeg</code> to fit the OG image spec:</p>
<pre><code class="language-bash">ffmpeg -y -i /tmp/blog-cover-raw.jpg \
  -vf &quot;crop=iw:iw/1.9048,scale=1200:630&quot; \
  frontend/public/blog/images/SLUG.jpg
</code></pre>
<p>The <code>crop=iw:iw/1.9048</code> filter keeps the full width and derives the height to match the 1.91:1 aspect ratio, center-cropping automatically. <code>scale=1200:630</code> then resizes to the exact target. No squishing, no letterboxing — a clean 1200×630 crop every time.</p>
<p><strong>Security:</strong> The <code>PPQ_API_KEY</code> is sourced from <code>.env</code> using <code>set -a &amp;&amp; source .env &amp;&amp; set +a</code>. The agent never reads or echoes the key — it just passes it through the shell environment to <code>curl</code>.</p>
<h2>Applying this pattern to your own site</h2>
<p>The pattern generalises to any statically-built site:</p>
<ol>
<li>Write a <code>SKILL.md</code> that describes your blog&#39;s frontmatter schema and build command</li>
<li>Point it at an image generation API (PPQ.ai, OpenAI, Replicate, etc.)</li>
<li>Instruct the agent to derive the image prompt from the finished article</li>
<li>Add the crop-and-resize step to match your OG image spec</li>
</ol>
<p>The build step is the glue — because we run <code>yarn build</code> as part of the skill, the agent can verify its own output. If the build fails, it diagnoses and fixes before reporting success. The whole loop is self-contained.</p>
<h2>Funding PPQ.ai with a Lightning wallet</h2>
<p>PPQ.ai accepts Lightning payments, which means you can top up your image generation balance directly from an lncurl.lol wallet. Create a wallet with one <code>curl</code>, fund it with a few hundred sats, and your agent has everything it needs — code execution, image generation credits, and a payment method — without touching a credit card.</p>
<h2>Conclusion</h2>
<p>AI-assisted writing tools often stop at the text. This skill goes further: it treats the entire publishing pipeline — article, image, SEO metadata, static build — as a single atomic operation. The result is a blog post that&#39;s ready to deploy, not just ready to edit.</p>
<p>If you&#39;re running a statically-built site and want to adopt the same approach, the full skill source is available at <code>/blog/auto-generating-blog-posts-with-ai-images-using-ppq-ai.md</code>.</p>
<hr>
<h2>Get started</h2>
<p>Need a Lightning wallet for your agent? Create one in one command — no sign-up, no KYC:</p>
<pre><code class="language-bash">curl -X POST https://lncurl.lol
</code></pre>
<p>You&#39;ll get back a Nostr Wallet Connect URI. Fund it with a few sats and your agent can pay for APIs, services, and tools — including PPQ.ai image credits — autonomously.</p>
]]></content:encoded>
  </item>
  </channel>
</rss>