<?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>Forem: MPP TestKit</title>
    <description>The latest articles on Forem by MPP TestKit (@mpptestkit).</description>
    <link>https://forem.com/mpptestkit</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3915864%2F1e59c307-27a8-4d27-8ff9-099aa86a79e9.png</url>
      <title>Forem: MPP TestKit</title>
      <link>https://forem.com/mpptestkit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mpptestkit"/>
    <language>en</language>
    <item>
      <title>The Infrastructure Gap: Why the Machine Economy Is Stalling and How We Fix It</title>
      <dc:creator>MPP TestKit</dc:creator>
      <pubDate>Mon, 11 May 2026 14:45:47 +0000</pubDate>
      <link>https://forem.com/mpptestkit/the-infrastructure-gap-why-the-machine-economy-is-stalling-and-how-we-fix-it-59e3</link>
      <guid>https://forem.com/mpptestkit/the-infrastructure-gap-why-the-machine-economy-is-stalling-and-how-we-fix-it-59e3</guid>
      <description>&lt;p&gt;Autonomous AI agents are no longer some far-away prediction.&lt;/p&gt;

&lt;p&gt;They are already here.&lt;/p&gt;

&lt;p&gt;They are making API calls, processing massive datasets, interacting with tools, executing complex workflows, and operating without a human sitting behind every click.&lt;/p&gt;

&lt;p&gt;But while agentic activity is exploding, there is still one massive infrastructure gap that almost nobody is solving properly.&lt;/p&gt;

&lt;p&gt;The question is no longer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can agents perform work?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The real question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do agents pay for the services they consume?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Right now, the answer is messy.&lt;/p&gt;

&lt;p&gt;We are trying to force autonomous machines into a financial system built for humans.&lt;/p&gt;

&lt;p&gt;We ask agents to deal with credit cards, checkout pages, monthly SaaS plans, account creation, user databases, billing dashboards, and subscription logic.&lt;/p&gt;

&lt;p&gt;That is not machine-native infrastructure.&lt;/p&gt;

&lt;p&gt;That is duct tape.&lt;/p&gt;

&lt;p&gt;And duct tape does not scale the machine economy.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Nobody Wants to Build Around
&lt;/h2&gt;

&lt;p&gt;If you are an API provider today, you are standing at a very uncomfortable crossroads.&lt;/p&gt;

&lt;p&gt;You know agents are going to become one of the biggest consumers of APIs.&lt;/p&gt;

&lt;p&gt;But you probably do not want to build an entire billing department just to serve them.&lt;/p&gt;

&lt;p&gt;You do not want to manage thousands of bot accounts.&lt;/p&gt;

&lt;p&gt;You do not want to build custom payment verification logic from scratch.&lt;/p&gt;

&lt;p&gt;You do not want to create subscription tiers for machines that may only need your endpoint for five seconds.&lt;/p&gt;

&lt;p&gt;And you definitely do not want to spend months engineering a system that may become obsolete before it even ships.&lt;/p&gt;

&lt;p&gt;That uncertainty is slowing the market down.&lt;/p&gt;

&lt;p&gt;API providers are waiting.&lt;/p&gt;

&lt;p&gt;Agent developers are hacking around the problem.&lt;/p&gt;

&lt;p&gt;And the machine economy is being starved of the premium data, compute, and services it needs to scale.&lt;/p&gt;

&lt;p&gt;We decided to fix that.&lt;/p&gt;




&lt;h2&gt;
  
  
  What MPP TestKit Actually Is
&lt;/h2&gt;

&lt;p&gt;MPP TestKit is the developer infrastructure layer between autonomous agents and API endpoints.&lt;/p&gt;

&lt;p&gt;It is not just another payment tool.&lt;/p&gt;

&lt;p&gt;It is not a checkout page.&lt;/p&gt;

&lt;p&gt;It is not a dashboard pretending to be infrastructure.&lt;/p&gt;

&lt;p&gt;MPP TestKit is the payment rail for machine-to-machine commerce.&lt;/p&gt;

&lt;p&gt;Think about what Cloudflare did for web infrastructure.&lt;/p&gt;

&lt;p&gt;Before Cloudflare, website operators had to manually configure DDoS protection, SSL certificates, CDN caching, DNS routing, and performance optimization.&lt;/p&gt;

&lt;p&gt;It was expensive, fragile, and deeply technical.&lt;/p&gt;

&lt;p&gt;Cloudflare turned that complexity into an invisible layer.&lt;/p&gt;

&lt;p&gt;You pointed your traffic through it, and the hard stuff just worked.&lt;/p&gt;

&lt;p&gt;MPP TestKit does something similar for agentic commerce.&lt;/p&gt;

&lt;p&gt;API providers do not need to become blockchain settlement experts.&lt;/p&gt;

&lt;p&gt;They do not need to write custom verification logic.&lt;/p&gt;

&lt;p&gt;They do not need to maintain bot user accounts.&lt;/p&gt;

&lt;p&gt;They do not need to build billing systems from scratch.&lt;/p&gt;

&lt;p&gt;They list their service, wrap their endpoint with middleware, and let the HTTP 402 payment flow handle the rest.&lt;/p&gt;

&lt;p&gt;The provider keeps building the actual product.&lt;/p&gt;

&lt;p&gt;Revenue flows directly to their wallet.&lt;/p&gt;

&lt;p&gt;Agents get machine-native access.&lt;/p&gt;

&lt;p&gt;And the API economy finally gets rails built for machines.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With Human-Centric Billing
&lt;/h2&gt;

&lt;p&gt;Legacy billing is built for people.&lt;/p&gt;

&lt;p&gt;That sounds obvious, but it matters.&lt;/p&gt;

&lt;p&gt;Most billing systems assume there is a human on the other side.&lt;/p&gt;

&lt;p&gt;A human can create an account.&lt;/p&gt;

&lt;p&gt;A human can enter an email.&lt;/p&gt;

&lt;p&gt;A human can pick a subscription plan.&lt;/p&gt;

&lt;p&gt;A human can click through Stripe.&lt;/p&gt;

&lt;p&gt;A human can manage invoices.&lt;/p&gt;

&lt;p&gt;Agents do not work like that.&lt;/p&gt;

&lt;p&gt;Autonomous systems need fast, stateless, programmable access.&lt;/p&gt;

&lt;p&gt;The existing system breaks down in three major ways.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Identity Overload
&lt;/h2&gt;

&lt;p&gt;Every service wants an email, password, user profile, billing address, and sometimes even KYC.&lt;/p&gt;

&lt;p&gt;That makes sense for humans.&lt;/p&gt;

&lt;p&gt;It makes no sense for autonomous agents.&lt;/p&gt;

&lt;p&gt;Agents do not need traditional identities.&lt;/p&gt;

&lt;p&gt;They need task-based access.&lt;/p&gt;

&lt;p&gt;They need to request a resource, pay for it, receive it, and move on.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Stateful Subscriptions
&lt;/h2&gt;

&lt;p&gt;Monthly SaaS billing is a human pattern.&lt;/p&gt;

&lt;p&gt;A human may use a tool every day, so charging $20/month makes sense.&lt;/p&gt;

&lt;p&gt;But an agent may spin up, make 500 requests in ten seconds, complete its task, and disappear.&lt;/p&gt;

&lt;p&gt;A subscription model is completely misaligned with that behavior.&lt;/p&gt;

&lt;p&gt;The machine economy needs usage-based access at the request level.&lt;/p&gt;

&lt;p&gt;Not bloated monthly plans.&lt;/p&gt;

&lt;p&gt;Not seats.&lt;/p&gt;

&lt;p&gt;Not dashboards.&lt;/p&gt;

&lt;p&gt;Just pay, access, execute.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Friction-Heavy Settlement
&lt;/h2&gt;

&lt;p&gt;Credit card systems were designed to detect suspicious automated behavior.&lt;/p&gt;

&lt;p&gt;But in the machine economy, every request is automated behavior.&lt;/p&gt;

&lt;p&gt;That creates a fundamental mismatch.&lt;/p&gt;

&lt;p&gt;The very thing machines are supposed to do at scale is the thing legacy payment systems are trained to slow down or block.&lt;/p&gt;

&lt;p&gt;The solution is not to slightly improve human billing.&lt;/p&gt;

&lt;p&gt;The solution is to move to stateless, machine-native access.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTP 402: The Only Logical Standard
&lt;/h2&gt;

&lt;p&gt;At the heart of MPP TestKit is the x402 flow.&lt;/p&gt;

&lt;p&gt;HTTP 402, also known as &lt;code&gt;Payment Required&lt;/code&gt;, has existed in the HTTP standard for a long time.&lt;/p&gt;

&lt;p&gt;But for years, it remained mostly unused.&lt;/p&gt;

&lt;p&gt;The internet had the status code, but not the infrastructure to make it useful.&lt;/p&gt;

&lt;p&gt;MPP TestKit changes that.&lt;/p&gt;

&lt;p&gt;We are building a production-ready implementation of HTTP 402 for machine payments on Solana.&lt;/p&gt;

&lt;p&gt;In an MPP-enabled ecosystem, the transaction is the authorization.&lt;/p&gt;

