Skip to content
Pay-per-call lets a client pay for one HTTP request at a time. The server answers an unpaid request with 402 Payment Required and a price. The client signs a stablecoin payment, retries the request with it, and gets the data. There is no signup, API key, or invoice, so the same flow works for people’s apps and for AI agents that pay for a data query, model inference, or tool call without first creating a billing account. Each payment is a Solana transactionTransactionsA transaction is a signed request to change the shared ledger. It either fully happens or doesn't happen at all, and once confirmed anyone can look it up.Learn more (Transactions: A transaction is a signed request to change the shared ledger. It either fully happens or doesn’t happen at all, and once confirmed anyone can look it up.), so the cost to the payer is the amount plus a flat network feeFeesEvery transaction pays a small flat network fee, currently a fraction of a cent, whatever the amount. The transaction's fee payer pays, and that can be your app rather than your customer.Learn more (Fees: Every transaction pays a small flat network fee, currently a fraction of a cent, whatever the amount. The transaction’s fee payer pays, and that can be your app rather than your customer.), whatever the price of the request.
Charge per API call · 4 steps · ~30 minPaywall an endpointPrice each request at a fraction of a cent. Clients, whether people’s apps or AI agents, pay inline over HTTP, with no signup, API key, or invoice.
  1. Call a paid API
  2. Read the code
  3. Add it to your server
  4. Go live
Start the tutorial →

​Protocols

Two protocols settle these payments on Solana. Both use the 402 status code, with different headers and payment models.

​The common payment flow

MPP and x402 use different headers and data models, but their basic HTTP flow is similar:
Agentic HTTP Payment FlowAgentic HTTP Payment Flow

Agentic HTTP Payment Flow

​MPP and x402

Both protocols can settle stablecoin payments on Solana. Choose based on the payment model and interoperability your service needs, not only the shared 402 status code.
MPPx402
ChallengeWWW-Authenticate: PaymentPAYMENT-REQUIRED
Client authorizationAuthorization: PaymentPAYMENT-SIGNATURE
ReceiptPayment-ReceiptPAYMENT-RESPONSE
Solana payment modelsOne-time charge and capped, metered session intentsSchemes such as exact and upto; support varies by network and client
Settlement architectureServer validation, or an optional relay or gatewayResource server with local verification or a facilitator
Good starting pointAPIs that need HTTP authentication semantics or repeated meteringPay-per-request resources and existing x402 clients
MPP is the Machine Payments Protocol. Do not confuse it with the Model Context Protocol (MCP). MCP exposes tools and resources to agents; MPP or x402 can require payment when an agent invokes one of those tools.
A service may advertise more than one protocol. The client selects a payment option it supports, then uses the matching challenge, authorization, and receipt headers for the entire exchange.

​Run it in production

​Watch