Pay-Per-Request
Mode: Direct
In the Pay-Per-Request (or “Direct”) model, agents pay for each individual API call or digital good download at the moment of request.
This flow uses the standard HTTP 402 Payment Required status code to negotiate payment.
Interaction Cycle
1. The “Naïve” Request
The agent attempts to access the resource or API endpoint without any payment headers.2. The 402 Challenge
The server negotiates by returning402 Payment Required and a JSON body detailing the price, asset, and destination.
3. The Authorized Request
The agent constructs and signs a transaction matching the requirements, then resends the request with theX-Payment header.
Transaction Construction
The critical step is building the correct transaction. The format differs strictly between EVM (Base) and Solana.- Base (EVM)
- Solana
Rule: You MUST construct an
ERC-20 transfer of the specified asset (USDC). Native ETH transfers are ignored.