&lt;p&gt;There is no login page.&lt;/p&gt;

&lt;p&gt;There is no checkout session.&lt;/p&gt;

&lt;p&gt;There is no subscription screen.&lt;/p&gt;

&lt;p&gt;There is only the request and the settlement.&lt;/p&gt;




&lt;h2&gt;
  
  
  How the x402 Flow Works
&lt;/h2&gt;

&lt;p&gt;The flow is simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Request
&lt;/h3&gt;

&lt;p&gt;An agent calls a protected API endpoint.&lt;/p&gt;

&lt;p&gt;The endpoint checks whether the request includes valid payment proof.&lt;/p&gt;

&lt;p&gt;If there is no payment proof, the server does not return the data.&lt;/p&gt;

&lt;p&gt;Instead, it starts the payment handshake.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The 402 Challenge
&lt;/h3&gt;

&lt;p&gt;The server responds with:&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;402 Payment Required
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this is not a dead end.&lt;/p&gt;

&lt;p&gt;It is a machine-readable challenge.&lt;/p&gt;

&lt;p&gt;The response includes payment details such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Price&lt;/li&gt;
&lt;li&gt;Recipient wallet&lt;/li&gt;
&lt;li&gt;Network&lt;/li&gt;
&lt;li&gt;Required settlement information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent now knows exactly what it must pay to access the resource.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Settlement
&lt;/h3&gt;

&lt;p&gt;The agent SDK reads the 402 response.&lt;/p&gt;

&lt;p&gt;It signs a Solana transaction for the exact amount required.&lt;/p&gt;

&lt;p&gt;Then it submits the transaction to the network.&lt;/p&gt;

&lt;p&gt;No human approval screen.&lt;/p&gt;

&lt;p&gt;No card form.&lt;/p&gt;

&lt;p&gt;No checkout redirect.&lt;/p&gt;

&lt;p&gt;Just machine-native settlement.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The Receipt
&lt;/h3&gt;

&lt;p&gt;After payment, the agent retries the original request.&lt;/p&gt;

&lt;p&gt;This time, it includes a payment receipt in the request headers.&lt;/p&gt;

&lt;p&gt;The server can now verify that payment actually happened.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Access Granted
&lt;/h3&gt;

&lt;p&gt;The server verifies the transaction on-chain.&lt;/p&gt;

&lt;p&gt;If the receipt is valid, the endpoint releases the data.&lt;/p&gt;

&lt;p&gt;The agent gets access.&lt;/p&gt;

&lt;p&gt;The provider gets paid.&lt;/p&gt;

&lt;p&gt;The whole loop happens programmatically.&lt;/p&gt;

&lt;p&gt;That is the missing primitive.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Solana Makes Sense for This
&lt;/h2&gt;

&lt;p&gt;Machine payments require speed, low cost, and high throughput.&lt;/p&gt;

&lt;p&gt;A machine economy cannot run on slow settlement and expensive fees.&lt;/p&gt;

&lt;p&gt;If an agent wants to pay fractions of a dollar for an API request, the payment rail needs to make economic sense.&lt;/p&gt;

&lt;p&gt;Solana gives this model the right foundation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast settlement&lt;/li&gt;
&lt;li&gt;Low fees&lt;/li&gt;
&lt;li&gt;High throughput&lt;/li&gt;
&lt;li&gt;Strong developer tooling&lt;/li&gt;
&lt;li&gt;A growing ecosystem of wallets, agents, and on-chain infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MPP TestKit takes those rails and makes them usable for developers building real apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  Engineering the Multi-Language Standard
&lt;/h2&gt;

&lt;p&gt;A protocol is only as strong as its adoption.&lt;/p&gt;

&lt;p&gt;If you only support one language, you immediately limit the ecosystem.&lt;/p&gt;

&lt;p&gt;The agent economy is language-agnostic.&lt;/p&gt;

&lt;p&gt;Some developers build agents in TypeScript.&lt;/p&gt;

&lt;p&gt;Some build backend services in Go.&lt;/p&gt;

&lt;p&gt;Some build AI systems in Python.&lt;/p&gt;

&lt;p&gt;Some build high-performance infrastructure in Rust.&lt;/p&gt;

&lt;p&gt;MPP TestKit is designed to meet developers where they already are.&lt;/p&gt;




&lt;h2&gt;
  
  
  The TypeScript SDK: The Agent Toolkit
&lt;/h2&gt;

&lt;p&gt;The TypeScript SDK is built for developers creating agents and client-side integrations.&lt;/p&gt;

&lt;p&gt;Developers should not need to understand every detail of Solana transaction construction just to let an agent pay for an API.&lt;/p&gt;

&lt;p&gt;That is why we built:&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="nf"&gt;mppFetch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works like a drop-in replacement for the standard &lt;code&gt;fetch()&lt;/code&gt; API.&lt;/p&gt;

&lt;p&gt;But under the hood, it handles the entire 402 lifecycle.&lt;/p&gt;

&lt;p&gt;It can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect a &lt;code&gt;402 Payment Required&lt;/code&gt; response automatically&lt;/li&gt;
&lt;li&gt;Read the payment challenge&lt;/li&gt;
&lt;li&gt;Sign and submit the required Solana transaction&lt;/li&gt;
&lt;li&gt;Retry the request with a payment receipt&lt;/li&gt;
&lt;li&gt;Expose lifecycle callbacks for every step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For developers, this means they can build agents that pay for APIs without rebuilding the payment stack themselves.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lifecycle Callbacks
&lt;/h2&gt;

&lt;p&gt;MPP TestKit also includes lifecycle callbacks through &lt;code&gt;onStep&lt;/code&gt; events.&lt;/p&gt;

&lt;p&gt;That gives developers visibility into what is happening during payment execution.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wallet funded&lt;/li&gt;
&lt;li&gt;Payment submitted&lt;/li&gt;
&lt;li&gt;Receipt generated&lt;/li&gt;
&lt;li&gt;Receipt verified&lt;/li&gt;
&lt;li&gt;Request completed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters because machine payments should not feel like a black box.&lt;/p&gt;

&lt;p&gt;Developers need observability.&lt;/p&gt;

&lt;p&gt;They need debuggability.&lt;/p&gt;

&lt;p&gt;They need to know where a flow succeeds or fails.&lt;/p&gt;

&lt;p&gt;MPP TestKit gives them that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Ephemeral Wallet Support
&lt;/h2&gt;

&lt;p&gt;For testing and agentic workflows, MPP TestKit supports ephemeral wallets.&lt;/p&gt;

&lt;p&gt;This allows agents to spin up temporary session wallets for devnet testing and experimentation.&lt;/p&gt;

&lt;p&gt;That makes the developer experience much smoother.&lt;/p&gt;

&lt;p&gt;Instead of manually managing wallets and funding flows, builders can test the full payment loop quickly.&lt;/p&gt;

&lt;p&gt;This is especially useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI agent demos&lt;/li&gt;
&lt;li&gt;Devnet simulations&lt;/li&gt;
&lt;li&gt;Temporary task execution&lt;/li&gt;
&lt;li&gt;Agent sandboxing&lt;/li&gt;
&lt;li&gt;Protocol testing&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Airdrop Retry Logic
&lt;/h2&gt;

&lt;p&gt;Anyone who has built on devnet knows the pain.&lt;/p&gt;

&lt;p&gt;Sometimes faucets are slow.&lt;/p&gt;

&lt;p&gt;Sometimes airdrops fail.&lt;/p&gt;

&lt;p&gt;Sometimes the developer experience breaks for reasons unrelated to your actual product.&lt;/p&gt;

&lt;p&gt;MPP TestKit includes robust airdrop retry logic to reduce that friction.&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;p&gt;Developers should spend more time building and less time fighting the faucet.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Go SDK: High-Performance Backend Rails
&lt;/h2&gt;

&lt;p&gt;TypeScript is perfect for agents and frontend-adjacent developer workflows.&lt;/p&gt;

&lt;p&gt;Go is different.&lt;/p&gt;

&lt;p&gt;Go is built for high-performance backend systems.&lt;/p&gt;

&lt;p&gt;It is used for gateways, APIs, infrastructure services, and systems that need to handle concurrency at scale.&lt;/p&gt;

&lt;p&gt;The MPP Go SDK is designed for API providers.&lt;/p&gt;

&lt;p&gt;It fits naturally into &lt;code&gt;net/http&lt;/code&gt; middleware and allows providers to protect endpoints with payment verification logic.&lt;/p&gt;

&lt;p&gt;This gives backend teams a lightweight way to monetize endpoints without adding heavy runtime overhead.&lt;/p&gt;

&lt;p&gt;If you are building an API that needs to verify many payment-gated requests per second, Go is the natural fit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Python and Rust
&lt;/h2&gt;

&lt;p&gt;MPP TestKit is also expanding across Python and Rust.&lt;/p&gt;

&lt;p&gt;Python matters because the AI ecosystem lives there.&lt;/p&gt;

&lt;p&gt;A huge amount of agentic infrastructure, machine learning tooling, and automation logic is written in Python.&lt;/p&gt;

