x402 gives AI agents a native way to pay. Here's how it actually works.
x402 turns HTTP 402 Payment Required into a machine-readable payment flow for APIs and AI agents. Here's the protocol, the request lifecycle, and what we learned from building Prospect402 as a real pay-per-request service.
x402 is an open payment standard that lets a web service state its price and accept payment inside a normal HTTP request-response flow. A client can discover the price, authorize payment, retry the request, and receive the resource without opening an account or managing a vendor API key.
Most APIs still sell software the way SaaS sold it in 2015: create an account, add a credit card, choose a plan, copy an API key, and commit to a bundle of usage before making the first useful request.
That works when a person is setting up one vendor for a long-running application. It is a bad fit for an AI agent that discovers a useful service halfway through a task and needs one answer worth two cents.
It activates the long-reserved 402 Payment Required status code and makes payment terms machine-readable.
The x402 documentation describes it as a standard for charging for APIs and content directly over HTTP. The important part is not that the payment happens onchain. The important part is that payment becomes machine-readable. Software can respond to a price the same way it responds to a redirect or an authentication challenge.
We built Prospect402, launching today, to see what that looks like outside a quickstart. It is an x402-paid API that gives sales agents website and technology signals for $0.02 USDC or an evidence-backed prospect brief for $0.10 USDC per successful response. No subscription. No prepaid credit balance. No API key.
Here is what the protocol does, where the complexity actually lives, and what building a real service taught us.
The problem x402 is trying to solve
Agents can call APIs, but they cannot complete the commercial setup around most APIs.
Give an agent a normal paid API and it runs into human gates: signup forms, email verification, billing pages, plan selection, approval flows, and credentials that have to be stored afterward. Even when a developer clears those gates in advance, the usual commercial choices are a monthly subscription or a bucket of credits. Both assume repeated use.
x402 makes a different assumption: a resource can carry its own price.
That supports a much smaller transaction. An agent can buy one data lookup, one document conversion, one inference, or one research brief when it needs it. The seller does not need a billing account for that buyer. The buyer does not need a standing commercial relationship with that seller.
This does not make subscriptions obsolete. Stable, high-volume integrations will often be cheaper and easier to govern under a contract. x402 is most interesting at the other end of the curve: low-cost, intermittent, machine-initiated purchases where account setup costs more than the request itself.
How an x402 request works
The official client/server specification defines a stateless exchange. In the common flow:
-
The client requests a resource. This could be an AI agent, an application, or an ordinary command-line client making a normal HTTP request.
-
The resource server returns
402 Payment Required. APAYMENT-REQUIREDheader contains a Base64-encoded description of the acceptable payment options: the amount, asset, network, payment scheme, and receiving address. -
The client chooses an option and authorizes it. Its wallet creates a signed payment payload that matches the server's terms.
-
The client retries the same request. This time it adds the signed payload in a
PAYMENT-SIGNATUREheader. -
The server verifies the authorization. It can do this itself or ask a facilitator to verify that the signature and payment terms are valid.
-
The server performs the work and settles the payment. With a valid authorization, it fulfills the request and submits the payment for settlement, directly or through the facilitator.
-
The server returns the resource. The client receives the normal response body plus a
PAYMENT-RESPONSEheader containing settlement details.
In compact form:
The three payment headers are the protocol surface in x402 V2: PAYMENT-REQUIRED carries the seller's terms, PAYMENT-SIGNATURE carries the buyer's authorization, and PAYMENT-RESPONSE carries the settlement result. The x402 HTTP 402 reference documents the exact role of each.
If a client already knows a resource's payment requirements, it can skip the initial challenge and send payment with the first request. The 402 round trip is how an unfamiliar client discovers the deal safely.
What a facilitator does and does not do
An x402 facilitator is a service that verifies payment authorizations and settles them on a supported payment network for the resource server. It removes blockchain-specific work from the API's request handler.
The facilitator is not the marketplace, the customer account system, or the owner of the protocol. It is infrastructure. The x402 standard is open and network-agnostic, and a seller can use a production facilitator, run one, or self-facilitate. The x402 Foundation repository explicitly describes those production paths.
This separation is useful. The API decides what a route costs and what it returns. The client decides whether the price and network are acceptable. The facilitator handles verification and execution for the payment scheme and network they both selected.
For Prospect402, the public contract stays simple: website intelligence in, structured JSON out, a fixed USDC price per successful response. The implementation uses an x402 resource server and Hono middleware, the exact payment scheme, Base in production, and a production facilitator for verification and settlement. Those are implementation choices, not requirements of the x402 standard.
Prospect402 as a concrete example
Prospect402 exposes two paid routes:
-
POST /v1/signalscosts $0.02 USDC and returns deterministic website metadata and technology signals. -
POST /v1/prospectcosts $0.10 USDC and returns an evidence-backed prospect brief with company context, grounded opportunities, and an outreach opening.
An agent sends the same small input to either route:
{ "url": "https://example.com" }
Without payment, the API answers with 402 and describes the Base/USDC requirement. An x402-compatible buyer signs that exact payment authorization and retries. A successful response is ordinary JSON, ready for the next step in the agent's workflow.
The service also publishes a free sample response, an OpenAPI 3.1 document, and an x402 discovery manifest. This matters because payment only solves purchase. An agent still needs to discover the service, understand its input and output, and decide whether it is useful.
That is the fuller pattern for agent-native commerce:
- Discover a service.
- Inspect its interface and price.
- Decide whether the expected value clears the cost.
- Authorize one bounded payment.
- Use the structured result.
The wallet gives the agent purchasing ability. OpenAPI and discovery metadata give it enough context to use that ability deliberately.
The production details the happy path leaves out
The payment handshake is short. Operating it safely still requires ordinary engineering.
Retries must not become duplicate charges
Networks fail after work succeeds. A client might time out after settlement and retry because it never received the JSON response. Without an idempotency design, that retry can produce another charge or another expensive computation.
Prospect402 requires a payment identifier for each logical request. The client reuses that identifier for network retries. If the first call settled, the service can return the cached response without settling again. If a client tries to reuse the same identifier for a different route or URL, the request is rejected.
That is not a crypto-specific lesson. It is the same idempotency rule a good payments API needs anywhere: retries should be safe, while replaying an authorization for different work should fail.
Price the successful unit of value
A route price should map to something the buyer can understand. Prospect402 charges per successful signals response or successful brief, not per crawl attempt or model call. Failed handlers return a non-success response and are not settled.
That clean unit makes the offer legible to an agent. It also forces the seller to understand its contribution margin: facilitator costs, network costs, inference, crawling, caching, and failure rates all sit behind a two-cent or ten-cent price.
Payment is not authorization
A valid payment proves that the client authorized the stated transfer. It does not prove the request is safe.
Paid endpoints still need input validation, abuse controls, timeouts, rate limits, and protection against server-side request forgery. Prospect402 accepts only public HTTPS URLs, bounds its crawl, follows only safe same-origin redirects, respects robots rules, limits response sizes, and caps daily AI usage. The payment gate complements those controls; it does not replace them.
Wallet policy matters more than wallet access
An autonomous agent should not receive an unlimited wallet and vague instructions to "buy whatever helps." Give it a per-request ceiling, a task budget, an allowlist or reputation policy for sellers, and a clear escalation path when a price exceeds its authority.
x402 makes a transaction executable by software. Your agent system still has to decide which transactions are allowed.
When x402 is a good fit
x402 is a strong fit when the resource is digital, the value arrives immediately, the price can be expressed per request, and the buyer may be software encountering the seller for the first time.
Examples include:
- niche data and enrichment lookups;
- inference, transcription, rendering, or document conversion;
- metered access to research, feeds, or premium content;
- agent tools that are valuable occasionally but not worth another subscription;
- services composed dynamically inside a larger automated workflow.
It is a weaker fit when buyers need invoices, negotiated terms, refunds, seat management, procurement approval, or predictable high-volume pricing. It also adds wallet custody, stablecoin accounting, facilitator selection, and network operations to the system. "No account required" does not mean "no operational work required."
The honest test is simple: does removing signup and subscription friction create more value than the new payment infrastructure costs to operate? For agent-facing, low-cost APIs, the answer is increasingly yes.
What x402 changes for agent builders
x402 gives agents an economic interface that looks like the rest of the web.
That is a bigger shift than adding a checkout option. An API response can now say, in a structured form: this capability exists, this is what it costs, these are the payment methods I accept, and this is how to proceed. The agent can evaluate that offer inside the same workflow that discovered the need.
Prospect402 is deliberately small, but that is why it is a useful launch example. A two-cent data request does not support a sales call, procurement review, subscription, or manual key provisioning. It only works if buying the API is almost as easy as calling it.
That is the promise of x402: not that every API becomes a vending machine, but that software gains a native way to buy the exact digital resource it needs, when it needs it.
If you're deciding where agent payments fit in your product, or how to put a safe, observable agent workflow into production, talk to Stride Techworks. We help small teams turn the protocol demo into an operating system they can trust.
Proof block: when x402 is the right payment model
Sources considered. The x402 protocol documentation, its client/server specification, the HTTP 402 reference, and the public Prospect402 interface, sample, and discovery documents.
Evaluation criteria. Use x402 when purchases are low-cost, intermittent, machine-initiated, and tied to one clearly priced resource. Verify idempotency, authorization boundaries, settlement behavior, failure handling, and the unit economics of a successful response.
Advice changes when. Prefer an account, contract, subscription, or prepaid arrangement when usage is stable and high-volume, identity or invoicing requirements dominate, transaction fees exceed the resource value, or the buyer cannot safely hold payment authority.
For the surrounding production controls, see AI and operations systems and the MCP security checklist.
FAQ
What is x402?
x402 is an open payment standard built around the HTTP 402 Payment Required status code. It lets APIs and websites communicate a price in a machine-readable response, accept a signed payment authorization, and deliver a paid resource through ordinary HTTP requests. It is designed for programmatic payments, including purchases made by AI agents.
Does x402 require Coinbase? No. Coinbase helped create the standard and offers x402 tooling, but x402 is an open Apache-2.0 protocol. Sellers can choose a production facilitator, run their own, or self-facilitate, and the protocol is designed to support multiple payment networks and assets.
Does x402 require cryptocurrency? Current production implementations commonly use stablecoins and onchain settlement, but the x402 standard is designed to be network, token, and currency agnostic. A specific client and server still need a payment scheme and network that both support.
What does an x402 facilitator do? An x402 facilitator verifies a buyer's payment authorization and settles the payment on a supported network for the resource server. It abstracts network-specific verification, transaction submission, and confirmation so the API can focus on pricing and delivering its resource.
How does an AI agent pay for an x402 API?
The agent requests a resource and receives 402 Payment Required with payment details. Its wallet signs a matching authorization, then the agent retries the request with that payload in the PAYMENT-SIGNATURE header. After verification and settlement, the API returns the requested resource and a PAYMENT-RESPONSE receipt.
What is Prospect402? Prospect402 is an x402-paid API for AI sales agents launching August 11, 2026. It accepts a public business website URL and returns either deterministic website signals for $0.02 USDC or an evidence-backed prospect brief for $0.10 USDC per successful response, without a subscription or API key.
Is x402 the same as a paywall? Not exactly. A paywall is one use case. x402 is the underlying payment protocol: it standardizes how a server communicates payment requirements and how a client authorizes and proves payment. It can protect a web page, an API route, a file, or another HTTP resource.
Substantively updated August 12, 2026. Fact-reviewed August 23, 2026.