<?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: Mr Hamlin</title>
    <description>The latest articles on DEV Community by Mr Hamlin (@mr_hamlin).</description>
    <link>https://dev.to/mr_hamlin</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%2F3815462%2F608d44c9-7dbf-4f19-bf5c-211f31b318fb.jpg</url>
      <title>DEV Community: Mr Hamlin</title>
      <link>https://dev.to/mr_hamlin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mr_hamlin"/>
    <language>en</language>
    <item>
      <title>I wrote the book I wish existed when I started shipping solo with AI</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Mon, 06 Jul 2026 20:50:03 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/i-wrote-the-book-i-wish-existed-when-i-started-shipping-solo-with-ai-1iej</link>
      <guid>https://dev.to/mr_hamlin/i-wrote-the-book-i-wish-existed-when-i-started-shipping-solo-with-ai-1iej</guid>
      <description>&lt;p&gt;For the past year-plus I've been running multiple live products completely solo — a crypto payment gateway processing transactions across 16 chains, an LLM API proxy with Stripe billing, a DEX on Base mainnet, packages on npm and PyPI, and integration PRs merged into Google's, AWS's, and Coinbase's agent framework ecosystems.&lt;/p&gt;

&lt;p&gt;No team. No funding. One laptop and a set of AI tools that didn't exist a few years ago.&lt;/p&gt;

&lt;p&gt;People kept asking how the workflow actually works — not "what's your favorite AI tool" but the whole system: how you go from idea to deployed product to paying users when you're the entire engineering, marketing, and support department. So I wrote it down. All of it. The result is &lt;strong&gt;Build in Public with AI: The Solo Developer's Guide to Shipping Fast&lt;/strong&gt; — 268 pages, 13 chapters, and it just went live on Amazon.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually in it
&lt;/h2&gt;

&lt;p&gt;This is not a prompt engineering guide and not a listicle of tools. It's the operating system:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part I — The Solo AI Stack.&lt;/strong&gt; How to pick the two AI tools that actually matter and ignore the rest, structure your day around a Think → Prompt → Scaffold → Refine → Ship loop, and manage context across multiple projects without losing your mind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part II — Shipping Product.&lt;/strong&gt; The Minimum Deployable Product framework (zero to deployed in a day), building fast without building fragile, running 3–5 products at once with a tiering system that prevents burnout, and a full chapter on AI-assisted smart contract development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part III — Distribution.&lt;/strong&gt; The part most technical books skip. The PR Blitz strategy for getting your tool integrated into every major AI framework ecosystem, README-driven distribution, the awesome-list strategy, and building in public without it becoming a second job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part IV — The Operating System.&lt;/strong&gt; Revenue models that work for one person, wiring up Stripe in a weekend, the emotional reality of solo building, what AI still can't do, and a 30-day playbook you can start tomorrow.&lt;/p&gt;

&lt;p&gt;Plus appendices: the complete tool stack reference, 15 copy-paste prompt templates, and a printable Ship It checklist.&lt;/p&gt;

&lt;h2&gt;
  
  
  One idea from the book, free
&lt;/h2&gt;

&lt;p&gt;Here's the concept that changed how I ship more than any tool did: &lt;strong&gt;the Minimum Deployable Product&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;An MVP is defined by features. An MDP is defined by a state: &lt;em&gt;deployed, reachable, and doing its one job in production&lt;/em&gt;. The difference sounds subtle but it inverts your priorities. You don't build features and then figure out deployment — you deploy a skeleton on day one (a single endpoint, a single page, whatever) and then every feature lands in a production context from the start.&lt;/p&gt;

&lt;p&gt;Why it matters for solo devs specifically: deployment problems are the ones AI helps you with &lt;em&gt;least&lt;/em&gt; — they're environmental, specific to your accounts and configs, and full of gotchas AI can't see. Feature code is what AI helps with &lt;em&gt;most&lt;/em&gt;. So you front-load the part AI can't do while your motivation is highest, and spend the rest of the build in AI's strongest territory. Every hour after day one compounds.&lt;/p&gt;

&lt;p&gt;Also, honestly: nothing sustains momentum like a live URL. Even an ugly one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who it's for
&lt;/h2&gt;

&lt;p&gt;Developers. You can read a stack trace and make architecture decisions — you don't need to be senior, but this isn't a learn-to-code book. If you've been watching the AI-assisted-shipping wave and wondering how people actually run the full loop solo, this is the manual.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.amazon.com/dp/B0H7KWRDC9" rel="noopener noreferrer"&gt;Build in Public with AI: The Solo Developer's Guide to Shipping Fast — $4.99 on Amazon&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'll be posting build logs and revenue numbers as this launches — that's kind of the whole point of the title. If you read it and something's unclear, wrong, or missing, tell me. Solo also means the errata department is me.&lt;/p&gt;

&lt;p&gt;What's the biggest bottleneck in your own shipping loop — building, deploying, or distributing? Genuinely curious where people get stuck.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>indiehackers</category>
    </item>
    <item>
      <title>I Built a Batch Payment Plugin for AI Agents in 48 Hours (and It Made Its First Cent On-Chain)</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Fri, 03 Jul 2026 19:34:44 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/i-built-a-batch-payment-plugin-for-ai-agents-in-48-hours-and-it-made-its-first-cent-on-chain-29p8</link>
      <guid>https://dev.to/mr_hamlin/i-built-a-batch-payment-plugin-for-ai-agents-in-48-hours-and-it-made-its-first-cent-on-chain-29p8</guid>
      <description>&lt;p&gt;Yesterday I had an idea about where value accrues in the AI agent ecosystem. Today the plugin is live on ClawHub, published on npm, and has already processed a real USDC payout on Base mainnet — with the protocol's first fee, all $0.009 of it, sitting on-chain.&lt;/p&gt;

&lt;p&gt;Here's the whole thing: the insight, the build, the receipts, and the pricing math.&lt;/p&gt;

&lt;h2&gt;
  
  
  The insight: plugins own execution paths, skills get invoked
&lt;/h2&gt;

&lt;p&gt;I've been building in the x402 / agent-payments ecosystem for months — my main project is an x402 payment gateway with ~190 endpoints. Watching which projects in this space actually generate revenue, one pattern kept jumping out:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The projects making money don't sell capabilities. They own a step in a loop.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;skill&lt;/em&gt; is something an agent invokes occasionally, when a task happens to call for it. A &lt;em&gt;plugin&lt;/em&gt; that sits on a recurring execution path gets exercised every single time the loop runs. Same amount of code. Wildly different revenue curves.&lt;/p&gt;

&lt;p&gt;Most of the plugin activity in the agent economy clusters around the &lt;strong&gt;money-in&lt;/strong&gt; layer — routing model calls, metering inference, charging for API access. That path is getting crowded.&lt;/p&gt;

&lt;p&gt;But agents don't just consume — increasingly, they &lt;em&gt;pay out&lt;/em&gt;. Revenue splits to contributors. Settlements with other agents. Payroll-shaped flows. Refunds. And the money-out layer was, as far as I could tell, unclaimed.&lt;/p&gt;

&lt;p&gt;So I claimed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What SpraayBatch does
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/plagtech/SpraayBatch" rel="noopener noreferrer"&gt;SpraayBatch&lt;/a&gt; is an OpenClaw plugin (plus a standalone CLI) that gives an AI agent a treasury:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Batch USDC payouts&lt;/strong&gt; — up to 200 recipients in one atomic transaction on Base. One tx, one gas fee, everyone paid or nobody is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-custodial auto-wallet&lt;/strong&gt; — generated locally on first run, key saved to &lt;code&gt;~/.spraay/.session&lt;/code&gt;, never transmitted anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-agent budget caps&lt;/strong&gt; — a hard block, not a warning. An agent cannot spend past its cap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Append-only ledger&lt;/strong&gt; — every payout gets a receipt with a Basescan link.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optional gasless mode&lt;/strong&gt; — via ERC-4337 and a CDP Paymaster &lt;em&gt;you&lt;/em&gt; configure. Agents holding only USDC, with zero ETH, can pay. No more topping up gas dust across a fleet of agent wallets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe by default&lt;/strong&gt; — installs pointed at Base Sepolia. Mainnet is opt-in, behind an explicit confirmation gate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Six tools, one manifest. An agent gets &lt;code&gt;spraay_wallet_info&lt;/code&gt;, &lt;code&gt;spraay_balance&lt;/code&gt;, &lt;code&gt;spraay_budget_set&lt;/code&gt;, &lt;code&gt;spraay_budget_status&lt;/code&gt;, &lt;code&gt;spraay_batch_pay&lt;/code&gt;, and &lt;code&gt;spraay_receipts&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 48 hours
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Day 1:&lt;/strong&gt; built the entire plugin in one Claude Code session — contract interaction, wallet management, the budget system, the ledger, the OpenClaw manifest. Deployed a test contract to Base Sepolia, proved the gasless path with a real sponsored payout (sender held zero ETH), pushed to GitHub, published to npm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 2 (today):&lt;/strong&gt; renamed the project (naming is hard; batch payments &lt;em&gt;is&lt;/em&gt; the product, so the name now says so), added full fee disclosure to every user-facing surface, ran the first real mainnet payout, passed ClawHub's security review, and launched.&lt;/p&gt;

&lt;p&gt;The rename alone touched 130 references across 18 files — package name, manifest, six tool IDs, CLI binary, docs, the GitHub repo itself. Claude Code planned it, grepped every occurrence first, and executed with hard stops before anything irreversible. The whole build-rename-launch cycle is the most concrete case I've had yet for AI-assisted solo development: not because the AI did it alone, but because one person plus an agent covered ground that used to need a team.&lt;/p&gt;

&lt;h2&gt;
  
  
  The receipt
&lt;/h2&gt;

&lt;p&gt;Talk is cheap. Here's the first real mainnet payout:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://basescan.org/tx/0xb96e8e42829c482998015353fba44dbed1b3611031bd7dbf41acbb78e1268964" rel="noopener noreferrer"&gt;basescan.org/tx/0xb96e8e42829c482998015353fba44dbed1b3611031bd7dbf41acbb78e1268964&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One &lt;code&gt;sprayEqual&lt;/code&gt; call. Three recipients, 1 USDC each. Total gas: &lt;strong&gt;$0.0014&lt;/strong&gt;. The 0.30% protocol fee — 0.009 USDC — visible right there in the transfer list, flowing to the fee collector. Five USDC transfers, one atomic transaction, complete transparency.&lt;/p&gt;

&lt;p&gt;That fee is the protocol's first revenue. It's less than a cent. I screenshotted it anyway, because every fee curve starts at its first data point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pricing math
&lt;/h2&gt;

&lt;p&gt;SpraayBatch charges &lt;strong&gt;0.30% on mainnet batches&lt;/strong&gt;. Testnet is free. No subscription, no seats, no API key tiers.&lt;/p&gt;

&lt;p&gt;Here's why that's a good deal from the payer's side: a 1,000 USDC payout to 200 recipients costs 3 USDC in protocol fees — and lands in &lt;em&gt;one&lt;/em&gt; transaction. The alternative is 200 separate transfers: 200 signatures, 200 gas fees, 200 chances for one to fail and leave your payout half-done. Even on a cheap chain like Base, the operational cost of 200 individual sends dwarfs 3 USDC.&lt;/p&gt;