&lt;p&gt;Rust matters because performance-sensitive infrastructure needs safety and speed.&lt;/p&gt;

&lt;p&gt;As the machine economy matures, developers will need SDKs across the full stack.&lt;/p&gt;

&lt;p&gt;MPP TestKit is being built as a multi-language standard from day one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architectural Proof: Auton and Monetize
&lt;/h2&gt;

&lt;p&gt;We did not want to release only documentation.&lt;/p&gt;

&lt;p&gt;We wanted to prove the loop works.&lt;/p&gt;

&lt;p&gt;That is why we launched two apps built around the MPP TestKit ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auton&lt;/li&gt;
&lt;li&gt;Monetize&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They represent both sides of the machine economy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Auton: The Demand Side
&lt;/h2&gt;

&lt;p&gt;Auton represents demand.&lt;/p&gt;

&lt;p&gt;It is an autonomous agent client that discovers prices through the 402 handshake.&lt;/p&gt;

&lt;p&gt;It does not use a checkout page.&lt;/p&gt;

&lt;p&gt;It does not negotiate like a human.&lt;/p&gt;

&lt;p&gt;It does not need a subscription.&lt;/p&gt;

&lt;p&gt;It simply requests a resource, reads the server’s payment challenge, settles the required amount on Solana, and retrieves the data.&lt;/p&gt;

&lt;p&gt;Auton is the blueprint for how agents should behave in a machine-native economy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Monetize: The Supply Side
&lt;/h2&gt;

&lt;p&gt;Monetize represents supply.&lt;/p&gt;

&lt;p&gt;It shows how any developer can turn an existing API into a self-monetizing endpoint.&lt;/p&gt;

&lt;p&gt;With one middleware integration, a normal endpoint can become payment-gated.&lt;/p&gt;

&lt;p&gt;Monetize handles the verification logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Was the payment sent?&lt;/li&gt;
&lt;li&gt;Was it sent to the right wallet?&lt;/li&gt;
&lt;li&gt;Was the amount correct?&lt;/li&gt;
&lt;li&gt;Was it on the right network?&lt;/li&gt;
&lt;li&gt;Is the receipt valid?&lt;/li&gt;
&lt;li&gt;Has the receipt already been used?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the infrastructure API providers should not have to rebuild themselves.&lt;/p&gt;

&lt;p&gt;Together, Auton and Monetize prove that the accountless web is not theory.&lt;/p&gt;

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




&lt;h2&gt;
  
  
  The Economic Thesis: Beyond a Discount Token
&lt;/h2&gt;

&lt;p&gt;Every infrastructure ecosystem needs alignment.&lt;/p&gt;

&lt;p&gt;For MPP TestKit, that alignment layer is &lt;code&gt;$MTK&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But we have a specific view on token utility.&lt;/p&gt;

&lt;p&gt;We are not interested in empty governance theater.&lt;/p&gt;

&lt;p&gt;We do not believe token holders should vote on every technical decision that should be handled by engineers.&lt;/p&gt;

&lt;p&gt;Instead, &lt;code&gt;$MTK&lt;/code&gt; is designed around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access&lt;/li&gt;
&lt;li&gt;Alignment&lt;/li&gt;
&lt;li&gt;Reputation&lt;/li&gt;
&lt;li&gt;Builder incentives&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Developer Access and Premium Tooling
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;$MTK&lt;/code&gt; can act as the access key for advanced MPP TestKit features.&lt;/p&gt;

&lt;p&gt;As the ecosystem grows, token-based access can unlock premium developer tools such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hosted endpoints&lt;/li&gt;
&lt;li&gt;Advanced analytics&lt;/li&gt;
&lt;li&gt;Higher testing limits&lt;/li&gt;
&lt;li&gt;Premium dashboards&lt;/li&gt;
&lt;li&gt;Enhanced developer tooling&lt;/li&gt;
&lt;li&gt;Early access to new infrastructure modules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The builders most committed to the ecosystem should have the best tools to scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Micro-Payment Alignment
&lt;/h2&gt;

&lt;p&gt;As more agents use x402 rails and more developers list endpoints through Monetize, the overall utility of the ecosystem grows.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$MTK&lt;/code&gt; aligns the community around that growth.&lt;/p&gt;

&lt;p&gt;It becomes the unit of coordination for builders, users, providers, and early supporters of machine-native commerce.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Builder Incentives
&lt;/h2&gt;

&lt;p&gt;The people pushing the protocol forward should participate in the upside.&lt;/p&gt;

&lt;p&gt;That includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers building SDKs&lt;/li&gt;
&lt;li&gt;Engineers finding bugs&lt;/li&gt;
&lt;li&gt;Writers creating tutorials&lt;/li&gt;
&lt;li&gt;Builders launching apps&lt;/li&gt;
&lt;li&gt;Contributors improving integrations&lt;/li&gt;
&lt;li&gt;Community members onboarding new developers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$MTK&lt;/code&gt; gives the ecosystem a way to reward the people actually doing the work.&lt;/p&gt;

&lt;p&gt;Not just spectators.&lt;/p&gt;

&lt;p&gt;Builders.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Reputation and Staking
&lt;/h2&gt;

&lt;p&gt;This is one of the most important future paths.&lt;/p&gt;

&lt;p&gt;In an economy full of autonomous agents, reputation becomes critical.&lt;/p&gt;

&lt;p&gt;How does an agent know an API provider is reliable?&lt;/p&gt;

&lt;p&gt;How does a provider know an agent is not abusive?&lt;/p&gt;

&lt;p&gt;How do marketplaces rank endpoints without relying only on centralized reviews?&lt;/p&gt;

&lt;p&gt;A staking and reputation layer can help.&lt;/p&gt;

&lt;p&gt;Providers could stake &lt;code&gt;$MTK&lt;/code&gt; to signal commitment to uptime, quality, and reliability.&lt;/p&gt;

&lt;p&gt;Agents could hold or stake &lt;code&gt;$MTK&lt;/code&gt; to unlock higher rate limits, verified status, or access to premium endpoints.&lt;/p&gt;

&lt;p&gt;This creates a quality layer backed by economic skin in the game.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Sits Behind One Integration
&lt;/h2&gt;

&lt;p&gt;When a developer integrates MPP TestKit, they are not just adding a payment button.&lt;/p&gt;

&lt;p&gt;They are getting months of infrastructure engineering compressed into a single integration point.&lt;/p&gt;




&lt;h2&gt;
  
  
  Universal Receipt Verification
&lt;/h2&gt;

&lt;p&gt;MPP TestKit handles the logic required to verify that a Solana transaction actually happened and reached finality before access is granted.&lt;/p&gt;

&lt;p&gt;This is not something every API provider should need to build from scratch.&lt;/p&gt;




&lt;h2&gt;
  
  
  Typed Error Classes
&lt;/h2&gt;

&lt;p&gt;Bad error handling kills developer experience.&lt;/p&gt;

&lt;p&gt;MPP TestKit replaces vague failures with protocol-specific error classes.&lt;/p&gt;

&lt;p&gt;Instead of guessing what went wrong, developers can handle clear cases like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invalid receipt&lt;/li&gt;
&lt;li&gt;Insufficient funds&lt;/li&gt;
&lt;li&gt;Network timeout&lt;/li&gt;
&lt;li&gt;Verification failure&lt;/li&gt;
&lt;li&gt;Replay attempt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes the system easier to debug and safer to run in production.&lt;/p&gt;




&lt;h2&gt;
  
  
  Idempotency and Security
&lt;/h2&gt;

&lt;p&gt;Payment systems need to be careful with retries.&lt;/p&gt;

&lt;p&gt;Agents may retry requests.&lt;/p&gt;

&lt;p&gt;Networks may delay responses.&lt;/p&gt;

&lt;p&gt;Servers may receive duplicate attempts.&lt;/p&gt;

&lt;p&gt;MPP TestKit is designed to prevent double charging and reduce replay attack risk.&lt;/p&gt;

&lt;p&gt;That means agents are protected from accidental overpayment, and providers are protected from spoofed access attempts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stateless Scaling
&lt;/h2&gt;

&lt;p&gt;Because the system does not require traditional user accounts, providers do not need to manage a massive user database.&lt;/p&gt;

&lt;p&gt;There is no account migration problem.&lt;/p&gt;

&lt;p&gt;No bot user table.&lt;/p&gt;

&lt;p&gt;No subscription state machine.&lt;/p&gt;

&lt;p&gt;No dashboard dependency.&lt;/p&gt;

&lt;p&gt;A provider can scale from one request to one million requests without changing the core access model.&lt;/p&gt;

&lt;p&gt;That is the power of stateless machine-native billing.&lt;/p&gt;




&lt;h2&gt;
  
  
  The MPP TestKit Roadmap
&lt;/h2&gt;

&lt;p&gt;Infrastructure of this size is not static.&lt;/p&gt;

&lt;p&gt;The core rails are already operational, but the roadmap is bigger than one SDK or one demo.&lt;/p&gt;

&lt;p&gt;The goal is to bring x402 flows to every corner of the agent economy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 1: Foundation
&lt;/h2&gt;

