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.
Start the tutorial →Protocols
Two protocols settle these payments on Solana. Both use the402 status code,
with different headers and payment models.
How x402 works
Payment requirements, signatures, and settlement for a paid HTTP resource, with the x402 V2 SDK.
Machine payments (MPP)
One-time charges and capped, metered payment sessions with HTTP authentication semantics.
Let an agent pay (x402)
Launch an agent with Pay and complete one x402 payment against a sandbox API, without moving real funds.
pay.sh
A command-line payment gateway for pay-per-use and subscription APIs.
The common payment flow
MPP and x402 use different headers and data models, but their basic HTTP flow is similar: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 shared402
status code.
| MPP | x402 | |
|---|---|---|
| Challenge | WWW-Authenticate: Payment | PAYMENT-REQUIRED |
| Client authorization | Authorization: Payment | PAYMENT-SIGNATURE |
| Receipt | Payment-Receipt | PAYMENT-RESPONSE |
| Solana payment models | One-time charge and capped, metered session intents | Schemes such as exact and upto; support varies by network and client |
| Settlement architecture | Server validation, or an optional relay or gateway | Resource server with local verification or a facilitator |
| Good starting point | APIs that need HTTP authentication semantics or repeated metering | Pay-per-request resources and existing x402 clients |
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
x402 facilitator
Choose, integrate, or operate a service that verifies and settles x402 payments for your API.
x402 with Kora
Use Kora as the policy-enforced signer and fee payer behind an x402 facilitator.
Production readiness
RPC infrastructure, confirmation, monitoring, and key management before you launch.