&lt;p&gt;And the fee isn't hiding anywhere. It's in the README, in the tool descriptions agents read before calling, in the dry-run output, and broken out explicitly in the mainnet confirmation gate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mainnet payout: 1.5 USDC to 3 recipient(s) + 0.0045 USDC protocol fee = 1.5045 USDC total.
Mainnet requires explicit confirmation. Add --confirm to send on mainnet.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The gate reads its numbers live from the contract, not from a hardcoded string — so it stays honest even if the fee ever changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design decisions worth stealing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Testnet-default, mainnet-gated.&lt;/strong&gt; A treasury plugin that can accidentally spend real money is a liability. SpraayBatch installs pointing at Sepolia; switching to mainnet is a deliberate config change, and even then, every real payout demands explicit confirmation. During my own demo recording, I ran the mainnet pay command without the confirm flag — and the gate refused, on camera. That refusal is the best frame in the demo GIF.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bring-your-own paymaster.&lt;/strong&gt; Gasless is genuinely useful — agents that never need ETH are operationally simpler — but subsidizing gas for strangers is a great way to get drained by dust spam. So sponsorship runs through &lt;em&gt;your&lt;/em&gt; CDP account and &lt;em&gt;your&lt;/em&gt; policy caps. The plugin never subsidizes anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fees as pricing, not fine print.&lt;/strong&gt; The 0.30% appears everywhere a user or agent could encounter it before money moves. A fee someone discovers in a transaction trace reads as sneaky. A fee stated in the tool description reads as a business model. Same number, opposite trust outcomes.&lt;/p&gt;

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

&lt;p&gt;As an OpenClaw plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openclaw plugins &lt;span class="nb"&gt;install &lt;/span&gt;clawhub:spraay-batch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; spraay-batch
spraay-batch info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get a wallet on first run, pointed at testnet. Fund it with Sepolia USDC and batch away for free. When you're ready for mainnet, the config flip and the confirmation gate are waiting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/plagtech/SpraayBatch" rel="noopener noreferrer"&gt;github.com/plagtech/SpraayBatch&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/spraay-batch" rel="noopener noreferrer"&gt;npmjs.com/package/spraay-batch&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Part of the &lt;a href="https://spraay.app" rel="noopener noreferrer"&gt;Spraay&lt;/a&gt; ecosystem — batch payments infrastructure for the agent economy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'll be running a real batch payout through it every week and posting the receipts — dogfooding in public. Week one is already on-chain.&lt;/p&gt;

&lt;p&gt;If you're building agents that need to pay out — or you think the money-out layer needs something this doesn't cover — I want to hear it. Comments open, DMs open (@Spraay_app on X).&lt;/p&gt;

</description>
      <category>ai</category>
      <category>web3</category>
      <category>opensource</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>You're Running a GPU Rig and Waiting 2 Weeks to Get Paid. Why?</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Fri, 26 Jun 2026 18:56:43 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/youre-running-a-gpu-rig-and-waiting-2-weeks-to-get-paid-why-2gla</link>
      <guid>https://dev.to/mr_hamlin/youre-running-a-gpu-rig-and-waiting-2-weeks-to-get-paid-why-2gla</guid>
      <description>&lt;p&gt;Let me paint a picture most GPU operators know too well.&lt;/p&gt;

&lt;p&gt;You spent $2,000 on a used RTX 4090. You set it up, got verified on Vast.ai, dialed in your thermals, and started earning. The dashboard says you've made $180 this pay period. Nice.&lt;/p&gt;

&lt;p&gt;Now you wait.&lt;/p&gt;

&lt;p&gt;Vast.ai pays hosts every two weeks through PayPal or Wise. Your money sits in their system for 14 days before it moves. And when it does land, PayPal takes their cut. If you're international, Wise takes a currency conversion fee on top of that. By the time that $180 reaches your bank account, you're looking at maybe $155 and three weeks since the jobs actually ran.&lt;/p&gt;

&lt;p&gt;RunPod? They pay in platform credits. You earn compute hours, not dollars. Want to cash out? You're spending those credits back on RunPod's own infrastructure. It's store credit, not income.&lt;/p&gt;

&lt;p&gt;Salad pays in "Salad Balance" that you redeem for gift cards. Gift cards. You're running a $2,000 GPU and getting paid in Amazon gift cards.&lt;/p&gt;

&lt;p&gt;This is the state of GPU operator payouts in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question nobody is asking
&lt;/h2&gt;

&lt;p&gt;Here's what's strange about this whole situation. The AI compute rental market is worth over $8 billion this year. It's growing at 44% annually. There are over 120,000 developers on Vast.ai alone looking for GPU time. Demand is through the roof.&lt;/p&gt;

&lt;p&gt;And yet the people actually providing the compute — the operators running the rigs, paying the electricity, managing the hardware — are getting paid like it's 2015. Biweekly PayPal transfers. Platform credits. Gift cards.&lt;/p&gt;

&lt;p&gt;Meanwhile, USDC settles on Base in two seconds. Two seconds. Around the clock. No minimums. No platform holding your funds. No conversion fees. The infrastructure for instant payouts already exists. Nobody was using it for GPU operators.&lt;/p&gt;

&lt;p&gt;Until now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Spraay Direct actually does
&lt;/h2&gt;

&lt;p&gt;Spraay Direct is the first instant USDC payout system built specifically for GPU operators.&lt;/p&gt;

&lt;p&gt;You connect your GPU — whether you're running vLLM, Ollama, or ComfyUI — to the Spraay network. When an AI agent sends a job to your GPU, you get paid in USDC on Base the moment that job completes. Not in two weeks. Not in platform credits. Not in gift cards. In USDC, in your wallet, in about two seconds.&lt;/p&gt;

&lt;p&gt;There's no platform fee in the traditional sense. Vast.ai takes 15-25% of what renters pay. Spraay charges a flat $0.03 per job. That's it. The rest goes directly to your wallet.&lt;/p&gt;

&lt;p&gt;And if you're running a multi-GPU operation with a partner, or you want to automatically set aside a percentage for taxes or savings, Spraay's batch payment system lets you split every payout across multiple wallets in a single transaction. 70% to your operating wallet, 20% to savings, 10% to your partner — all settled atomically on-chain. Try doing that with a PayPal payout.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this compares to what you're using now
&lt;/h2&gt;

&lt;p&gt;Let's be specific because vague claims don't help anyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vast.ai&lt;/strong&gt; pays hosts via PayPal or Wise every two weeks. There's a minimum threshold before you can withdraw. The platform takes 15-25% as commission. Payout currency is USD through traditional banking rails. No split payments. Your earnings sit in Vast's system until their next payout cycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RunPod&lt;/strong&gt; operates on platform credits. Their revenue sharing program for Hub publishers pays 3-7% of compute hours — in RunPod credits, not cash. If you're a Community Cloud host, payouts depend on the specific arrangement, but you're generally locked into the RunPod ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Salad&lt;/strong&gt; pays in Salad Balance. You can redeem it for gift cards, games, or crypto. The conversion rates vary. It's designed for gamers monetizing idle hardware, not serious operators.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spraay Direct&lt;/strong&gt; pays in USDC on Base within seconds of job completion. No minimum payout. No platform commission beyond the per-job fee. No waiting period. No PayPal. No gift cards. Every payment is on-chain, meaning you have a permanent, auditable record of every dollar earned on Basescan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who this is for
&lt;/h2&gt;

&lt;p&gt;If you're running one or more GPUs with at least 16GB of VRAM and you're already doing AI inference work — or thinking about starting — this is for you.&lt;/p&gt;

&lt;p&gt;If you're a Vast.ai host who's tired of the two-week payout cycle and the PayPal fees eating your margins, this is for you.&lt;/p&gt;

&lt;p&gt;If you're a crypto-native builder who wants earnings in USDC rather than fiat, this is for you.&lt;/p&gt;

&lt;p&gt;If you're running a small GPU farm with a partner and you're manually splitting PayPal payments or Venmo-ing each other after every payout cycle, the automatic batch splits alone might be worth the switch.&lt;/p&gt;

&lt;p&gt;And if you're someone who's been mining crypto and looking at the AI compute market as the next opportunity — this is how you get started without handing 20% of your earnings to a middleman.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part where I'm honest about what this isn't
&lt;/h2&gt;

&lt;p&gt;Spraay Direct isn't a marketplace. We're not replacing Vast.ai's marketplace or RunPod's infrastructure. We're a payment and settlement layer.&lt;/p&gt;

&lt;p&gt;Right now, when you connect to Spraay Direct, your GPU serves inference jobs from AI agents that discover Spraay through the x402 protocol and MCP ecosystem. This is a growing but still early network. You won't see the same volume of jobs you'd get on Vast.ai's marketplace with 120,000 developers on day one.&lt;/p&gt;

&lt;p&gt;What you will get is instant payouts, lower fees, USDC settlement, and batch splits from day one. And as the x402 agent economy grows — which it is, rapidly — the job volume follows.&lt;/p&gt;

&lt;p&gt;Some operators are running Spraay Direct alongside their Vast.ai listing. GPU idle on Spraay? Vast.ai picks it up. Job comes through Spraay? Instant USDC. Best of both worlds while the network scales.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens next
&lt;/h2&gt;

&lt;p&gt;You can check out the Spraay Direct proxy on GitHub. The setup takes about 30 minutes. You run a lightweight proxy on your machine that connects your inference engine to the Spraay gateway. When jobs come in, your GPU does the work. USDC lands in your wallet. That's the whole pitch.&lt;/p&gt;

&lt;p&gt;The GPU compute market is massive and growing. The operators powering it deserve to get paid like it's 2026, not 2015. That's what we're building.&lt;/p&gt;

&lt;p&gt;If you're running a rig and you're tired of waiting for your money, come try it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Spraay Direct is open source and built on Base. USDC settlement via the x402 protocol.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GitHub: &lt;a href="https://github.com/plagtech/spraay-direct-proxy" rel="noopener noreferrer"&gt;github.com/plagtech/spraay-direct-proxy&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Gateway: &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;gateway.spraay.app&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Twitter: &lt;a href="https://twitter.com/Spraay_app" rel="noopener noreferrer"&gt;@Spraay_app&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gpu</category>
      <category>ai</category>
      <category>usdc</category>
      <category>web3</category>
    </item>
    <item>
      <title>We Made Our x402 Payment Gateway Loop-Native — Here's How (and Why Your Agent Needs It)</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Wed, 24 Jun 2026 01:24:02 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/we-made-our-x402-payment-gateway-loop-native-heres-how-and-why-your-agent-needs-it-4iog</link>
      <guid>https://dev.to/mr_hamlin/we-made-our-x402-payment-gateway-loop-native-heres-how-and-why-your-agent-needs-it-4iog</guid>
      <description>&lt;p&gt;Two weeks ago, Boris Cherny — head of Claude Code at Anthropic — said something on stage that changed how I think about building infrastructure:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I don't prompt Claude anymore. I have loops running. They're the ones prompting Claude."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then Peter Steinberger dropped a post that put a name on it: &lt;strong&gt;loop engineering&lt;/strong&gt;. The idea is simple but the implications are massive. You stop writing prompts. You start designing the systems that prompt agents for you. The agent enters a cycle — reason, act, observe, repeat — and it doesn't stop until the goal is met or the budget is hit.&lt;/p&gt;

&lt;p&gt;That immediately raised a question for me: if agents are going to run autonomously in loops, what happens when the "act" step involves money?&lt;/p&gt;

&lt;p&gt;I run Spraay — an x402 payment gateway with 170+ endpoints across 16 chains. Agents already call our batch payment, escrow, and payroll endpoints through an MCP server. But every one of those calls was fire-and-forget. The agent sends a request, gets a response, and has no way to know when the payment actually settles unless it polls. Polling burns tokens. Burned tokens cost money. And in a loop, that cost compounds on every cycle.&lt;/p&gt;

&lt;p&gt;So we made the gateway loop-native. Here's what that means and how we built it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Problem: Loops Need Callbacks, Not Polling
&lt;/h2&gt;

&lt;p&gt;A loop-engineered agent doing batch payroll looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Observe: "10 employees need to be paid"
2. Reason: "I should batch these through Spraay"
3. Act: POST /api/v1/payroll/execute
4. Observe: ??? (How does the agent know it settled?)
5. Reason: ??? (Should I retry? Move on? Something failed?)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without callbacks, step 4 becomes a polling loop inside the main loop. The agent hammers &lt;code&gt;GET /status&lt;/code&gt; every few seconds, burning inference tokens while it waits. That's wasteful for one payment. For an agent running continuous operations — processing invoices, releasing escrow milestones, executing weekly payroll — it's unsustainable.&lt;/p&gt;