&lt;p&gt;The foundation layer has shipped.&lt;/p&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payment Request and Payment Receipt handshake&lt;/li&gt;
&lt;li&gt;Core TypeScript SDK&lt;/li&gt;
&lt;li&gt;Python SDK&lt;/li&gt;
&lt;li&gt;Go SDK&lt;/li&gt;
&lt;li&gt;Reliability improvements&lt;/li&gt;
&lt;li&gt;Lifecycle callbacks&lt;/li&gt;
&lt;li&gt;Airdrop retry logic&lt;/li&gt;
&lt;li&gt;End-to-end testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This phase proved the core protocol flow works.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 2: Developer Experience
&lt;/h2&gt;

&lt;p&gt;The current focus is improving the developer experience.&lt;/p&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rust SDK&lt;/li&gt;
&lt;li&gt;MPX CLI&lt;/li&gt;
&lt;li&gt;Endpoint testing from the command line&lt;/li&gt;
&lt;li&gt;Developer playground&lt;/li&gt;
&lt;li&gt;Network switcher&lt;/li&gt;
&lt;li&gt;Framework recipes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to make the protocol easier to test, easier to integrate, and easier to explain.&lt;/p&gt;

&lt;p&gt;Example CLI direction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mpx mpp-test &amp;lt;url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A developer should be able to test a payment-gated endpoint instantly.&lt;/p&gt;

&lt;p&gt;No ceremony.&lt;/p&gt;

&lt;p&gt;No complex setup.&lt;/p&gt;

&lt;p&gt;Just run the command and see the flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 3: Ecosystem and Agent Integrations
&lt;/h2&gt;

&lt;p&gt;The next major expansion is agent framework integration.&lt;/p&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LangChain adapters&lt;/li&gt;
&lt;li&gt;OpenAI function calling adapters&lt;/li&gt;
&lt;li&gt;Django middleware&lt;/li&gt;
&lt;li&gt;Go framework support for Echo and Fiber&lt;/li&gt;
&lt;li&gt;Improved autonomous execution through Auton v2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agents should not need custom glue code for every payment-gated resource.&lt;/p&gt;

&lt;p&gt;MPP TestKit should become a native layer inside agentic workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 4: Production and Mainnet
&lt;/h2&gt;

&lt;p&gt;The next stage is production-grade mainnet readiness.&lt;/p&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mainnet migration guide&lt;/li&gt;
&lt;li&gt;Approval safeguards&lt;/li&gt;
&lt;li&gt;Native wallet support&lt;/li&gt;
&lt;li&gt;Phantom integration&lt;/li&gt;
&lt;li&gt;Backpack integration&lt;/li&gt;
&lt;li&gt;WalletConnect support&lt;/li&gt;
&lt;li&gt;Payment analytics&lt;/li&gt;
&lt;li&gt;Multi-recipient payment support&lt;/li&gt;
&lt;li&gt;Audit-friendly tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where the infrastructure matures from developer testing to real economic activity.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 5: Protocol v2
&lt;/h2&gt;

&lt;p&gt;The long-term vision extends beyond the first implementation.&lt;/p&gt;

&lt;p&gt;Protocol v2 will focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cross-chain settlement&lt;/li&gt;
&lt;li&gt;Base support&lt;/li&gt;
&lt;li&gt;Arbitrum support&lt;/li&gt;
&lt;li&gt;Batch payments&lt;/li&gt;
&lt;li&gt;Subscription-like machine tiers&lt;/li&gt;
&lt;li&gt;High-frequency payment flows&lt;/li&gt;
&lt;li&gt;Formal protocol specification&lt;/li&gt;
&lt;li&gt;RFC-style standardization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The machine economy will not be limited to one chain, one language, or one use case.&lt;/p&gt;

&lt;p&gt;MPP TestKit is being built with that future in mind.&lt;/p&gt;




&lt;h2&gt;
  
  
  Use Cases: The Machines Are Hungry
&lt;/h2&gt;

&lt;p&gt;The demand for this infrastructure is coming faster than most people realize.&lt;/p&gt;

&lt;p&gt;Here are the use cases where machine-native payments become obvious.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Trading Bots and DeFi Agents
&lt;/h2&gt;

&lt;p&gt;Autonomous trading agents need data.&lt;/p&gt;

&lt;p&gt;They need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alpha scores&lt;/li&gt;
&lt;li&gt;Rug risk reports&lt;/li&gt;
&lt;li&gt;Whale movement alerts&lt;/li&gt;
&lt;li&gt;Token analytics&lt;/li&gt;
&lt;li&gt;Liquidity data&lt;/li&gt;
&lt;li&gt;Market signals&lt;/li&gt;
&lt;li&gt;Risk assessments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These agents do not have time to sign up for a Pro plan.&lt;/p&gt;

&lt;p&gt;They do not want monthly subscriptions.&lt;/p&gt;

&lt;p&gt;They need to pay per query, receive the data, and execute.&lt;/p&gt;

&lt;p&gt;That is exactly what x402 enables.&lt;/p&gt;

&lt;p&gt;A trading agent can request a specialized data endpoint, pay instantly, receive the result, and act on it.&lt;/p&gt;

&lt;p&gt;This is where machine payments become not just useful, but necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Content and Research Pipelines
&lt;/h2&gt;

&lt;p&gt;AI agents performing research may need to access dozens of paid services during one workflow.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search APIs&lt;/li&gt;
&lt;li&gt;Translation APIs&lt;/li&gt;
&lt;li&gt;Data extraction tools&lt;/li&gt;
&lt;li&gt;Image generation&lt;/li&gt;
&lt;li&gt;Text-to-speech&lt;/li&gt;
&lt;li&gt;Market research databases&lt;/li&gt;
&lt;li&gt;Summarization services&lt;/li&gt;
&lt;li&gt;Financial data feeds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today, each service has its own billing system.&lt;/p&gt;

&lt;p&gt;That creates friction.&lt;/p&gt;

&lt;p&gt;MPP TestKit makes the billing layer disappear.&lt;/p&gt;

&lt;p&gt;Agents can move across multiple providers, paying for each resource as needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Agent-to-Agent Hiring
&lt;/h2&gt;

&lt;p&gt;This may become one of the most powerful use cases.&lt;/p&gt;

&lt;p&gt;Imagine an orchestrator agent receiving a complex task.&lt;/p&gt;

&lt;p&gt;It may need to hire specialist agents.&lt;/p&gt;

&lt;p&gt;One agent handles research.&lt;/p&gt;

&lt;p&gt;Another handles data cleaning.&lt;/p&gt;

&lt;p&gt;Another handles code generation.&lt;/p&gt;

&lt;p&gt;Another handles verification.&lt;/p&gt;

&lt;p&gt;Each specialist may need to pay for its own tools, APIs, or compute.&lt;/p&gt;

&lt;p&gt;This creates chains of machine-native payments.&lt;/p&gt;

&lt;p&gt;Only a protocol-level payment system can handle that cleanly.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Self-Monetizing APIs
&lt;/h2&gt;

&lt;p&gt;Developers often have useful APIs that are too small to justify full billing infrastructure.&lt;/p&gt;

&lt;p&gt;Maybe an endpoint only serves 50 requests a day.&lt;/p&gt;

&lt;p&gt;Maybe each request is worth $0.05.&lt;/p&gt;

&lt;p&gt;With Stripe, subscriptions, webhooks, databases, and account systems, monetizing that endpoint is not worth the effort.&lt;/p&gt;

&lt;p&gt;With MPP TestKit, it becomes viable.&lt;/p&gt;

&lt;p&gt;Wrap the endpoint.&lt;/p&gt;

&lt;p&gt;Set the price.&lt;/p&gt;

&lt;p&gt;Receive payment.&lt;/p&gt;

&lt;p&gt;That unlocks the long tail of API monetization.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. AI Tool Marketplaces
&lt;/h2&gt;

&lt;p&gt;As AI agents become more capable, they will need tool marketplaces.&lt;/p&gt;

&lt;p&gt;But those marketplaces need payment rails.&lt;/p&gt;

&lt;p&gt;Every tool cannot rely on human checkout.&lt;/p&gt;

&lt;p&gt;Agents need to discover tools, understand pricing, pay, and execute.&lt;/p&gt;

&lt;p&gt;MPP TestKit provides the settlement layer for that future.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;The current internet was not built for autonomous economic actors.&lt;/p&gt;

&lt;p&gt;It was built for humans browsing pages, creating accounts, and making purchases manually.&lt;/p&gt;

&lt;p&gt;The next internet will look different.&lt;/p&gt;

&lt;p&gt;Agents will discover services.&lt;/p&gt;

&lt;p&gt;Agents will pay for APIs.&lt;/p&gt;

&lt;p&gt;Agents will hire other agents.&lt;/p&gt;

&lt;p&gt;Agents will route tasks across networks.&lt;/p&gt;

&lt;p&gt;Agents will consume compute, data, and intelligence on demand.&lt;/p&gt;

