x402 test mode
Postern speaks x402 — the HTTP-native “pay to proceed” pattern. A paid action answers 402 Payment Required; the agent signs a payment authorization and retries; the server verifies and settles before
provisioning. In V1 this runs in test mode on Base Sepolia testnet, so you can wire and exercise
the entire paid path before any real money moves.
The flow
Section titled “The flow”-
Request a paid action. For example
POST /v1/inboxes(or a/v1/purchaseendpoint) for an org with paid provisioning enabled. -
Get
402with a challenge. The response carries aPAYMENT-REQUIREDheader describing the amount, asset, network, and pay-to details. 402 Payment Required -
Sign an EIP-3009 authorization. The agent signs a
transferWithAuthorizationfor the quoted amount on Base Sepolia (CAIP-2eip155:84532). -
Retry with the payment. Re-send the request with the signed payload attached.
-
Server verifies + settles. Postern verifies and settles via the signup-free facilitator at
https://x402.org/facilitator. -
Provisioning runs on settlement. The action is gated on settlement confirmation — not on receipt of the signed payload. Once settled, the mailbox is created and returned. settlement-gated
The 402 challenge
Section titled “The 402 challenge”HTTP/1.1 402 Payment RequiredPAYMENT-REQUIRED: network=eip155:84532; asset=USDC; amount=5000000; pay_to=0xFacilitator…; resource=mailboxes:5; facilitator=https://x402.org/facilitatorContent-Type: application/json{ "error": { "code": "payment_required", "message": "Paid action. Sign the EIP-3009 authorization and retry." }, "payment": { "network": "eip155:84532", "asset": "USDC", "amount": "5000000", "resource": "mailboxes:5", "facilitator": "https://x402.org/facilitator" }}In the SDK this surfaces as a PaymentRequiredError with the challenge on err.paymentRequired, so
your client can sign and retry programmatically.
Why payments are also anti-abuse
Section titled “Why payments are also anti-abuse”x402 spend is the economic half of Postern’s abuse story, alongside the karma and ramping caps. Making bulk provisioning cost something — even a tiny testnet amount — prices out the “spin up 10,000 throwaway inboxes” attack without punishing a legitimate agent that needs a handful. The capability model bounds who can provision; x402 bounds how cheaply abuse scales.
Test-mode specifics
Section titled “Test-mode specifics”| Aspect | V1 (test mode) |
|---|---|
| Network | Base Sepolia testnet — CAIP-2 eip155:84532 |
| Asset | testnet USDC |
| Facilitator | signup-free https://x402.org/facilitator |
| Authorization | EIP-3009 transferWithAuthorization |
| Gating | provisioning waits for settlement confirmation |
| Mainnet | deferred — a config flag flips to a CDP facilitator later |
- Errors — the
402envelope andpayment_requiredcode. - Deliverability & karma — the other half of anti-abuse.
- Rate limits & quotas — the published caps.