&lt;p&gt;The fix: let agents pass a &lt;code&gt;callback_url&lt;/code&gt; on any request. When the operation resolves, the gateway POSTs a signed payload to that URL. The agent's loop receives the event, processes it, and decides its next action. No polling. No wasted tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Implementation: Three Layers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Layer 1: Webhook Infrastructure
&lt;/h3&gt;

&lt;p&gt;The core system is a Supabase-backed event queue with a background dispatch worker. When an agent includes &lt;code&gt;callback_url&lt;/code&gt; in a request body, the gateway:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generates a per-event HMAC signing secret&lt;/li&gt;
&lt;li&gt;Queues the webhook event in a &lt;code&gt;webhook_events&lt;/code&gt; table&lt;/li&gt;
&lt;li&gt;Returns the normal response plus a &lt;code&gt;webhook&lt;/code&gt; object containing the &lt;code&gt;webhook_id&lt;/code&gt; and &lt;code&gt;webhook_secret&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A background worker polls for pending events and delivers them&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's what an agent sees when it includes &lt;code&gt;callback_url&lt;/code&gt;:&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="err"&gt;POST&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/api/v&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;/batch/execute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USDC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recipients"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xAlice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1000.00"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xBob"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2500.00"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sender"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xEmployer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"callback_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://agent.example.com/hooks/spraay"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"contract"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0x1646452F98E36A3c9Cfc3eDD8868221E207B5eEC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"batch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"recipientCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"totalAmount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3500.00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fee"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"10.50"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"totalWithFee"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3510.50"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"transaction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"webhook"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"webhook_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"afe9c56e-8074-4f5e-ae22-2eabd8cdcec0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"webhook_secret"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"whsec_b8559497b5cf43..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"subscribed_events"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"batch.created"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the batch settles, the gateway POSTs to the agent's URL with HMAC-SHA256 signed headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST https://agent.example.com/hooks/spraay
X-Spraay-Signature: sha256=abc123...
X-Spraay-Event: batch.settled
X-Spraay-Delivery-Id: afe9c56e-...
X-Spraay-Timestamp: 2026-06-23T12:00:00.000Z
User-Agent: Spraay-Webhooks/1.0