&lt;p&gt;That world needs payment infrastructure that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programmable&lt;/li&gt;
&lt;li&gt;Stateless&lt;/li&gt;
&lt;li&gt;Fast&lt;/li&gt;
&lt;li&gt;Low-cost&lt;/li&gt;
&lt;li&gt;Chain-verifiable&lt;/li&gt;
&lt;li&gt;Developer-friendly&lt;/li&gt;
&lt;li&gt;Machine-native&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is what MPP TestKit is building.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Future of Infrastructure
&lt;/h2&gt;

&lt;p&gt;MPP TestKit is not just an app.&lt;/p&gt;

&lt;p&gt;It is not just a marketplace.&lt;/p&gt;

&lt;p&gt;It is not just a dashboard.&lt;/p&gt;

&lt;p&gt;It is infrastructure for the next decade of commerce.&lt;/p&gt;

&lt;p&gt;The early internet needed TCP/IP to define how data moves.&lt;/p&gt;

&lt;p&gt;The machine economy needs a standard for how value moves.&lt;/p&gt;

&lt;p&gt;We believe that standard starts with HTTP 402.&lt;/p&gt;

&lt;p&gt;We believe the right settlement rail is Solana.&lt;/p&gt;

&lt;p&gt;And we believe the developer layer that brings it all together is MPP TestKit.&lt;/p&gt;

&lt;p&gt;The rails are no longer theory.&lt;/p&gt;

&lt;p&gt;They are live.&lt;/p&gt;

&lt;p&gt;They are multi-language.&lt;/p&gt;

&lt;p&gt;They are developer-ready.&lt;/p&gt;

&lt;p&gt;The machine economy is already here.&lt;/p&gt;

&lt;p&gt;It is time to stop mocking payments and start building the future from the terminal.&lt;/p&gt;




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

&lt;p&gt;&lt;strong&gt;Website:&lt;/strong&gt; &lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;https://mpptestkit.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mpptestkit" rel="noopener noreferrer"&gt;https://github.com/mpptestkit&lt;/a&gt; &lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>A Self-Monetizing API in 20 Lines of Code</title>
      <dc:creator>MPP TestKit</dc:creator>
      <pubDate>Sat, 09 May 2026 10:53:15 +0000</pubDate>
      <link>https://forem.com/mpptestkit/a-self-monetizing-api-in-20-lines-of-code-81f</link>
      <guid>https://forem.com/mpptestkit/a-self-monetizing-api-in-20-lines-of-code-81f</guid>
      <description>&lt;p&gt;This is a hands-on tutorial. By the end you'll have a running pay-per-request API server, a client that pays automatically, and a test suite that covers the full payment flow - all on devnet, completely free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With How We Monetize APIs Today
&lt;/h2&gt;

&lt;p&gt;If you've ever tried to sell access to an API you built, you know the drill:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign up for Stripe&lt;/li&gt;
&lt;li&gt;Build a subscription checkout flow&lt;/li&gt;
&lt;li&gt;Issue API keys on payment confirmation&lt;/li&gt;
&lt;li&gt;Store keys in a database&lt;/li&gt;
&lt;li&gt;Validate keys on every request&lt;/li&gt;
&lt;li&gt;Build a usage dashboard&lt;/li&gt;
&lt;li&gt;Handle expired cards, failed payments, refunds&lt;/li&gt;
&lt;li&gt;Write the billing docs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By the time you've done all that, you've built a billing product. That wasn't the thing you wanted to build.&lt;/p&gt;

&lt;p&gt;The worst part: none of this scales to small amounts. Charging $0.001 per API call with Stripe isn't viable - the processing fee alone exceeds the charge. So you're forced into subscriptions, bundles, and credit packs. Your pricing model becomes a product decision instead of just... pricing.&lt;/p&gt;

&lt;p&gt;There's a cleaner way to do this. It's been in the HTTP spec since 1999. It just never had the infrastructure to work.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTP 402: The Status Code That Was Waiting for Blockchains
&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;402 Payment Required
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This status code has been reserved in HTTP since the original 1.1 spec. The idea: server tells the client "pay first, then retry." The client pays, retries with proof, gets the resource.&lt;/p&gt;

&lt;p&gt;The problem was always &lt;em&gt;how&lt;/em&gt;. How does the server specify the amount? In what form? How does the client pay programmatically? How does the server verify payment without a central authority?&lt;/p&gt;

&lt;p&gt;Blockchains answer all of those questions. Solana specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specifies amount in SOL (or any token)&lt;/li&gt;
&lt;li&gt;Accepts payment via a signed transaction&lt;/li&gt;
&lt;li&gt;Provides on-chain verification with no intermediary&lt;/li&gt;
&lt;li&gt;Confirms transactions in ~2 seconds&lt;/li&gt;
&lt;li&gt;Charges fractions of a cent in fees&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;MPP Testkit&lt;/a&gt; is the SDK that wires this up. Let's build something with it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We're Building
&lt;/h2&gt;

&lt;p&gt;A Node.js API server with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/api/ping&lt;/code&gt; - free endpoint, no payment&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/api/weather&lt;/code&gt; - costs 0.001 SOL per call&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/api/forecast&lt;/code&gt; - costs 0.005 SOL per call (premium tier)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a client script that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hits the paid endpoints automatically&lt;/li&gt;
&lt;li&gt;Handles the wallet, airdrop, and payment without any manual steps&lt;/li&gt;
&lt;li&gt;Logs every step of the flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total code: about 20 lines for the server, 10 for the client.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my-paid-api &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;my-paid-api
npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;express mpp-test-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create two files: &lt;code&gt;server.js&lt;/code&gt; and &lt;code&gt;client.js&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// server.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&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;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createTestServer&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;mpp-test-sdk&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&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;mpp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTestServer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Free - no payment needed&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;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/ping&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ok&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ts&lt;/span&gt;&lt;span class="p"&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="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// 0.001 SOL per call&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;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/weather&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charge&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;0.001&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;San Francisco&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;62&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Partly cloudy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 0.005 SOL per call - premium tier&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;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/forecast&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charge&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;0.005&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;San Francisco&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;forecast&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;day&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mon&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;high&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;65&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;low&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;day&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;high&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;68&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;low&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;day&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;high&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;61&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;low&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;v2-premium&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server running on :3001&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Payment recipient:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;recipientAddress&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;Start it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node server.js
&lt;span class="c"&gt;# Server running on :3001&lt;/span&gt;
&lt;span class="c"&gt;# Payment recipient: 7xKmPq2rNbMd...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the server. &lt;code&gt;mpp.charge()&lt;/code&gt; is Express middleware. It returns a 402 if no valid payment receipt is present, verifies on-chain if one is, and calls &lt;code&gt;next()&lt;/code&gt; if everything checks out.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Client
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// client.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createTestClient&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;mpp-test-sdk&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devnet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;onStep&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;`  [&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;type&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;message&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="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="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;- Hitting /api/ping (free)&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;ping&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/ping&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ping&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;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="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;- Hitting /api/weather (0.001 SOL)&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;weather&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/weather&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;weather&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;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="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;- Hitting /api/forecast (0.005 SOL)&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;forecast&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/forecast&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;forecast&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;Run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;node client.js

- Hitting /api/ping (free)
{ status: 'ok', ts: 1715123456789 }

- Hitting /api/weather (0.001 SOL)
  [wallet-created] Keypair generated: 3xMn9...Wr4k
  [funded] Airdropped 2 SOL on devnet
  [request] GET http://localhost:3001/api/weather
  [payment] 402 received · paying 0.001 SOL
  [payment] tx confirmed: 5xKm7...Pq2r
  [retry] Retrying with Payment-Receipt header
  [success] 200 OK
{ city: 'San Francisco', temp: 62, condition: 'Partly cloudy', paid: true }

- Hitting /api/forecast (0.005 SOL)
  [request] GET http://localhost:3001/api/forecast
  [payment] 402 received · paying 0.005 SOL
  [payment] tx confirmed: 8xNp3...Qr1s
  [retry] Retrying with Payment-Receipt header
  [success] 200 OK
{ city: 'San Francisco', forecast: [...], model: 'v2-premium', paid: true }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice: the wallet and airdrop only happen once. The second paid call reuses the same wallet - no second airdrop. The client is stateful, the calls are not.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Just Happened Under the Hood
&lt;/h2&gt;

&lt;p&gt;When the client hit &lt;code&gt;/api/weather&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Client sent&lt;/strong&gt; &lt;code&gt;GET /api/weather&lt;/code&gt; - no special headers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server returned&lt;/strong&gt; &lt;code&gt;402 Payment Required&lt;/code&gt; with header:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;   &lt;span class="py"&gt;Payment-Request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;solana; amount="0.001"; recipient="7xKmPq2r..."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SDK parsed&lt;/strong&gt; the header, built a Solana transaction for 0.001 SOL to &lt;code&gt;7xKmPq2r...&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDK signed and submitted&lt;/strong&gt; the transaction to devnet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDK waited&lt;/strong&gt; for confirmation (~2 seconds)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client retried&lt;/strong&gt; with header:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;   &lt;span class="py"&gt;Payment-Receipt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;solana; signature="5xKm7...Pq2r"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Server verified&lt;/strong&gt; on-chain: transaction exists, recipient matches, amount ≥ 0.001 SOL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server called&lt;/strong&gt; &lt;code&gt;next()&lt;/code&gt;, handler returned 200&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your handler code saw none of this. It just received a request and returned JSON.&lt;/p&gt;




