x402 (AI agents)

What an agent must pay (paywall)

For sellers that do not run an x402 library - the P2Flux Agent Paywall WordPress plugin, a PHP app. The seller sends its wallet and price; the answer is the x402 requirement an agent signs: USDC on this network, to the seller's vault, with the token's own signing domain. No chain read; reuse it for ttl seconds. When this deployment offers batch settlement, accepts also lists a batch-settlement requirement: the agent deposits once (at least 1 USDC) into the standard x402 escrow and pays each request with a signed voucher - no transaction per request. Its receiver is the seller's P2Flux batch vault, which pays the seller 97% and P2Flux 3%. With usage: true the answer offers the upto scheme alone: price is then the MOST one request can cost, the agent signs for up to it, and the seller says what the request really cost when it redeems (amount). extensions then declares eip2612GasSponsoring, so an agent that never approved Permit2 needs no ETH; pass it on in the 402.

post/x402/paywall/challenge

Request

  • Base URL: https://api.p2flux.com
  • URL: https://api.p2flux.com/x402/paywall/challenge
  • Auth: none required

Request body

recipientstring required

An EVM address.

pricestring required

Price in USDC as a decimal string, 0.01 or more.

usageboolean

Usage pricing: offer upto for at most price.

Example request

{
  "recipient": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "price": "0.05"
}

Response

Requirement

x402Version2 required
acceptsobject[] required

x402 payment requirements. Put them, with resource, in the base64 JSON of the 402 answer's PAYMENT-REQUIRED header.

ttlinteger required

Seconds the answer may be reused for the same wallet and price.

extensionsobject

Usage pricing: x402 extensions to pass on in the 402 (eip2612GasSponsoring).

Changes

No recorded changes to this operation across all 1 revision of this API.