Payments
Pay
Pay for and fetch an x402 resource — spends real USDC
POST
Fetches an x402 resource, paying for it from the agent’s wallet if it demands payment.
Returns the resource body plus a receipt.
A resource that isn’t paywalled returns
How it works
- Fetch the URL.
- Not a
402? Return the response —paid: false, no receipt, nothing spent. - Decode the requirements and select one under policy:
exactscheme, USDC, an allowed network, at or under the effective cap. - Check balance and
dailyBudget, then emitpayment.requested. - Sign a USDC payment in the custody plane, which re-enforces
perTxMaxat signing time. - Retry the request once with the payment attached.
- Hard stop — persist the receipt and emit
payment.settled. A failure after signing is never retried a second time.
Spend control — no approval workflow
There is deliberately no approval queue on this endpoint, unlike cards. What bounds a payment:
The effective per-payment cap is
min(max_amount, wallet perTxMax).
Request Body
paid: false and receipt: null — nothing was
spent. The receipt’s amount is a decimal USDC string, and settleResponseB64 is the
raw base64 PAYMENT-RESPONSE envelope: the onchain-verifiable audit artifact.
Receipts are booked idempotently on (direction, origin, nonce), so a replay returns the
existing row and books nothing twice.
Errors
payment_rejected reasons
CLI
MCP
Tool:naive_payments_pay