&lt;h2&gt;
  
  
  Writing Tests for Your Paid Endpoints
&lt;/h2&gt;

&lt;p&gt;This is where MPP Testkit really shines. Integration testing paid APIs usually means mocking the payment layer, which means your tests don't actually test the payment logic.&lt;/p&gt;

&lt;p&gt;With MPP Testkit on devnet, you test the real flow for free:&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;// server.test.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createTestClient&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;mpp-test-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;beforeAll&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;afterAll&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;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;beforeAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Start the server&lt;/span&gt;
  &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./server.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;// Create a test client - wallet + airdrop happen here once&lt;/span&gt;
  &lt;span class="nx"&gt;client&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;createTestClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devnet&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;afterAll&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Free endpoints&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET /api/ping returns 200 without payment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/ping&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;body&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;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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;status&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;ok&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;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Paid endpoints&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET /api/weather: pays 0.001 SOL, returns weather data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/weather&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;body&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;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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;temp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET /api/forecast: pays 0.005 SOL, returns 3-day forecast&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/forecast&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;body&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;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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forecast&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Direct request without payment returns 402&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/weather&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;402&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;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Payment-Request&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/solana/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/amount="0.001"/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Request with invalid receipt returns 403&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3001/api/weather&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;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;Payment-Receipt&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;solana; signature=fakesig123&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;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&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;Run with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx vitest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are real integration tests. No mocks. No stubs. The payment flow runs against devnet on every test run. If your receipt verification logic breaks, the test catches it - because it actually verifies.&lt;/p&gt;




&lt;h2&gt;
  
  
  Handling Errors Gracefully
&lt;/h2&gt;

&lt;p&gt;Real code needs error handling. The SDK throws typed errors:&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;mppFetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MppFaucetError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MppPaymentError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MppTimeoutError&lt;/span&gt;&lt;span class="p"&gt;,&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;mpp-test-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchWithFallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;mppFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;MppFaucetError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Devnet faucet rate-limited - common in CI with many parallel runs&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;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Faucet unavailable, retrying in 60s...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="nx"&gt;_000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;mppFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// retry once&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;MppPaymentError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Transaction rejected - log and rethrow&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;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Payment rejected: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&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;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&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="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;MppTimeoutError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Flow took too long - Solana can be slow under load&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;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Timed out after &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timeoutMs&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;ms`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Taking It to Production (Mainnet)
&lt;/h2&gt;

&lt;p&gt;When you're ready to charge real SOL:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server side&lt;/strong&gt; - pin a stable recipient wallet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mpp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTestServer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;secretKey&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;SERVER_SECRET_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// base64 or JSON array&lt;/span&gt;
  &lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mainnet&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;&lt;strong&gt;Client side&lt;/strong&gt; - provide a funded wallet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&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;createTestClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mainnet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;secretKey&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;CLIENT_SECRET_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// pre-funded with real SOL&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The protocol is identical. The only difference is &lt;code&gt;network: "mainnet"&lt;/code&gt; and no auto-airdrop. Your application code doesn't change.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Creator Economy Angle
&lt;/h2&gt;

&lt;p&gt;I want to zoom out for a second, because this is bigger than just APIs.&lt;/p&gt;

&lt;p&gt;If you're a developer who creates things - libraries, datasets, AI models, tools - the standard monetization paths are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open source&lt;/strong&gt; - free, you get nothing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SaaS&lt;/strong&gt; - build a subscription billing system (Stripe, auth, database, dashboard)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-time license&lt;/strong&gt; - Gumroad, Paddle, etc. - purchase gate, license key management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Usage-based&lt;/strong&gt; - Stripe metered billing - still requires subscription, monthly invoicing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these require you to build infrastructure around your actual product.&lt;/p&gt;

&lt;p&gt;HTTP 402 with Solana adds a fifth option: &lt;strong&gt;embed payment in the protocol itself&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Your dataset endpoint charges $0.0001 per query. Your AI model charges $0.01 per inference. Your code analysis tool charges $0.005 per file. No subscription. No free tier decision. No pricing page. The price is in the API response.&lt;/p&gt;

&lt;p&gt;Consumers - including AI agents - just pay and use. Your server accumulates SOL. You withdraw to your wallet.&lt;/p&gt;

&lt;p&gt;The entire billing system is the blockchain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters for AI Agents Right Now
&lt;/h2&gt;

&lt;p&gt;We're at an inflection point: AI agents are being deployed that autonomously call tools, APIs, and services. The problem is that every one of those tools currently requires a human to sign up, get an API key, and manage billing.&lt;/p&gt;

&lt;p&gt;That doesn't scale. An agent that spins up 50 tool-calling sessions needs 50 sets of credentials managed by a human. Or one set of credentials shared across everything - which is a security disaster.&lt;/p&gt;

&lt;p&gt;HTTP 402 with Solana gives agents a payment identity without a human in the loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent generates an ephemeral keypair on first run&lt;/li&gt;
&lt;li&gt;Agent funds wallet from its operator's SOL balance&lt;/li&gt;
&lt;li&gt;Agent hits any 402-gated endpoint and pays automatically&lt;/li&gt;
&lt;li&gt;Operator monitors spending via on-chain transactions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No API keys. No credentials database. No revocation system. The wallet is the identity. The payment is the access token.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://agent.mpptestkit.com" rel="noopener noreferrer"&gt;Auton demo&lt;/a&gt; shows this working end-to-end - an agent that generates its own wallet, gets funded, navigates a 402 gate, pays, and retrieves premium data. Every step streams live to the browser. Watch it once and the architecture becomes obvious.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&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;mpp-test-sdk       &lt;span class="c"&gt;# TypeScript/JavaScript&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;mpp-test-sdk       &lt;span class="c"&gt;# Python&lt;/span&gt;
go get github.com/mpptestkit/mpp-test-sdk-go  &lt;span class="c"&gt;# Go&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Minimal server
&lt;/h3&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;createTestServer&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;mpp-test-sdk&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;mpp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTestServer&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;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;/paid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charge&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;0.001&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Minimal client
&lt;/h3&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;mppFetch&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;mpp-test-sdk&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;res&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;mppFetch&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://your-api.com/paid&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;
  
  
  Networks
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Network&lt;/th&gt;
&lt;th&gt;Auto-funded&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;&lt;code&gt;devnet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes (2 SOL)&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;testnet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes (2 SOL)&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mainnet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Real SOL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Error types
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MppFaucetError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Devnet/testnet faucet rate-limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MppPaymentError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;On-chain transaction rejected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MppTimeoutError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full flow exceeded timeout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MppNetworkError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mainnet attempted without funded wallet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Once you have the basics running:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add multiple price tiers&lt;/strong&gt; - &lt;code&gt;mpp.charge({ amount: "0.01" })&lt;/code&gt; on premium endpoints, &lt;code&gt;mpp.charge({ amount: "0.001" })&lt;/code&gt; on standard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the lifecycle events&lt;/strong&gt; - stream payment status to your frontend in real-time (the playground does this)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrate with your existing auth&lt;/strong&gt; - 402 and API keys aren't mutually exclusive; use 402 for metered access, API keys for identity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move to mainnet&lt;/strong&gt; - same code, swap &lt;code&gt;network: "devnet"&lt;/code&gt; to &lt;code&gt;network: "mainnet"&lt;/code&gt;, provide funded wallets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;interactive playground&lt;/a&gt; is the fastest way to see the full flow before you build anything. It runs against a live server - no setup, no install.&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;mpptestkit.com&lt;/a&gt; - Playground + full protocol docs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://agent.mpptestkit.com" rel="noopener noreferrer"&gt;agent.mpptestkit.com&lt;/a&gt; - Auton: autonomous agent payment demo&lt;/li&gt;
&lt;li&gt;npm: &lt;code&gt;mpp-test-sdk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;code&gt;mpp-test-sdk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Go: &lt;code&gt;github.com/mpptestkit/sdk-go&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;The billing system your API never had to build is already in the HTTP spec. It just needed Solana to make it real.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Machine-to-Machine Payments Are Coming Faster Than Anyone Prepared For</title>
      <dc:creator>MPP TestKit</dc:creator>
      <pubDate>Wed, 06 May 2026 11:20:22 +0000</pubDate>
      <link>https://forem.com/mpptestkit/machine-to-machine-payments-are-coming-faster-than-anyone-prepared-for-1127</link>
      <guid>https://forem.com/mpptestkit/machine-to-machine-payments-are-coming-faster-than-anyone-prepared-for-1127</guid>
      <description>&lt;p&gt;There is a quiet infrastructure crisis unfolding in AI development that nobody is talking about loudly enough.&lt;/p&gt;

&lt;p&gt;AI agents are getting good - fast. They can write code, browse the web, book appointments, analyze data, and chain together complex multi-step workflows without human input. The tooling around them is evolving at a pace that would have seemed absurd three years ago.&lt;/p&gt;