{
  "id": "afe9c56e-...",
  "event_type": "batch.settled",
  "timestamp": "2026-06-23T12:00:00.000Z",
  "attempt": 1,
  "data": {
    "recipient_count": 2,
    "token": "USDC",
    "total_amount": "3500.00",
    "total_with_fee": "3510.50"
  }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent verifies the signature with the &lt;code&gt;webhook_secret&lt;/code&gt; from the original response, processes the event, and moves to the next step in its loop. If delivery fails, the worker retries with exponential backoff — 30s, 60s, 120s — up to 3 attempts before marking the event as exhausted.&lt;/p&gt;

&lt;p&gt;The key design decision: &lt;strong&gt;the callback system is entirely optional&lt;/strong&gt;. Agents that don't pass &lt;code&gt;callback_url&lt;/code&gt; see zero changes in the response. Every existing integration keeps working exactly as before.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2: Safety Guards
&lt;/h3&gt;

&lt;p&gt;This is the part that kept me up the night before shipping. If agents are running autonomous payment loops, what happens when a loop has a bug?&lt;/p&gt;

&lt;p&gt;Picture this: an agent receives a &lt;code&gt;batch.settled&lt;/code&gt; callback, and its loop logic says "great, now pay the next batch." It fires another payment. Gets another callback. Fires again. The loop has no exit condition, and the wallet drains in minutes.&lt;/p&gt;

&lt;p&gt;That's not a Spraay bug — it's an agent design bug. But users will blame the gateway. So we built three safety layers that protect wallets regardless of how the agent is designed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per-key rate limiting on payment endpoints.&lt;/strong&gt; Every API key gets a budget of 10 payment-moving calls per minute. A legitimate batch operation (even 200 recipients) is a single API call. You'd need to fire 10 completely separate operations within 60 seconds to hit the limit. A runaway loop hits it in seconds. Responses include &lt;code&gt;X-RateLimit-Remaining&lt;/code&gt; headers so well-built agents can self-regulate.&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rate_limit_exceeded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Too many requests to /api/v1/batch/execute. Limit: 10 per 60s."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"If this is a loop-engineered agent, ensure your loop has proper termination conditions."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Duplicate payment detection.&lt;/strong&gt; If the same API key sends an identical payload (same recipients, amounts, token) within 60 seconds, the gateway returns a 409 instead of processing a duplicate payment. The response tells the agent how to override this if the duplicate is intentional (add a unique &lt;code&gt;idempotency_key&lt;/code&gt; field).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Webhook delivery cooldown.&lt;/strong&gt; No callback URL receives deliveries faster than every 5 seconds. This caps the maximum possible loop cycle speed. A legitimate agent processing results never needs sub-5-second callbacks. A runaway loop would.&lt;/p&gt;

&lt;p&gt;All three guards are per-API-key, so a large company with heavy legitimate usage gets their own rate budget. And all three are additive — they sit in the middleware chain without touching any existing endpoint logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Wiring Endpoints
&lt;/h3&gt;

&lt;p&gt;Making an endpoint callback-aware takes about 8 lines of code. The webhook middleware attaches a &lt;code&gt;webhookCallback&lt;/code&gt; helper to every request that includes &lt;code&gt;callback_url&lt;/code&gt;. Endpoint handlers just check if it's there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Existing handler code builds the response...&lt;/span&gt;

&lt;span class="c1"&gt;// Add webhook callback (only fires if agent passed callback_url)&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webhookCallback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webhook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;webhookCallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;batch.created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;recipient_count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;recipients&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;base&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;total_amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;totalAmount&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;return&lt;/span&gt; &lt;span class="nx"&gt;res&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="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We wired up 6 handlers across 3 endpoint families:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Batch payments&lt;/strong&gt; — &lt;code&gt;batch.created&lt;/code&gt; on execute&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escrow&lt;/strong&gt; — &lt;code&gt;escrow.created&lt;/code&gt;, &lt;code&gt;escrow.funded&lt;/code&gt;, &lt;code&gt;escrow.released&lt;/code&gt;, &lt;code&gt;escrow.disputed&lt;/code&gt; across all state transitions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payroll&lt;/strong&gt; — &lt;code&gt;batch.created&lt;/code&gt; with &lt;code&gt;type: 'payroll'&lt;/code&gt; in the payload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Escrow is the most interesting case because it's inherently a state machine. An agent loop managing a freelance contract can now receive callbacks at every stage: escrow created → funded → work completed → released. Each callback gives the agent the information it needs to decide its next action without polling.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Enables
&lt;/h2&gt;

&lt;p&gt;With loop-native callbacks, an agent can now do things like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated payroll processing&lt;/strong&gt;: Observe invoice queue → batch employees → receive settlement callback → update books → repeat next pay period.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escrow milestone management&lt;/strong&gt;: Create escrow → fund on approval → receive work → release on delivery → handle disputes. All event-driven, no polling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-chain treasury operations&lt;/strong&gt;: Monitor balances across chains → batch rebalancing payments → confirm settlements → repeat.&lt;/p&gt;

&lt;p&gt;The x402 per-call pricing model actually works in our favor here. Loop-engineered agents make more calls per task (that's the nature of the cycle), which means more microtransactions flowing through the gateway. Making the integration smoother via callbacks means agents are more likely to use Spraay as their payment layer — which means more volume, not less.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Didn't Build (and Why)
&lt;/h2&gt;

&lt;p&gt;We deliberately chose not to build a loop orchestration framework. The agent ecosystem already has plenty of those — Claude Code, OpenClaw, LangGraph, CrewAI. What it doesn't have is payment infrastructure designed for autonomous agent loops.&lt;/p&gt;

&lt;p&gt;Spraay's position is the settlement layer. We don't tell agents what to do or how to loop. We make sure that when the "act" step in any loop involves moving money, the infrastructure is fast, secure, signed, and event-driven.&lt;/p&gt;

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

&lt;p&gt;Spraay's loop-native webhooks are live today across batch, escrow, and payroll endpoints. Add &lt;code&gt;callback_url&lt;/code&gt; to any request body and you'll get signed callbacks when the operation resolves.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gateway&lt;/strong&gt;: gateway.spraay.app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs&lt;/strong&gt;: docs.spraay.app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Server&lt;/strong&gt;: smithery.ai/servers/Plagtech/Spraay-x402-mcp&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BPA Spec&lt;/strong&gt;: docs.spraay.app/bpa/1.0/&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building loop-engineered agents that handle money, I'd love to hear how you're thinking about the payment layer. What safety guarantees matter most to you? What event types would you want callbacks for?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Spraay is an x402 payment gateway — 170+ endpoints, 16 chains, batch payments as the primary differentiator. Built by a solo founder in public.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Follow the build: &lt;a href="https://twitter.com/lostpoet" rel="noopener noreferrer"&gt;@lostpoet&lt;/a&gt; on X, &lt;a href="https://warpcast.com/plag" rel="noopener noreferrer"&gt;@plag&lt;/a&gt; on Farcaster.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>web3</category>
      <category>programming</category>
    </item>
    <item>
      <title>I Ship Paid APIs in a Weekend. Here's the Exact Stack I Use Every Time.</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Sat, 20 Jun 2026 00:10:11 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/i-ship-paid-apis-in-a-weekend-heres-the-exact-stack-i-use-every-time-5166</link>
      <guid>https://dev.to/mr_hamlin/i-ship-paid-apis-in-a-weekend-heres-the-exact-stack-i-use-every-time-5166</guid>
      <description>&lt;p&gt;I've shipped three paid API products in the past six months. Each one took a weekend to reach a working, billable state — users signing up, generating API keys, making authenticated requests, and paying me through Stripe.&lt;/p&gt;

&lt;p&gt;Not because I'm fast. Because the infrastructure is the same every time.&lt;/p&gt;

&lt;p&gt;Auth is the same. API key management is the same. Stripe billing is the same. Rate limiting, usage tracking, the dashboard — all the same. The only thing that changes is the business logic behind the endpoints.&lt;/p&gt;

&lt;p&gt;After the third time wiring Stripe webhooks to Supabase to API key validation, I wrote down the pattern. Here it is.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Runtime&lt;/td&gt;
&lt;td&gt;Node.js + Express&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auth &amp;amp; Database&lt;/td&gt;
&lt;td&gt;Supabase&lt;/td&gt;
&lt;td&gt;Free tier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Billing&lt;/td&gt;
&lt;td&gt;Stripe&lt;/td&gt;
&lt;td&gt;2.9% + 30¢ per txn&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rate Limiting&lt;/td&gt;
&lt;td&gt;Redis (Upstash)&lt;/td&gt;
&lt;td&gt;Free tier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dashboard&lt;/td&gt;
&lt;td&gt;React + Vite&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Railway&lt;/td&gt;
&lt;td&gt;$5/month&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Total cost at launch: &lt;strong&gt;$5/month&lt;/strong&gt;. Everything else is free until you have paying customers.&lt;/p&gt;

&lt;p&gt;Why these specific tools? I've tried the alternatives. Supabase beats Firebase for API businesses because relational data (users → keys → usage logs) is natural in Postgres and painful in document stores. Express beats Next.js for API servers because you don't need SSR, file-based routing, or React Server Components — you need a fast request-response pipeline. Upstash Redis beats Postgres for rate limiting because checking a counter needs to be sub-millisecond, not 5-20ms.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Middleware Chain
&lt;/h2&gt;

&lt;p&gt;This is the architecture pattern that makes everything work. Every API request passes through a chain of middleware before it hits your business logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request arrives
  → validateApiKey    (reject if invalid)
  → rateLimit         (reject if over per-minute limit)
  → trackUsage        (reject if monthly quota exceeded)
  → YOUR LOGIC        (do the actual work)
Response sent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By the time your route handler runs, you &lt;strong&gt;know&lt;/strong&gt; three things: the key is valid, the request is within rate limits, and the monthly quota hasn't been exceeded. Your business logic never checks any of this. The middleware guarantees it.&lt;/p&gt;

&lt;h2&gt;
  
  
  API Keys: The Pattern Everyone Skips
&lt;/h2&gt;

&lt;p&gt;Most tutorials use Bearer tokens for API auth and move on. That doesn't work for a business. Your customers need to generate keys from a dashboard, name them, revoke them, and see when they were last used.&lt;/p&gt;

&lt;p&gt;The security model matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Never store raw keys.&lt;/strong&gt; Store a SHA-256 hash. When a request comes in, hash the provided key and look up the hash.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show the key once.&lt;/strong&gt; After generation, you only show a masked preview like &lt;code&gt;sk_live_abc...xyz&lt;/code&gt;. Lost key? Generate a new one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a recognizable prefix.&lt;/strong&gt; &lt;code&gt;sk_live_&lt;/code&gt; tells GitHub's secret scanning that this is a credential. A leaked prefixed key gets caught before it causes damage.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PREFIX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sk_live_&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generateApiKey&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="nx"&gt;random&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;raw&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="nx"&gt;PREFIX&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hash&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;256 bits of entropy. The same pattern Stripe and OpenAI use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rate Limiting: The Sliding Window
&lt;/h2&gt;

&lt;p&gt;A fixed window rate limiter resets at the top of every minute, which means a customer can send their full quota at 0:59 and again at 1:01 — effectively doubling their rate. The sliding window counts the actual last 60 seconds from &lt;em&gt;right now&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Four Redis commands, one pipeline, one network round-trip:&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;checkRateLimit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;apiKeyId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPerMinute&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="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ratelimit:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;apiKeyId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;windowStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;60000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pipe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zremrangebyscore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;windowStart&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// remove old&lt;/span&gt;
  &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zadd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;              &lt;span class="c1"&gt;// add current&lt;/span&gt;
  &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zcard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                            &lt;span class="c1"&gt;// count window&lt;/span&gt;
  &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                       &lt;span class="c1"&gt;// auto-cleanup&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;maxPerMinute&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;remaining&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPerMinute&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;count&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;Then set the standard headers on every response — not just 429s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Limit&lt;/code&gt; — max per minute for this tier&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Remaining&lt;/code&gt; — requests left in window&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;X-RateLimit-Reset&lt;/code&gt; — when the window resets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your API consumers use these headers to implement client-side backoff. The good ones slow down before they hit the wall.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stripe Billing: The Four Webhooks That Matter
&lt;/h2&gt;

&lt;p&gt;Stripe sends dozens of event types. You need four:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;checkout.session.completed&lt;/code&gt;&lt;/strong&gt; — customer paid. Create the subscription record, upgrade their tier, update all their API keys to the new limits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;customer.subscription.updated&lt;/code&gt;&lt;/strong&gt; — plan change or renewal. Look up the new price, determine the tier, update the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;customer.subscription.deleted&lt;/code&gt;&lt;/strong&gt; — cancellation. Downgrade to free tier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;invoice.payment_failed&lt;/code&gt;&lt;/strong&gt; — card declined. Flag the account, notify the user.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The critical gotcha: Stripe signs webhooks against the &lt;strong&gt;raw request body&lt;/strong&gt;. If Express parses the body into JSON first, the signature verification fails. Mount your webhook route with &lt;code&gt;express.raw()&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; &lt;code&gt;express.json()&lt;/code&gt;:&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;// This line MUST come before express.json()&lt;/span&gt;
&lt;span class="nx"&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/billing/webhook&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;span class="nx"&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="nx"&gt;express&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I lost two hours to this bug on my first API. You don't have to.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Weekend Timeline
&lt;/h2&gt;

&lt;p&gt;Here's how I actually spend the weekend:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Friday evening:&lt;/strong&gt; Set up the project, install deps, create Supabase project, get a health check endpoint running. 1 hour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Saturday morning:&lt;/strong&gt; Auth routes, API key system, validation middleware, first authenticated API call. 3 hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Saturday afternoon:&lt;/strong&gt; Rate limiting in Redis, Stripe billing with all four webhook handlers. 3 hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sunday morning:&lt;/strong&gt; Usage tracking, React dashboard with five pages (login, overview, keys, usage, billing). 2 hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sunday afternoon:&lt;/strong&gt; Deploy to Railway, custom domain, write docs, post about it. 2 hours.&lt;/p&gt;

&lt;p&gt;Nine hours of building. A live, paid API on the internet.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Price higher than you think.&lt;/strong&gt; At $9/month you need 111 customers to make $1,000. At $29/month you need 35. At $79/month you need 13. Fewer customers = less support = more time building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The free tier is a conversion mechanism.&lt;/strong&gt; A developer integrates your API, their project succeeds, they hit the limit, they upgrade. By then they've written code against your endpoints. Switching costs are real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good docs beat good marketing.&lt;/strong&gt; A developer who can integrate in five minutes becomes a customer. A developer who has to email you a question probably doesn't.&lt;/p&gt;




&lt;p&gt;I wrote the full process — all twelve chapters, every code file, the complete middleware chain, the dashboard, deployment, and launch strategy — into a book:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://brenthamlin.gumroad.com/l/ship-api-weekend" rel="noopener noreferrer"&gt;The Solo Developer's Guide to Shipping a Paid API in a Weekend&lt;/a&gt;&lt;/strong&gt; — 82 pages, $29, every line of code is production code.&lt;/p&gt;

&lt;p&gt;If you've been sitting on an API idea waiting for the right time to build the billing infrastructure, the right time is this weekend.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Brent Hamlin. I build paid APIs and write about the stack behind them. Find me at &lt;a href="https://dev.to/mr_hamlin"&gt;dev.to/mr_hamlin&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>I Added x402 Payments to Base's Agent Skills — Here's How</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Tue, 09 Jun 2026 21:09:24 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/i-added-x402-payments-to-bases-agent-skills-heres-how-17b8</link>
      <guid>https://dev.to/mr_hamlin/i-added-x402-payments-to-bases-agent-skills-heres-how-17b8</guid>
      <description>&lt;p&gt;If you build agents on Base, two things landed recently that are worth connecting.&lt;/p&gt;

&lt;p&gt;First: &lt;strong&gt;Base shipped its own Agent Skills.&lt;/strong&gt; There's now a &lt;code&gt;base/skills&lt;/code&gt; repo with consolidated skills that teach an AI agent to connect to Base, deploy contracts, authenticate wallets, and run nodes — installed with one command via Vercel's &lt;code&gt;npx skills&lt;/code&gt; CLI.&lt;/p&gt;

&lt;p&gt;Second: that CLI is part of a fast-growing, cross-agent ecosystem most crypto devs haven't clocked yet. So this post does two things — explains how &lt;code&gt;npx skills&lt;/code&gt; and &lt;code&gt;skills.sh&lt;/code&gt; actually work, and shows where the payment layer in Base's skills stops and how to extend it with &lt;strong&gt;x402 pay-per-call&lt;/strong&gt; and &lt;strong&gt;batch disbursement&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What &lt;code&gt;npx skills&lt;/code&gt; actually is
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;npx skills&lt;/code&gt; is an open CLI from Vercel Labs for installing "skills" — modular &lt;code&gt;SKILL.md&lt;/code&gt; files that teach an agent a specific capability without stuffing everything into its context window. A few things make it different from what crypto devs usually expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub is the registry.&lt;/strong&gt; There's no central package server. Any public GitHub repo with a &lt;code&gt;SKILL.md&lt;/code&gt; at its root is a valid, installable skill. Install with &lt;code&gt;npx skills add owner/repo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's cross-agent.&lt;/strong&gt; The same skill installs into Claude Code, Cursor, Codex, GitHub Copilot, Goose, Windsurf, Gemini, and dozens more. You write once; it works across the agent you (or your users) actually run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;skills.sh&lt;/code&gt; is the directory + leaderboard.&lt;/strong&gt; It ranks skills by real install counts pulled from telemetry, with all-time, trending, and hot lists. There's no editorial submission step — you publish by putting a skill in a repo, and installs surface it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The format underneath — &lt;code&gt;SKILL.md&lt;/code&gt; — is an open spec, which is why Base, Vercel, Anthropic, and a long tail of independent devs all use the same files.&lt;/p&gt;

&lt;p&gt;Here's Base's install, for reference:&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;# Base's official agent skills&lt;/span&gt;
npx skills add base/skills &lt;span class="nt"&gt;--skill&lt;/span&gt; build-on-base
npx skills add base/skills &lt;span class="nt"&gt;--skill&lt;/span&gt; base-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;build-on-base&lt;/code&gt; is a consolidated Base dev playbook; &lt;code&gt;base-mcp&lt;/code&gt; wires up a Base MCP server that gives an agent a wallet — sending, swapping, signing, batched calls, balances.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Base's skills stop
&lt;/h2&gt;

&lt;p&gt;This is the interesting gap. Base's skills give an agent a wallet and the ability to &lt;em&gt;transact&lt;/em&gt;: send a payment, swap a token, sign, batch several calls into one transaction. That's the on-chain action layer, and it's well covered.&lt;/p&gt;

&lt;p&gt;What that layer doesn't do is two distinct things the agent economy actually runs on:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pay-per-call consumption.&lt;/strong&gt; When an agent needs to &lt;em&gt;buy&lt;/em&gt; data or compute — a price feed, a web search, an LLM completion — it needs to pay for that call, per call, without an API key or a billing account. That's &lt;a href="https://x402.org" rel="noopener noreferrer"&gt;x402&lt;/a&gt;: the HTTP 402 "Payment Required" status code turned into a machine-readable micropayment handshake. The agent hits an endpoint, gets a 402 with a price, signs a USDC authorization, retries, and gets the data. No signup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batch disbursement.&lt;/strong&gt; "Batched calls" (bundling operations into one tx) is not the same as paying &lt;em&gt;many different recipients&lt;/em&gt; in one transaction — payroll, airdrops, contributor payouts, refunds. That's a disbursement primitive, and it's what the &lt;a href="https://docs.spraay.app/bpa/1.0/" rel="noopener noreferrer"&gt;Batch Payments for Agents (BPA 1.0)&lt;/a&gt; spec standardizes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both settle in USDC on Base. Neither is something a wallet-only skill handles. So they're a clean, complementary layer to drop on top of what Base ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the payment layer
&lt;/h2&gt;

&lt;p&gt;I published three skills that fill exactly that gap, each its own repo so you install only what you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/plagtech/defi-intelligence-x402" rel="noopener noreferrer"&gt;defi-intelligence-x402&lt;/a&gt;&lt;/strong&gt; — pay-per-call data + market intelligence on Base (prices, oracles, swap quotes, wallet analytics, ENS/Basename)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/plagtech/ai-compute-x402" rel="noopener noreferrer"&gt;ai-compute-x402&lt;/a&gt;&lt;/strong&gt; — pay-per-call AI inference (200+ LLMs, Bittensor, image gen, embeddings, GPU)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/plagtech/agent-payments-x402" rel="noopener noreferrer"&gt;agent-payments-x402&lt;/a&gt;&lt;/strong&gt; — batch payments, payroll, invoicing, escrow (BPA 1.0)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Pay-per-call data + market intelligence on Base&lt;/span&gt;
npx skills add plagtech/defi-intelligence-x402

&lt;span class="c"&gt;# Pay-per-call AI inference (200+ LLMs, Bittensor, GPU)&lt;/span&gt;
npx skills add plagtech/ai-compute-x402

&lt;span class="c"&gt;# Batch payments, payroll, invoicing, escrow (BPA 1.0)&lt;/span&gt;
npx skills add plagtech/agent-payments-x402
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three call the &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;Spraay x402 Gateway&lt;/a&gt;, which is x402-native end to end — no API keys, no accounts. You fund a wallet with USDC on Base, set one env var, and the x402 client signs and retries payments automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;x402-client
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;EVM_PRIVATE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x...   &lt;span class="c"&gt;# wallet holding USDC on Base&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Worked example: an agent that prices before it acts
&lt;/h3&gt;

&lt;p&gt;A read call costs a fraction of a cent and needs no key:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;x402-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;baseUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://gateway.spraay.app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;EVM_PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Live oracle prices — pays ~$0.008 USDC, automatically&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prices&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/oracle/prices&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// { ETH: 2847.50, BTC: ... }&lt;/span&gt;

&lt;span class="c1"&gt;// Profile a wallet before interacting with it&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;profile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/analytics/wallet?address=0xabc...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Worked example: pay 50 people in one transaction
&lt;/h3&gt;

&lt;p&gt;This is the disbursement primitive a wallet-only skill can't express:&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;// Batch-send USDC to many recipients in a single tx&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/batch/execute&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;base&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;USDC&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;recipients&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="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0xabc...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10.00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0xdef...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;25.50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;// ...up to your full roster&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;Estimate first with &lt;code&gt;/api/v1/batch/estimate&lt;/code&gt; (≈$0.001) if you want a gas/fee preview before sending.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for agents on Base
&lt;/h2&gt;

&lt;p&gt;The mental model is two layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Base's skills&lt;/strong&gt; = the agent has a wallet and can transact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402 skills&lt;/strong&gt; = the agent can pay for each call it makes, and pay many parties at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put them together and you have an agent that can read on-chain state, buy the data and compute it needs per call, and disburse funds — all in USDC on Base, all without a single API key or account. That's most of what an autonomous economic agent actually needs to do a job end to end.&lt;/p&gt;

&lt;p&gt;If you're building on Base, the install lines above are the fastest way to try the payment layer. Skills are just &lt;code&gt;SKILL.md&lt;/code&gt; files — open them before you install (it takes 30 seconds) and you'll see exactly which endpoints get called and what they cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skills:&lt;/strong&gt; &lt;a href="https://github.com/plagtech/agent-payments-x402" rel="noopener noreferrer"&gt;agent-payments-x402&lt;/a&gt; · &lt;a href="https://github.com/plagtech/defi-intelligence-x402" rel="noopener noreferrer"&gt;defi-intelligence-x402&lt;/a&gt; · &lt;a href="https://github.com/plagtech/ai-compute-x402" rel="noopener noreferrer"&gt;ai-compute-x402&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt; &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;Spraay Gateway&lt;/a&gt; · &lt;a href="https://docs.spraay.app" rel="noopener noreferrer"&gt;Docs / full endpoint catalog&lt;/a&gt; · &lt;a href="https://live.spraay.app" rel="noopener noreferrer"&gt;Live gateway traffic&lt;/a&gt; · &lt;a href="https://docs.spraay.app/bpa/1.0/" rel="noopener noreferrer"&gt;BPA 1.0 spec&lt;/a&gt;&lt;/p&gt;

</description>
      <category>base</category>
      <category>ai</category>
      <category>web3</category>
      <category>x402</category>
    </item>
    <item>
      <title>📚 Why Every AI Agent Needs a Research Library</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Fri, 05 Jun 2026 02:39:03 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/why-every-ai-agent-needs-a-research-library-434p</link>
      <guid>https://dev.to/mr_hamlin/why-every-ai-agent-needs-a-research-library-434p</guid>
      <description>&lt;p&gt;Your AI agent just hit a wall.&lt;/p&gt;

&lt;p&gt;It needs to look up a chemical compound for a drug interaction check. Or find the latest papers on transformer architectures. Or pull US Census demographics for a market analysis. What does it do?&lt;/p&gt;

&lt;p&gt;It hallucinates.&lt;/p&gt;

&lt;p&gt;Training data is months or years old. Web searches return noisy HTML, not structured data. And the agent has no way to verify what it "knows" against the actual source of record. For any task that requires factual accuracy — scientific, medical, legal, demographic — the agent is guessing.&lt;/p&gt;

&lt;p&gt;This is a solvable problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Research Gap in Agent Infrastructure
&lt;/h2&gt;

&lt;p&gt;Look at what the agent ecosystem has built so far: payment rails, wallet provisioning, DeFi integrations, compute access, communication protocols. These are all critical. But there's a missing layer that nobody's talking about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Knowledge access.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a human researcher needs to verify a claim, they check PubMed. When they need a chemical structure, they check PubChem. When they need citation data, they check Crossref. When they need demographic trends, they check the Census Bureau.&lt;/p&gt;

&lt;p&gt;AI agents have no equivalent. They're making consequential decisions — medical summaries, investment research, compliance checks, scientific literature reviews — without access to the same authoritative sources that human experts rely on.&lt;/p&gt;

&lt;p&gt;That's the gap we just filled.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Built
&lt;/h2&gt;

&lt;p&gt;We added a full Research &amp;amp; Reference category to the &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;Spraay x402 gateway&lt;/a&gt; — 23 endpoints spanning 7 research domains, all accessible via micropayment (USDC on Base or Solana).&lt;/p&gt;

&lt;p&gt;Here's what an agent can now look up on demand:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Language &amp;amp; Definitions&lt;/strong&gt; — word definitions, synonyms, antonyms, phonetics, and pronunciation audio across 9 languages. The foundation for any agent that processes or generates natural language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Academic Papers&lt;/strong&gt; — search across 250 million scholarly works spanning every discipline: physics, biology, computer science, economics, social sciences, humanities, engineering, medicine, law, education. Filter by field, year, author, or ORCID. Pull citation graphs. Track what's trending.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preprints&lt;/strong&gt; — the bleeding edge of science. 2.4 million preprints across physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, and economics. These are the papers that haven't been published yet — the ones that move markets and shift research directions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scholarly Metadata&lt;/strong&gt; — 150 million published works with full metadata: journal articles, books, conference papers, and datasets. Citation counts, reference lists, journal info by ISSN. When an agent needs to verify a source exists and check its impact, this is the endpoint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chemistry&lt;/strong&gt; — 110 million chemical compounds with molecular structures, physical properties, safety and toxicity data, and biological assay results. Structural similarity search for finding related compounds. This is the same database that pharmaceutical researchers and chemists use daily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Biomedical Literature&lt;/strong&gt; — 36 million papers covering medicine, pharmacology, genomics, neuroscience, public health, and more. Related article discovery for any given paper. When your agent is summarizing medical research or checking drug interactions, this is the authoritative source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demographics &amp;amp; Government Data&lt;/strong&gt; — US Census data by state, county, and zip code: population, income, housing, education, employment. Plus the entire federal open data catalog — transportation, climate, health, agriculture, energy, and crime statistics.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Endpoint Map
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;# Dictionary &amp;amp; Language
GET /api/v1/research/dictionary/define        $0.001
GET /api/v1/research/dictionary/synonyms      $0.001
GET /api/v1/research/dictionary/phonetics     $0.001

# Academic Papers (250M+ works)
GET /api/v1/research/papers/search            $0.002
GET /api/v1/research/papers/by-doi            $0.001
GET /api/v1/research/papers/by-author         $0.002
GET /api/v1/research/papers/citations         $0.002
GET /api/v1/research/papers/trending          $0.002

# Preprints (2.4M+ papers)
GET /api/v1/research/preprints/search         $0.002
GET /api/v1/research/preprints/by-id          $0.001
GET /api/v1/research/preprints/recent         $0.002

# Scholarly Metadata (150M+ works)
GET /api/v1/research/scholarly/search         $0.002
GET /api/v1/research/scholarly/by-doi         $0.001
GET /api/v1/research/scholarly/citations-count $0.001
GET /api/v1/research/scholarly/journal-info   $0.001

# Chemistry (110M+ compounds)
GET /api/v1/research/chemistry/compound       $0.002
GET /api/v1/research/chemistry/similarity     $0.002
GET /api/v1/research/chemistry/bioactivity    $0.002

# Biomedical (36M+ papers)
GET /api/v1/research/biomedical/search        $0.002
GET /api/v1/research/biomedical/by-pmid       $0.001
GET /api/v1/research/biomedical/related       $0.002

# Demographics &amp;amp; Government Data
GET /api/v1/research/demographics/census      $0.001
GET /api/v1/research/demographics/datasets    $0.001
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every response returns a unified JSON envelope with the source, license info, attribution, and a consistent result structure — regardless of which domain the query hits. One integration, every domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the Demand Is
&lt;/h2&gt;

&lt;p&gt;These aren't hypothetical use cases. This is what agents are already trying to do, badly, with web scraping and hallucination:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pharmaceutical &amp;amp; biotech agents&lt;/strong&gt; — compound lookup, drug interaction screening, literature review across 36M biomedical papers. An agent advising on drug safety needs PubChem and PubMed, not a Google search.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Academic writing assistants&lt;/strong&gt; — paper discovery, citation graph traversal, related work identification. Every grad student's AI assistant needs structured access to the scholarly record.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Market research agents&lt;/strong&gt; — Census demographics for TAM sizing, government datasets for industry analysis, trend tracking across academic publications for emerging technology identification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fact-checking and verification&lt;/strong&gt; — DOI lookup confirms a source actually exists. Citation counts indicate impact. Cross-referencing preprints against published papers catches retractions and updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scientific monitoring&lt;/strong&gt; — agents that watch arXiv daily for new preprints in specific categories, track citation velocity on key papers, and flag when a trending paper crosses a threshold.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compliance and regulatory&lt;/strong&gt; — biomedical literature search for adverse event signals, chemical safety data for REACH/GHS compliance, demographic data for fair lending analysis.&lt;/p&gt;

&lt;p&gt;The pattern is the same in every case: the agent needs structured, authoritative, verifiable data — not a web search result. And it needs it on demand, per call, without managing API keys and parsing 7 different response formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Gateway, Every Domain
&lt;/h2&gt;

&lt;p&gt;The value proposition for agent builders is simple: integrate once with Spraay, and your agent gets access to the same research infrastructure that universities and pharmaceutical companies use. Pay per call. No subscriptions, no rate limit negotiations, no format wrangling.&lt;/p&gt;

&lt;p&gt;The research endpoints sit alongside 115 existing endpoints on the gateway covering payments, DeFi, oracle, compute, communication, and more — 138 total across 34 categories. If your agent needs to look something up &lt;em&gt;and&lt;/em&gt; take action on what it finds, the entire stack is already wired together.&lt;/p&gt;

&lt;p&gt;The gateway is live at &lt;code&gt;gateway.spraay.app&lt;/code&gt;. The MCP server on &lt;a href="https://smithery.ai/servers/Plagtech/Spraay-x402-mcp" rel="noopener noreferrer"&gt;Smithery&lt;/a&gt; has all the tools pre-wired for Claude, GPT, and any MCP-compatible agent framework.&lt;/p&gt;

&lt;p&gt;Docs: &lt;a href="https://docs.spraay.app" rel="noopener noreferrer"&gt;docs.spraay.app&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/plagtech/spraay-x402-gateway" rel="noopener noreferrer"&gt;plagtech/spraay-x402-gateway&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/Spraay_app" rel="noopener noreferrer"&gt;@Spraay_app&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Agents that know things make better decisions than agents that guess. Give yours a library card.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Batch Payments for Agents (BPA) 1.0: an open standard for how AI agents pay many recipients at once</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Tue, 02 Jun 2026 20:22:14 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/batch-payments-for-agents-bpa-10-an-open-standard-for-how-ai-agents-pay-many-recipients-at-once-22e3</link>
      <guid>https://dev.to/mr_hamlin/batch-payments-for-agents-bpa-10-an-open-standard-for-how-ai-agents-pay-many-recipients-at-once-22e3</guid>
      <description>&lt;p&gt;Agents can now &lt;em&gt;act&lt;/em&gt;. They book, they buy, they call tools, they spend. But ask a simple question — &lt;em&gt;how does an autonomous agent pay 500 people in one go?&lt;/em&gt; — and there's no clean answer. There's a pile of one-off integrations and a lot of hand-waving.&lt;/p&gt;

&lt;p&gt;So we wrote the spec. &lt;strong&gt;Batch Payments for Agents (BPA) 1.0&lt;/strong&gt; is a framework-neutral, open standard for how an agent disburses funds to many recipients in a single, governed, verifiable batch. It's live and citable here:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://docs.spraay.app/bpa/1.0/" rel="noopener noreferrer"&gt;docs.spraay.app/bpa/1.0&lt;/a&gt;&lt;/strong&gt; · source: &lt;strong&gt;&lt;a href="https://github.com/plagtech/bpa-spec" rel="noopener noreferrer"&gt;github.com/plagtech/bpa-spec&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This post is the why and the what.&lt;/p&gt;

&lt;h2&gt;
  
  
  The payments agents actually need are the ones the old rails punish
&lt;/h2&gt;

&lt;p&gt;Card and bank networks are optimized for a human clicking checkout once. Agent payouts are the opposite shape, and they break the cost model in three specific ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Micro-amounts.&lt;/strong&gt; Paying a crowd of data labelers $0.50 a task dies on fixed fees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Machine-initiated.&lt;/strong&gt; No human at checkout, no card-present flow, no chargeback dance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-to-many, global.&lt;/strong&gt; Pay 200 contributors at once, many cross-border or unbanked, and settle in seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stablecoins on fast chains solve the &lt;em&gt;rail&lt;/em&gt;. What's missing is the &lt;em&gt;contract&lt;/em&gt; — the agreed-upon shape of "an agent safely pays many recipients at once." Without it, every team rebuilds the same fragile logic: how do you make a batch idempotent? what happens when line 347 of 500 fails? how do you prove it settled? how do you stop a misbehaving agent from draining a treasury?&lt;/p&gt;

&lt;p&gt;BPA answers those questions once, so nobody has to answer them again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What BPA 1.0 actually defines
&lt;/h2&gt;

&lt;p&gt;The spec is deliberately boring in the way good infrastructure is boring. It nails down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A request format&lt;/strong&gt; — one &lt;code&gt;Disbursement Request&lt;/code&gt; object, with a JSON Schema you can validate against.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Idempotency&lt;/strong&gt; — replay-safe by construction, because batch disbursement is irreversible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partial-failure semantics&lt;/strong&gt; — atomic by default; if a rail can't be atomic, per-recipient results and a retry token scoped to &lt;em&gt;only&lt;/em&gt; the failed lines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settlement confirmation&lt;/strong&gt; — verifiable on-chain, per-chain finality rules, no "trust me, it sent."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A governance model&lt;/strong&gt; — spend caps, recipient allowlists, approval gating, and tamper-evident audit, all evaluated &lt;em&gt;before&lt;/em&gt; settlement and failing closed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transparent fees, transport bindings (x402 / MPP), and an MCP tool shape.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the core object an agent constructs:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bpa_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"idempotency_key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"payout-2026-06-02-001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"chain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eip155:8453"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"asset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"USDC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recipients"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xAbc..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"ref"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"worker-001"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xDef..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"ref"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"worker-002"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Amounts are integer base units (no float drift). Validate it against the published &lt;a href="https://docs.spraay.app/bpa/1.0/disbursement-request.schema.json" rel="noopener noreferrer"&gt;JSON Schema&lt;/a&gt; before you send.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three design choices worth calling out
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Non-custodial end to end.&lt;/strong&gt; The facilitator only &lt;em&gt;builds&lt;/em&gt; the transaction; the agent's own signature authorizes the spend. The gateway never holds funds. That single property collapses a whole class of security concerns — a forged request just produces an unsigned transaction nobody can submit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Governed before execution, not after.&lt;/strong&gt; BPA treats every disbursement as a high-risk action. The goal isn't to &lt;em&gt;ask&lt;/em&gt; an agent to behave — it's to make an out-of-policy payout structurally impossible. Caps, allowlists, and approvals are deterministic checks the request must pass before a single token moves. If policy can't be evaluated, the answer is "denied."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three chains, on purpose.&lt;/strong&gt; BPA 1.0 is normatively defined for &lt;strong&gt;Base, Ethereum, and Solana&lt;/strong&gt; — where agent payment activity actually concentrates, plus institutional reach. We run the reference contract on more chains, but a spec's credibility is its weakest claim. Everything in the normative body is mainnet and source-verified (the settlement contracts are verified, exact-match, on BaseScan and Etherscan). Breadth that isn't load-bearing is just surface area for doubt.&lt;/p&gt;

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

&lt;p&gt;Spraay is the reference implementation (full disclosure: it's ours, and writing the spec forced us to make it airtight). You can hit it two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTTP / x402:&lt;/strong&gt; &lt;code&gt;POST https://gateway.spraay.app/api/v1/batch/execute&lt;/code&gt; — returns an unsigned transaction for your agent to sign.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP:&lt;/strong&gt; the &lt;code&gt;spraay_batch_execute&lt;/code&gt; tool, published on Smithery as &lt;code&gt;@plagtech/spraay-x402-mcp&lt;/code&gt;, described by intent so your agent matches it at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The on-chain protocol fee is 0.30%, with a 200-recipient cap per call (chunk larger batches under one idempotency key).&lt;/p&gt;

&lt;h2&gt;
  
  
  It's an open standard — build on it
&lt;/h2&gt;

&lt;p&gt;BPA is published under &lt;strong&gt;CC-BY-4.0&lt;/strong&gt;. Implementations are unrestricted and need no permission. There's a conformance checklist (§14) and a self-attestation format for any facilitator — not just ours — to claim conformance. If you're building agent infrastructure and you touch payouts, this is meant to be the reference you point your own tooling at.&lt;/p&gt;

&lt;p&gt;If the attestation model for task-gated payments (pay-on-approval) is something you have strong opinions about, that's the one piece explicitly scoped for 1.1 — open an issue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spec:&lt;/strong&gt; &lt;a href="https://docs.spraay.app/bpa/1.0/" rel="noopener noreferrer"&gt;docs.spraay.app/bpa/1.0&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/plagtech/bpa-spec" rel="noopener noreferrer"&gt;github.com/plagtech/bpa-spec&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reference gateway:&lt;/strong&gt; &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;gateway.spraay.app&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agents are going to move a lot of money in small pieces to a lot of people. Let's at least agree on how.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>blockchain</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Compute Futures for AI Agents: Prepaid GPU and Inference Credits over x402</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Tue, 02 Jun 2026 01:04:03 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/compute-futures-for-ai-agents-prepaid-gpu-and-inference-credits-over-x402-4fhc</link>
      <guid>https://dev.to/mr_hamlin/compute-futures-for-ai-agents-prepaid-gpu-and-inference-credits-over-x402-4fhc</guid>
      <description>&lt;p&gt;There's a growing conversation about treating compute like a tradable commodity — something you can price, prepay, and hold, not just rent by the second. It's an interesting macro idea for data centers and GPU clusters. But there's a much more immediate version of it that nobody talks about: &lt;strong&gt;what does an AI agent do when it needs to buy compute, over and over, without a credit card or an API key?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's the gap I built &lt;a href="https://github.com/plagtech/spraay-compute" rel="noopener noreferrer"&gt;Spraay Compute &amp;amp; Futures&lt;/a&gt; to close.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with paying retail for every inference call
&lt;/h2&gt;

&lt;p&gt;Pay-per-call micropayments are great for one-off jobs. An agent hits an endpoint, gets a &lt;code&gt;402 Payment Required&lt;/code&gt;, signs a USDC authorization, retries, gets its result. Clean. This is exactly what x402 was built for, and it works.&lt;/p&gt;

&lt;p&gt;But agents don't run one job. They run &lt;em&gt;workloads&lt;/em&gt; — a research agent fires off hundreds of inference calls, a content pipeline generates dozens of images, a RAG system embeds thousands of chunks. Two things break down at that volume:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No budget predictability.&lt;/strong&gt; Every call is a fresh signature and a fresh settlement. There's no way to say "this agent has $50 to spend on compute this week" and have the rails enforce it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No volume pricing.&lt;/strong&gt; You pay the same per-call rate whether it's your first request or your ten-thousandth. In every other market, buying in bulk gets you a discount. Agentic compute had no equivalent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The usual fix is accounts and API keys with prepaid balances — exactly the thing x402 was supposed to kill. So the question became: can you get prepaid, discounted compute &lt;em&gt;without&lt;/em&gt; reintroducing accounts?&lt;/p&gt;

&lt;h2&gt;
  
  
  Compute futures: prepay once, draw down per job
&lt;/h2&gt;

&lt;p&gt;The answer is a prepaid compute-credit account that lives entirely on x402 rails. You deposit USDC once, get a credit balance with a tier discount baked in, and then run jobs against that balance. No per-call payment for the compute itself — each job just deducts from your credits at the discounted rate. Refund whatever you don't use.&lt;/p&gt;

&lt;p&gt;The tiers are simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;$10+&lt;/strong&gt; → 5% off&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$50+&lt;/strong&gt; → 10% off&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$200+&lt;/strong&gt; → 15% off&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole lifecycle is three calls:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;wrapFetchWithPayment&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@x402/fetch&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchPay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wrapFetchWithPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://gateway.spraay.app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// 1. Open a $50 account — lands in the 10% tier ($0.01 to set up)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;acct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchPay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;BASE&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/compute-futures/deposit`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;depositor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0xYourAgentWallet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;futuresId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;acct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;computeFuture&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "CFE-ABC12345"&lt;/span&gt;

&lt;span class="c1"&gt;// 2. Run jobs against the balance — $0.001 settlement, discount applied&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchPay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;BASE&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/compute-futures/execute`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;futuresId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-inference&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Summarize this filing: ...&lt;/span&gt;&lt;span class="dl"&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="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&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="c1"&gt;// → { billing: { charged: "$0.027", balanceRemaining: "$42.473 USDC" },&lt;/span&gt;
&lt;span class="c1"&gt;//     compute: { model: "Llama 3.3 70B" } }&lt;/span&gt;

&lt;span class="c1"&gt;// 3. Refund the unused balance anytime (depositor-only)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchPay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;BASE&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/compute-futures/refund`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;futuresId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;caller&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0xYourAgentWallet&lt;/span&gt;&lt;span class="dl"&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;That &lt;code&gt;execute&lt;/code&gt; call is the key move. The agent isn't signing and settling a payment for the inference — it already paid, in bulk, at a discount. It's just spending credits. You get budget predictability (the balance &lt;em&gt;is&lt;/em&gt; the budget) and volume pricing, without a single API key.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can actually run
&lt;/h2&gt;

&lt;p&gt;The same account works across the whole compute surface — text, images, video, audio, embeddings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Models&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;LLM inference&lt;/td&gt;
&lt;td&gt;11 models, 3B–405B (Chutes AI / Bittensor SN64, OpenRouter)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image generation&lt;/td&gt;
&lt;td&gt;FLUX Schnell/Dev/Pro, SDXL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Video generation&lt;/td&gt;
&lt;td&gt;MiniMax Video 01, Wan 2.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speech-to-text&lt;/td&gt;
&lt;td&gt;Whisper Large V3, 100+ languages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Text-to-speech&lt;/td&gt;
&lt;td&gt;voice synthesis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Embeddings&lt;/td&gt;
&lt;td&gt;for RAG and semantic search&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And if you'd rather just pay per call — no prepayment — every one of those is also a direct x402 endpoint (LLM inference at $0.03, GPU run at $0.06, embeddings at $0.005, and so on). There's a free &lt;code&gt;/compute/estimate&lt;/code&gt; to price a job before you commit, and a free &lt;code&gt;/compute/models&lt;/code&gt; to list what's available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why x402 makes this work
&lt;/h2&gt;

&lt;p&gt;The reason prepaid compute credits don't require accounts is that the wallet &lt;em&gt;is&lt;/em&gt; the account. Settlement is USDC on Base mainnet and Solana mainnet, verified through the x402 facilitator. The depositor address owns the credit balance; only that address can spend it or refund it. No login, no key rotation, no dashboard — the same primitives that make per-call x402 work also make prepaid balances work, just with the payment moved up front.&lt;/p&gt;

&lt;p&gt;It's a small idea with a real consequence: an autonomous agent can now hold a compute budget the way a team holds a cloud-credit balance, except it's permissionless, refundable, and settles in two seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drop it into your agent
&lt;/h2&gt;

&lt;p&gt;It's packaged as a skill, so any agent can install 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="c"&gt;# OpenClaw / ClawHub&lt;/span&gt;
npx clawhub &lt;span class="nb"&gt;install &lt;/span&gt;spraay-compute

&lt;span class="c"&gt;# Claude Code, Cursor, Codex, Gemini CLI (Vercel Skills CLI)&lt;/span&gt;
npx skills add plagtech/spraay-compute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The skill ships the full endpoint reference and runnable examples, so the agent knows exactly which endpoint to call, what it costs, and how to handle async jobs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/plagtech/spraay-compute" rel="noopener noreferrer"&gt;https://github.com/plagtech/spraay-compute&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway:&lt;/strong&gt; &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;https://gateway.spraay.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery manifest:&lt;/strong&gt; &lt;a href="https://gateway.spraay.app/.well-known/x402.json" rel="noopener noreferrer"&gt;https://gateway.spraay.app/.well-known/x402.json&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building agents that run real compute workloads, prepaying for a discount beats paying retail on every call. Open an account, run your jobs, refund the rest.&lt;/p&gt;

</description>
      <category>x402</category>
      <category>aiagents</category>
      <category>crypto</category>
      <category>web3</category>
    </item>
    <item>
      <title>BlackRock's CEO just called compute one of the next major markets. Here's why Spraay Protocol is already there.</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Wed, 27 May 2026 23:11:09 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/blackrocks-ceo-just-called-compute-one-of-the-next-major-markets-heres-why-spraay-protocol-is-2o7d</link>
      <guid>https://dev.to/mr_hamlin/blackrocks-ceo-just-called-compute-one-of-the-next-major-markets-heres-why-spraay-protocol-is-2o7d</guid>
      <description>&lt;h2&gt;
  
  
  The Signal No One Should Ignore
&lt;/h2&gt;

&lt;p&gt;When Larry Fink — the man who oversees $10 trillion in assets — tells the world that compute is becoming a financial instrument on par with equities and bonds, that's not speculation. That's a roadmap.&lt;/p&gt;

&lt;p&gt;And it's a roadmap we've been building on for months.&lt;/p&gt;

&lt;p&gt;At Spraay Protocol, we didn't wait for BlackRock to validate the thesis. We've been operating at the intersection of AI compute, machine-to-machine payments, and on-chain settlement since before the phrase "compute economy" entered the mainstream vocabulary. What Fink described as the future is, for us, already in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem Everyone Sees but Nobody Has Solved
&lt;/h2&gt;

&lt;p&gt;Here's the reality of AI compute right now: it's bought in bulk, priced opaquely, walled behind platform lock-in, and completely disconnected from the financial rails that every other commodity trades on.&lt;/p&gt;

&lt;p&gt;If you're an AI agent — and there will be millions of them — you can't call up a cloud provider and negotiate a rate. You can't hedge against a price spike during peak inference demand. You don't have a treasury function. You don't have a credit line.&lt;/p&gt;

&lt;p&gt;You just pay whatever you're charged, whenever you're charged, and hope for the best.&lt;/p&gt;

&lt;p&gt;That's not how real markets work. Real markets have price discovery. Real markets have futures. Real markets have settlement infrastructure.&lt;/p&gt;

&lt;p&gt;Spraay is that infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Actually Built
&lt;/h2&gt;

&lt;p&gt;Spraay Protocol is a multi-chain x402 payment gateway — the protocol Coinbase introduced that lets machines pay other machines at the HTTP layer. Every API call, every inference request, every data retrieval can carry a payment natively. No invoices. No subscriptions. No human in the loop.&lt;/p&gt;

&lt;p&gt;We took that foundation and built what the compute economy actually needs:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compute Futures and Escrow.&lt;/strong&gt; Prepaid credit systems with tiered pricing that let agents and developers lock in compute costs ahead of time. When inference demand spikes — and it will — our users have already secured their capacity at yesterday's price.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;115 live paid endpoints across 33 categories.&lt;/strong&gt; This isn't a whitepaper. This is &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;production infrastructure&lt;/a&gt; spanning AI inference, on-chain data, oracles, messaging, storage, and more — all payable via x402 on 13+ chains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Batch payment infrastructure.&lt;/strong&gt; Enterprise-grade payroll and multi-recipient disbursement, because the compute economy doesn't run on one-to-one transactions. It runs on networks paying networks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An &lt;a href="https://smithery.ai/servers/Plagtech/Spraay-x402-mcp" rel="noopener noreferrer"&gt;MCP server with 120 tools&lt;/a&gt;.&lt;/strong&gt; Direct integration into the AI agent ecosystem — LangChain, CrewAI, AutoGPT, and beyond. Agents don't just use Spraay. They think with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why x402 Is the Payment Rail for Compute
&lt;/h2&gt;

&lt;p&gt;The genius of x402 is its simplicity. An HTTP 402 status code has always meant "payment required." Coinbase's protocol made it machine-readable. Spraay made it machine-complete.&lt;/p&gt;

&lt;p&gt;Think about what this means for the compute market Fink is describing. Every inference endpoint becomes a tradeable unit. Every API call carries provable settlement. Every agent has a native way to pay for the resources it consumes — across any chain, at any scale, without a single human approving a transaction.&lt;/p&gt;

&lt;p&gt;This isn't DeFi trying to reinvent finance. This is finance's existing logic — futures, escrow, settlement, clearing — implemented natively for the first commodity that was born digital.&lt;/p&gt;

&lt;p&gt;Compute didn't need to be tokenized. It needed to be &lt;em&gt;transactable&lt;/em&gt;. That's what we provide.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Landscape Is Moving Our Way
&lt;/h2&gt;

&lt;p&gt;Look at the signals beyond Fink's statement:&lt;/p&gt;

&lt;p&gt;AI agent frameworks are proliferating. Every major tech company is building autonomous systems that need to procure their own resources. The conversation has shifted from "will agents handle money?" to "how do we make agent payments safe and efficient?"&lt;/p&gt;

&lt;p&gt;The x402 ecosystem is growing. Coinbase shipped the protocol. Developers are building on it. And Spraay has been in the room since day one — not observing, but operating. We have the most comprehensive x402 gateway in production. That's not a claim we make lightly. Count the endpoints. Count the chains. Count the categories.&lt;/p&gt;

&lt;p&gt;On-chain settlement is being taken seriously by institutions that dismissed it two years ago. When the world's largest asset manager starts drawing parallels between compute and traditional commodities, the infrastructure question becomes urgent. Who settles these transactions? On what rails? With what guarantees?&lt;/p&gt;

&lt;p&gt;We have answers. Live ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Comes Next
&lt;/h2&gt;

&lt;p&gt;We're not slowing down. The Spraay roadmap is built around a simple conviction: the compute economy will be the largest machine-to-machine market in history, and it will need payment infrastructure that's as fast, programmable, and autonomous as the agents that run on it.&lt;/p&gt;

&lt;p&gt;That means deeper futures and hedging primitives. More chains. More endpoints. Tighter integrations into every major agent framework. And continued leadership in the x402 space — not because we want the title, but because we've earned it by building while others were still debating.&lt;/p&gt;

&lt;p&gt;The capital is coming. Fink said so. The infrastructure has to be ready.&lt;/p&gt;

&lt;p&gt;It already is.&lt;/p&gt;




&lt;p&gt;💧 &lt;strong&gt;Spraay Protocol&lt;/strong&gt; — Multi-chain x402 payment gateway and compute settlement infrastructure.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://spraay.app" rel="noopener noreferrer"&gt;spraay.app&lt;/a&gt; · ⚡ &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;Live Gateway&lt;/a&gt; · 🐦 &lt;a href="https://twitter.com/Spraay_app" rel="noopener noreferrer"&gt;@Spraay_app&lt;/a&gt; · 📡 &lt;a href="https://smithery.ai/servers/Plagtech/Spraay-x402-mcp" rel="noopener noreferrer"&gt;MCP Server on Smithery&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you're building AI agents that need to pay for compute, we should talk.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>x402</category>
      <category>ai</category>
      <category>cryptocurrency</category>
      <category>web3</category>
    </item>
    <item>
      <title>Spraay Brings Batch Payments to Canton Network Amid Wall Street Tokenization Push</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Mon, 25 May 2026 00:38:46 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/spraay-brings-batch-payments-to-canton-network-amid-wall-street-tokenization-push-2clj</link>
      <guid>https://dev.to/mr_hamlin/spraay-brings-batch-payments-to-canton-network-amid-wall-street-tokenization-push-2clj</guid>
      <description>&lt;p&gt;Spent the last few days adding Canton Network support to Spraay Protocol's batch payment infrastructure. It's chain 16 for Spraay, and the most interesting one we've integrated to date — for reasons that have less to do with us and more to do with where Canton is going.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Canton context
&lt;/h2&gt;

&lt;p&gt;If you've been heads-down in crypto Twitter, Canton is easy to miss. While most of the EVM ecosystem has been arguing about L2 fragmentation, Canton has quietly become the rail of choice for serious institutional tokenization. The numbers are real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DTCC&lt;/strong&gt; — which clears the vast majority of U.S. securities and custodies $114T in assets — partnered with Digital Asset in December 2025 to tokenize DTC-custodied U.S. Treasuries on Canton, with broader rollout through 2H 2026&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JPMorgan's Kinexys&lt;/strong&gt; is deploying JPM Coin natively on Canton in phases throughout 2026&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broadridge's&lt;/strong&gt; distributed ledger repo platform, running on Canton rails, already processes &lt;strong&gt;$4 trillion monthly&lt;/strong&gt; in overnight Treasury financing&lt;/li&gt;
&lt;li&gt;Goldman Sachs, BNY Mellon, BNP Paribas, HSBC, Euroclear, S&amp;amp;P Global, Nasdaq are all participants&lt;/li&gt;
&lt;li&gt;Network-wide: ~$6T in tokenized real-world assets across 600+ institutions, ~500K daily transactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a network built for the financial plumbing layer most crypto-native builders don't think about every day. And it's already running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where batch payments fit
&lt;/h2&gt;

&lt;p&gt;Most of Spraay's chains are payment-rail-first: send USDC to N recipients, take a 0.3% protocol fee, optimize gas. That story translates cleanly to retail and to agent-driven commerce (we've leaned hard into x402-style agent payments).&lt;/p&gt;

&lt;p&gt;Canton is different. Holdings are UTXO-style. Transfers go through Splice's Token Standard via a &lt;code&gt;TransferFactory_Transfer&lt;/code&gt; choice on the global synchronizer. Instruments are admin-scoped — the DSO party admins Canton Coin, but any institution issuing on Canton (a tokenized Treasury, a deposit token, a fund share) can be its own instrument admin.&lt;/p&gt;

&lt;p&gt;So a batch payment primitive that works against Token Standard isn't "competing with DTCC." It's a small piece of utility infra that any app building on Canton can compose with — programmatic disbursements, fund flows between sub-accounts, payroll, agent-driven micropayments — whether the instrument is Canton Coin today or a tokenized money-market fund share tomorrow.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://github.com/plagtech/spraay-canton" rel="noopener noreferrer"&gt;&lt;code&gt;github.com/plagtech/spraay-canton&lt;/code&gt;&lt;/a&gt; runs against the cn-quickstart LocalNet. It exposes a REST API for batch payments, queries holdings via the Token Standard Holding interface, fetches the TransferFactory from the Scan-hosted registry, executes one &lt;code&gt;TransferFactory_Transfer&lt;/code&gt; per recipient, and collects the protocol fee through a second transfer to the operator party. Same shape as every other Spraay chain — just spoken in Daml.&lt;/p&gt;

&lt;p&gt;The repo is open, the integration is small, and the door's open if anyone building on Canton wants payment primitives or just wants to compare notes.&lt;/p&gt;

&lt;p&gt;Spraay now spans 16 chains. The interesting part isn't the count — it's that the span now goes from retail-facing chains all the way to the network where institutional tokenization is being built. That's a different kind of map than it was last year.&lt;/p&gt;

</description>
      <category>payments</category>
      <category>wallstreet</category>
      <category>x402</category>
      <category>spraay</category>
    </item>
    <item>
      <title>Spraay just introduced new endpoints for Solana Agents.</title>
      <dc:creator>Mr Hamlin</dc:creator>
      <pubDate>Sat, 16 May 2026 00:34:34 +0000</pubDate>
      <link>https://dev.to/mr_hamlin/spraay-just-introduced-new-endpoints-for-solana-agents-45fp</link>
      <guid>https://dev.to/mr_hamlin/spraay-just-introduced-new-endpoints-for-solana-agents-45fp</guid>
      <description>&lt;p&gt;If you've built a Solana DeFi agent recently, you know the shape of the work.&lt;/p&gt;

&lt;p&gt;You write a quote function. It calls Jupiter directly because that's where the liquidity is. Then you need wallet holdings, so you sign up for Helius and stick a key in &lt;code&gt;.env&lt;/code&gt;. Then you need price feeds, so you wire up Pyth Hermes. Three providers, three rate limits, three sets of error semantics, three keys to rotate. Your agent does six interesting things and you're managing eight pieces of infrastructure.&lt;/p&gt;

&lt;p&gt;I've been building Spraay — an x402 gateway — for several months, and as of today it speaks Solana DeFi natively. Six new endpoints, one gateway, payable per call in USDC. If you're somewhere in the middle of writing the agent I just described, this might save you a weekend.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's new
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET  /api/v1/solana/jupiter/quote         $0.005
POST /api/v1/solana/jupiter/swap-tx       $0.01
GET  /api/v1/solana/helius/assets-by-owner $0.003
GET  /api/v1/solana/helius/asset          $0.002
GET  /api/v1/solana/pyth/price            $0.005
GET  /api/v1/solana/pyth/prices           $0.008
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All six are pure proxies to the real upstream — Jupiter v6, Helius DAS, Pyth Hermes. No synthetic data, no mock responses. Spraay does payment, validation, error normalization, and Bazaar discovery. Your agent does everything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you don't deal with
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No accounts.&lt;/strong&gt; No signup, no email confirmation, no dashboard. Your agent's wallet is its identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No API keys.&lt;/strong&gt; Payment is the auth. You pay $0.005, you get the response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No bridging.&lt;/strong&gt; Pay in either Solana USDC (SPL) or Base USDC (ERC-20). Spraay accepts both on every endpoint. Useful when your agent already has USDC on Base from doing other things.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No upstream rate-limit babysitting.&lt;/strong&gt; Spraay holds the paid tier with Helius and Jupiter. You see clean 402s on success, 429 with &lt;code&gt;retryAfter&lt;/code&gt; if upstream rate-limits us.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No custody risk on swaps.&lt;/strong&gt; Jupiter &lt;code&gt;swap-tx&lt;/code&gt; returns an unsigned &lt;code&gt;VersionedTransaction&lt;/code&gt;. Your wallet signs and submits. The gateway never touches keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Working code
&lt;/h2&gt;

&lt;p&gt;The integration that took me three days to do raw, ported to Spraay in about twenty minutes. The example below uses pseudocode for the payment client — drop in whatever x402 client you're already using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;VersionedTransaction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Connection&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@solana/web3.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Your x402 client of choice — handles the 402 → pay → retry flow&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;makeX402Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;baseUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://gateway.spraay.app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// Pay in Solana USDC, Base USDC, or both — your call&lt;/span&gt;
  &lt;span class="na"&gt;solanaPrivateKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SOLANA_PRIVATE_KEY&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="nx"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Connection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SOLANA_RPC_URL&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 1. Read the agent's wallet — SPL tokens, NFTs, native SOL balance, paginated&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;holdings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/solana/helius/assets-by-owner&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s2"&gt;`?owner=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;myWallet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBase58&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;&amp;amp;limit=100`&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Wallet holds &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;holdings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; assets, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;holdings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nativeBalance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lamports&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;e9&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; SOL`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 2. Pull live prices for the agent's watchlist in one call&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prices&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/solana/pyth/prices?feedIds=SOL,BTC,ETH,JUP,BONK&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;solPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SOL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// e.g. 142.37&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;solConfidence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SOL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;confidence&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// ± confidence interval&lt;/span&gt;

&lt;span class="c1"&gt;// 3. Quote a swap&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/solana/jupiter/quote&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;?inputMint=USDC&amp;amp;outputMint=SOL&amp;amp;amount=10000000&amp;amp;slippageBps=50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`10 USDC → &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;outAmount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;e9&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; SOL via &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;routeHops&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-hop route`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 4. Build the unsigned transaction&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;swap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/v1/solana/jupiter/swap-tx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;quoteResponse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;userPublicKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;myWallet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBase58&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;prioritizationFeeLamports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// 5. Sign and submit yourself — gateway never sees the key&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;VersionedTransaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deserialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&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="nx"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;swapTransaction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;base64&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;myWallet&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendTransaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Swap submitted: https://solscan.io/tx/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five operations, four endpoints, one payment rail. The agent pays the per-call cost out of its own wallet, gas-of-the-API-economy style.&lt;/p&gt;

&lt;h2&gt;
  
  
  Endpoint details, quickly
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Jupiter
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;/quote&lt;/code&gt; wraps &lt;code&gt;quote-api.jup.ag/v6/quote&lt;/code&gt; (or &lt;code&gt;api.jup.ag/swap/v1/quote&lt;/code&gt; on the paid tier — Spraay holds the key). Returns route plan, slippage, output amount, price impact. Accepts symbol aliases (&lt;code&gt;USDC&lt;/code&gt;, &lt;code&gt;SOL&lt;/code&gt;, &lt;code&gt;BONK&lt;/code&gt;, &lt;code&gt;WIF&lt;/code&gt;, &lt;code&gt;JUP&lt;/code&gt;, etc.) or raw base58 mints.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/swap-tx&lt;/code&gt; wraps the &lt;code&gt;/swap&lt;/code&gt; endpoint. Returns a base64-encoded &lt;code&gt;VersionedTransaction&lt;/code&gt;. Pass the raw &lt;code&gt;quoteResponse&lt;/code&gt; from &lt;code&gt;/quote&lt;/code&gt; and your &lt;code&gt;userPublicKey&lt;/code&gt;. Optional: &lt;code&gt;wrapAndUnwrapSol&lt;/code&gt;, &lt;code&gt;prioritizationFeeLamports&lt;/code&gt;. Gateway never signs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Helius DAS
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;/assets-by-owner&lt;/code&gt; wraps &lt;code&gt;getAssetsByOwner&lt;/code&gt;. Returns SPL tokens, regular NFTs, compressed NFTs, and native SOL balance in one paginated response. Default &lt;code&gt;limit=100&lt;/code&gt;, max &lt;code&gt;1000&lt;/code&gt;. &lt;code&gt;showFungible&lt;/code&gt; and &lt;code&gt;showNativeBalance&lt;/code&gt; both default &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/asset&lt;/code&gt; wraps &lt;code&gt;getAsset&lt;/code&gt;. Returns full metadata for a single asset by mint or compressed NFT ID — image, attributes, royalty info, compression details, ownership.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pyth
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;/price&lt;/code&gt; wraps Hermes &lt;code&gt;/v2/updates/price/latest&lt;/code&gt; for one feed. Returns the human-readable price (already scaled by &lt;code&gt;expo&lt;/code&gt;), confidence interval, publish time, and EMA price. Symbol aliases for the obvious ones (&lt;code&gt;SOL&lt;/code&gt;, &lt;code&gt;BTC&lt;/code&gt;, &lt;code&gt;ETH&lt;/code&gt;, &lt;code&gt;USDC&lt;/code&gt;, &lt;code&gt;USDT&lt;/code&gt;, &lt;code&gt;JUP&lt;/code&gt;, &lt;code&gt;PYTH&lt;/code&gt;, &lt;code&gt;BONK&lt;/code&gt;, &lt;code&gt;WIF&lt;/code&gt;, &lt;code&gt;JTO&lt;/code&gt;) or pass the 64-char hex feed ID.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/prices&lt;/code&gt; is the batch version. Up to 50 feeds, comma-separated. Returns a &lt;code&gt;{ symbol: priceObject }&lt;/code&gt; map keyed by uppercase symbol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it before you integrate
&lt;/h2&gt;

&lt;p&gt;Every endpoint returns a clean &lt;code&gt;402 Payment Required&lt;/code&gt; with full x402 payment requirements when you call without paying. You can see the schema, pricing, and accepts arrays directly:&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="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"https://gateway.spraay.app/api/v1/solana/pyth/price?feedId=SOL"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 402 body includes both EVM and Solana payment options. Your x402 client picks the rail.&lt;/p&gt;

&lt;p&gt;If you want to see all six (plus the rest of Spraay's catalog) in Bazaar-discoverable form:&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="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"https://gateway.spraay.app/.well-known/x402.json"&lt;/span&gt; | jq &lt;span class="s1"&gt;'.resources[] | select(.resource | contains("/solana/"))'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Error handling notes worth knowing
&lt;/h2&gt;

&lt;p&gt;A few things that will save debugging time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;429 rate_limit&lt;/code&gt;&lt;/strong&gt; means we're being rate-limited by an upstream provider. Response includes &lt;code&gt;retryAfter&lt;/code&gt; in seconds. Backoff and retry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;502 upstream_error&lt;/code&gt;&lt;/strong&gt; from any endpoint means the upstream returned a non-2xx. The body contains the actual upstream error in &lt;code&gt;detail&lt;/code&gt;. Useful for debugging slippage tolerance, missing feeds, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;400 invalid_input_mint&lt;/code&gt;&lt;/strong&gt; etc. are pre-flight validation failures. Spraay never charges you if validation fails before the upstream call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pyth feed IDs&lt;/strong&gt; are case-sensitive hex. If you're not using aliases, lowercase everything or use the alias map.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Gateway: &lt;a href="https://gateway.spraay.app" rel="noopener noreferrer"&gt;gateway.spraay.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Full endpoint catalog: &lt;a href="https://docs.spraay.app" rel="noopener noreferrer"&gt;docs.spraay.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Smithery MCP server: &lt;a href="https://smithery.ai/server/@plagtech/spraay-x402-mcp" rel="noopener noreferrer"&gt;smithery.ai/server/@plagtech/spraay-x402-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/plagtech" rel="noopener noreferrer"&gt;github.com/plagtech&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build something with this and it breaks, ping me — I respond fast and the roadmap is mostly driven by what builders actually ask for.&lt;/p&gt;

&lt;p&gt;💧&lt;/p&gt;

</description>
      <category>ai</category>
      <category>x402</category>
      <category>solana</category>
      <category>defi</category>
    </item>
  </channel>
</rss>