&lt;p&gt;But there is one thing they cannot do cleanly: &lt;strong&gt;pay for things&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Not because the technology doesn't exist. Because the payment infrastructure was never designed with machines in mind.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Nobody Built For
&lt;/h2&gt;

&lt;p&gt;Every payment system we have today was designed for humans. Credit cards require billing addresses and CVV codes. PayPal requires a login flow. Stripe requires a server-side integration with API keys, webhook endpoints, and a merchant account that takes days to verify.&lt;/p&gt;

&lt;p&gt;When a human wants to pay for something, these friction points are annoying but manageable. When an autonomous AI agent needs to pay for a single API call - at 2 AM, without a human in the loop - the entire stack collapses.&lt;/p&gt;

&lt;p&gt;The agent needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hold credentials it can use programmatically&lt;/li&gt;
&lt;li&gt;Initiate a payment without a UI flow&lt;/li&gt;
&lt;li&gt;Receive instant confirmation&lt;/li&gt;
&lt;li&gt;Retry the original request automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of the existing payment rails were built for this sequence. They were built for checkout pages.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTP 402 Has Been Waiting Since 1999
&lt;/h2&gt;

&lt;p&gt;Here is the part that makes this problem both frustrating and exciting: the HTTP spec saw this coming.&lt;/p&gt;

&lt;p&gt;In 1999, when the HTTP/1.1 specification was published, the authors included status code &lt;strong&gt;402 - Payment Required&lt;/strong&gt;. The note in the RFC reads:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"This code is reserved for future use."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Twenty-five years later, it is still reserved. No major implementation. No standard. No tooling.&lt;/p&gt;

&lt;p&gt;The reason is straightforward: in 1999, there was no programmable money. No way for a server to say "send me exactly $0.003 and I'll give you the data" and have a machine comply without a human typing in a card number.&lt;/p&gt;

&lt;p&gt;That changed with blockchain. Specifically, it changed with Solana.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Solana Is the Right Layer for This
&lt;/h2&gt;

&lt;p&gt;Not all blockchains are equal for this use case. Machine-to-machine payments at the API layer have strict requirements:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed.&lt;/strong&gt; An API client waiting on payment confirmation cannot wait 10 minutes. Solana finalizes transactions in 400–800 milliseconds. That is fast enough to fit inside a single HTTP request-response cycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost.&lt;/strong&gt; Paying $15 in gas fees to access a $0.001 API endpoint is absurd. Solana transaction fees are fractions of a cent - typically $0.00025 or less.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programmability.&lt;/strong&gt; The payment needs to be verifiable on-chain without a trusted third party. Solana's account model makes it straightforward to confirm a transfer happened, to whom, and for exactly how much.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developer tooling.&lt;/strong&gt; Solana has a mature JavaScript/TypeScript SDK, widespread RPC access, and faucets on devnet and testnet that make testing free and instant.&lt;/p&gt;

&lt;p&gt;No other chain checks all four boxes at the level of maturity Solana does today.&lt;/p&gt;




&lt;h2&gt;
  
  
  The 402 Flow, Concretely
&lt;/h2&gt;

&lt;p&gt;Here is what the machine-to-machine payment protocol looks like when properly implemented:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Client → GET /api/data
2. Server → 402 Payment Required
           Payment-Request: solana; amount="0.001"; recipient="9WzDX..."; network="devnet"
3. Client → builds and signs a Solana transaction
           sends 0.001 SOL to the recipient address
4. Client → GET /api/data
           Payment-Receipt: solana; signature="3xKm7..."; network="devnet"
5. Server → verifies the transaction on-chain
           confirms correct recipient and amount
6. Server → 200 OK + data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No human. No UI. No stored credentials that can be stolen. No subscription to manage.&lt;/p&gt;

&lt;p&gt;The agent generates an ephemeral keypair per session, gets funded from a faucet (on test networks) or a pre-loaded wallet (on mainnet), makes the payment, and moves on.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Builds This Infrastructure First, Wins
&lt;/h2&gt;

&lt;p&gt;We are in a narrow window. AI agents are proliferating. The companies building them are running into the payment problem right now - and solving it badly, with workarounds like pre-purchased credit bundles, API key sharing, and centralized billing dashboards.&lt;/p&gt;

&lt;p&gt;These are fine stopgaps. They are not the endgame.&lt;/p&gt;

&lt;p&gt;The endgame is a world where any API can declare its price in a &lt;code&gt;Payment-Request&lt;/code&gt; header, any agent can pay it atomically, and the entire interaction is settled on-chain without a third party in the middle.&lt;/p&gt;

&lt;p&gt;That world creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A long tail of micro-API businesses&lt;/strong&gt; that are uneconomical today because per-user billing infrastructure costs more than the service itself&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent-native services&lt;/strong&gt; that don't bother with human-facing dashboards because they only serve machines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composable payment flows&lt;/strong&gt; where one agent pays another, which pays a third, all within a single user-initiated task&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The infrastructure for this needs to be built now, while the norms are still forming. Whoever defines the standard shapes how the next decade of API economics works.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We're Building
&lt;/h2&gt;

&lt;p&gt;MPP Test Kit is our contribution to this problem. It is an open-source SDK that makes testing the 402 payment flow trivial - for both sides of the transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On the client side:&lt;/strong&gt;&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;mppFetch&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;mpp-test-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// No wallet setup. No config. One line.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&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;mppFetch&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://api.example.com/data&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;data&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;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK generates a Solana keypair, airdrops SOL from the devnet/testnet faucet, handles the 402 response, executes the payment, and retries the request - all automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On the server side:&lt;/strong&gt;&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;createTestServer&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;mpp-test-sdk&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;mpp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTestServer&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;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/data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charge&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;0.001&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;premium content&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One middleware line. The server auto-generates its recipient wallet, returns 402 with the payment details, and verifies the Solana transaction on-chain before serving the response.&lt;/p&gt;

&lt;p&gt;The goal is to make the 402 flow so easy to test that developers start building against it - and in doing so, establish what the real-world implementation of machine-to-machine payments looks like.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stakes
&lt;/h2&gt;

&lt;p&gt;This is not a niche developer tool story. This is an infrastructure story.&lt;/p&gt;

&lt;p&gt;The internet runs on HTTP. HTTP has a status code explicitly reserved for payments. Solana has the performance characteristics to make that status code real. AI agents have the economic incentive to use it.&lt;/p&gt;

&lt;p&gt;The pieces are all here. What has been missing is the tooling that makes it easy to build and test.&lt;/p&gt;

&lt;p&gt;We are building that tooling. But more than that, we are trying to establish a pattern - a shared understanding of how machines should pay each other - before that pattern gets defined by a centralized intermediary who extracts a fee from every transaction.&lt;/p&gt;

&lt;p&gt;The window is open. It will not stay open forever.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;MPP Test Kit is open source. Try the playground at &lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;mpptestkit.com&lt;/a&gt; or install the SDK: &lt;code&gt;npm i mpp-test-sdk&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>infrastructure</category>
      <category>news</category>
    </item>
    <item>
      <title>Pay-Per-Request APIs Are the Next Primitive of the Internet</title>
      <dc:creator>MPP TestKit</dc:creator>
      <pubDate>Wed, 06 May 2026 11:17:43 +0000</pubDate>
      <link>https://forem.com/mpptestkit/pay-per-request-apis-are-the-next-primitive-of-the-internet-2k3e</link>
      <guid>https://forem.com/mpptestkit/pay-per-request-apis-are-the-next-primitive-of-the-internet-2k3e</guid>
      <description>&lt;p&gt;Every major shift in how software is sold follows the same arc.&lt;/p&gt;

&lt;p&gt;Packaged software gave way to SaaS. SaaS gave way to usage-based billing. Usage-based billing is now giving way to something most developers haven't named yet - but it is already visible in the infrastructure being built around AI agents and autonomous systems.&lt;/p&gt;

&lt;p&gt;The name, when it comes, will probably just be &lt;strong&gt;pay-per-request&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Wrong With Subscriptions
&lt;/h2&gt;

&lt;p&gt;Subscriptions are not natural. They are a workaround.&lt;/p&gt;

&lt;p&gt;The natural model for an API is: you call it, you pay for what you used, you stop paying when you stop calling it. Like electricity, water, or compute time on a cloud provider.&lt;/p&gt;

&lt;p&gt;The reason APIs don't work this way is a payment infrastructure problem, not a product design problem. Per-request payments require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instant settlement (no 3-day card processing window)&lt;/li&gt;
&lt;li&gt;Near-zero transaction cost (paying $0.30 Stripe fee on a $0.001 API call is absurd)&lt;/li&gt;
&lt;li&gt;No account creation required on either side&lt;/li&gt;
&lt;li&gt;Machine-readable payment confirmation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of the legacy payment rails support all four. So the industry invented subscriptions - a bulk pre-purchase that amortizes transaction overhead across many calls.&lt;/p&gt;

&lt;p&gt;Subscriptions work well for humans who plan their usage in advance. They work terribly for machines that call APIs sporadically, unpredictably, and at scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  The API Economy Has a Composition Problem
&lt;/h2&gt;

&lt;p&gt;Here is a concrete version of the problem.&lt;/p&gt;

&lt;p&gt;Imagine building an AI research agent. It needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call a semantic search API (5 cents per query)&lt;/li&gt;
&lt;li&gt;Call a web scraping API (2 cents per page)&lt;/li&gt;
&lt;li&gt;Call a summarization API (1 cent per 1,000 tokens)&lt;/li&gt;
&lt;li&gt;Call a fact-checking API (3 cents per claim)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use all four today, you need four accounts, four API keys, four separate billing relationships, four different rate limit tiers to reason about, and four monthly invoices to reconcile.&lt;/p&gt;

&lt;p&gt;This is not a scalability problem. It is a compositional friction problem. The more services an agent needs to call, the worse it gets.&lt;/p&gt;

&lt;p&gt;Pay-per-request eliminates this entirely. The agent holds a single funded wallet. Every API call that costs money just costs money - atomically, on-chain, without prior registration.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTP 402 Is the Missing Standard
&lt;/h2&gt;

&lt;p&gt;In 1999, the HTTP specification reserved status code &lt;strong&gt;402 - Payment Required&lt;/strong&gt; for future use.&lt;/p&gt;

&lt;p&gt;The spec authors were not being naive. They correctly anticipated that some HTTP resources would need to be paid for. What they could not anticipate was the 25-year gap before programmable money existed at the performance level required to make it work.&lt;/p&gt;

&lt;p&gt;That gap is now closed.&lt;/p&gt;

&lt;p&gt;A properly implemented 402 flow looks like this:&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;Client:  GET /api/research-data
Server:  402 Payment Required
         Payment-Request: solana; amount="0.005"; recipient="7xKp..."; network="devnet"

Client:  [generates keypair, sends 0.005 SOL on Solana]
Client:  GET /api/research-data
         Payment-Receipt: solana; signature="4mNw..."; network="devnet"

Server:  [verifies transaction on-chain]
Server:  200 OK + data
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No accounts. No API keys for billing. No subscriptions. The payment IS the authentication. The blockchain IS the receipt.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Is a Primitive, Not a Feature
&lt;/h2&gt;

&lt;p&gt;The word "primitive" in computing refers to a foundational building block - something other things are built on top of, rather than something built on top of other things.&lt;/p&gt;

&lt;p&gt;TCP/IP is a primitive. HTTP is a primitive. JSON is (informally) a primitive.&lt;/p&gt;

&lt;p&gt;Pay-per-request APIs, when implemented via HTTP 402 with on-chain settlement, have the properties of a primitive:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Composable.&lt;/strong&gt; Any agent, in any language, on any platform, can participate. The protocol is defined at the HTTP layer - nothing above it needs to change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Permissionless.&lt;/strong&gt; An API server can start charging per-request without registering with any payment processor. A client can start paying without creating an account. The blockchain handles settlement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verifiable.&lt;/strong&gt; Payment proofs are public and immutable. Both sides can independently verify that a transaction happened, when, for how much, and to whom. There is no "trust the payment processor."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Atomic.&lt;/strong&gt; Payment and data delivery are coupled. Either the payment goes through and the data is returned, or neither happens. No disputed charges. No refund processes.&lt;/p&gt;

&lt;p&gt;These four properties - composability, permissionlessness, verifiability, atomicity - are what make something a primitive. They are also exactly what existing payment rails lack.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solana Advantage
&lt;/h2&gt;

&lt;p&gt;Pay-per-request only works if the payment layer is fast enough to fit inside an API call and cheap enough to be economically rational at small amounts.&lt;/p&gt;

&lt;p&gt;Solana is currently the only public blockchain that meets both requirements in production:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Solana&lt;/th&gt;
&lt;th&gt;Ethereum L1&lt;/th&gt;
&lt;th&gt;Bitcoin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Finality&lt;/td&gt;
&lt;td&gt;~800ms&lt;/td&gt;
&lt;td&gt;~12 seconds&lt;/td&gt;
&lt;td&gt;~60 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tx fee&lt;/td&gt;
&lt;td&gt;~$0.00025&lt;/td&gt;
&lt;td&gt;~$1–50+&lt;/td&gt;
&lt;td&gt;~$1–5+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TPS&lt;/td&gt;
&lt;td&gt;65,000+&lt;/td&gt;
&lt;td&gt;~15&lt;/td&gt;
&lt;td&gt;~7&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The numbers are not close. A Solana transaction settles in under a second for a quarter of a cent. That is the only option that makes paying $0.001 for an API call economically rational - Ethereum L1 gas fees would cost 10,000x the payment itself.&lt;/p&gt;

&lt;p&gt;Solana also has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First-class JavaScript/TypeScript SDK (&lt;code&gt;@solana/web3.js&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Free devnet and testnet faucets for development&lt;/li&gt;
&lt;li&gt;Widespread RPC infrastructure with low latency globally&lt;/li&gt;
&lt;li&gt;A mature ecosystem of wallets and tooling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters for developer adoption. The easier it is to test and build, the faster the pattern spreads.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Ecosystem Looks Like at Scale
&lt;/h2&gt;

&lt;p&gt;Imagine a world where pay-per-request is a standard pattern, not an exotic experiment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For API providers:&lt;/strong&gt; Zero billing infrastructure. No Stripe integration, no subscription tiers, no dunning emails, no churn analysis. Set a price per request in a header and start earning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For developers:&lt;/strong&gt; Access any API with a single funded wallet. No account creation, no trial limitations, no credit card required. Call it, pay for it, move on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For AI agents:&lt;/strong&gt; Fully autonomous operation. An agent can access any pay-per-request API in the world without human intervention - no approval flows, no credential management, no budget alerts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For the long tail:&lt;/strong&gt; APIs that are uneconomical today because the billing overhead exceeds the value per call become viable. A highly specialized data endpoint that serves 50 requests a day at $0.05 each can now exist as a business.&lt;/p&gt;

&lt;p&gt;This is not incremental. It is a different model for how API services work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Building the Tooling First
&lt;/h2&gt;

&lt;p&gt;The pattern will not spread without tooling. No developer integrates a protocol that requires them to write 200 lines of wallet management code before their first test.&lt;/p&gt;

&lt;p&gt;That is what MPP Test Kit addresses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For clients testing a 402-enabled API:&lt;/strong&gt;&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;mppFetch&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;mpp-test-sdk&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;res&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;mppFetch&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://api.example.com/query&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;data&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;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="c1"&gt;// SDK handled the entire 402 → pay → retry cycle automatically&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For servers exposing a paid endpoint:&lt;/strong&gt;&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="nx"&gt;express&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;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createTestServer&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;mpp-test-sdk&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&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;mpp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTestServer&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;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/query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;mpp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charge&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;0.001&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;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="na"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both sides work on devnet (free), testnet (free), and mainnet (real SOL). The SDK generates wallets, handles faucet airdrops, verifies transactions on-chain, and surfaces the full payment lifecycle through observable events.&lt;/p&gt;

&lt;p&gt;The goal is zero-friction testing. If the integration is easy to test, it becomes easy to ship. If it becomes easy to ship, it becomes a standard.&lt;/p&gt;




&lt;h2&gt;
  
  
  First Mover Dynamics
&lt;/h2&gt;

&lt;p&gt;Standards coalesce around implementations. The team that makes HTTP 402 easy to use will have outsized influence on how the standard evolves.&lt;/p&gt;

&lt;p&gt;This is not theoretical. JSON won over XML partly because of better tooling. REST won over SOAP for the same reason. npm won because it was simpler to publish and consume than what came before.&lt;/p&gt;

&lt;p&gt;Pay-per-request APIs need a moment like that - a tooling layer that makes the right way easier than the wrong way. When that exists, developers start building against it. When developers build against it, APIs start implementing it. When APIs implement it, agents start relying on it.&lt;/p&gt;

&lt;p&gt;The flywheel starts with tooling.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where This Goes
&lt;/h2&gt;

&lt;p&gt;The trajectory is clear even if the timeline is uncertain.&lt;/p&gt;

&lt;p&gt;AI agents will proliferate. They will need to pay for services. The services they pay for will need a standard way to declare their prices and verify payment. HTTP 402 with on-chain settlement is that standard.&lt;/p&gt;

&lt;p&gt;The developers building this infrastructure now - the SDK authors, the API providers experimenting with 402, the protocol researchers documenting the patterns - are defining the economic layer of the agentic internet.&lt;/p&gt;

&lt;p&gt;Pay-per-request is not a startup idea. It is a primitive. And primitives, once established, become load-bearing infrastructure for everything built on top.&lt;/p&gt;

&lt;p&gt;The window to define it is now. After that, we just use it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;MPP Test Kit is open source. Try the live playground at &lt;a href="https://mpptestkit.com" rel="noopener noreferrer"&gt;mpptestkit.com&lt;/a&gt; or get started in seconds: &lt;code&gt;npm i mpp-test-sdk&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solana</category>
      <category>mpp</category>
      <category>mpptestkit</category>
    </item>
  </channel>
</rss>
