Currently accepted
- Protocol: x402 v2, scheme
exact - Asset: USDC
- Network: Base Sepolia (
eip155:84532): testnet during early access
Flow
- Quote. Call a paid endpoint (
POST /v1/instancesor/extend) without payment. You get402with aPaymentRequiredobject in the JSON body and base64-encoded in thePAYMENT-REQUIREDheader. - Sign. Pick
accepts[0]and sign an EIP-3009transferWithAuthorizationfor exactly that amount, asset andpayTo. Nothing moves yet. - Retry. Send the same request with
PAYMENT-SIGNATURE: <base64 payload>. Legacy v1 clients may useX-PAYMENT. - Settle. We verify the payload with an x402 facilitator, settle it on-chain, then create or extend the VPS.
- Receipt. The response carries
PAYMENT-RESPONSE(base64) with the transaction hash, and the JSON includespayment.tx.
{
"x402Version": 2,
"error": "payment required",
"resource": { "url": "https://nestforge.cloud/v1/instances",
"description": "NestForge nano x 2h", "mimeType": "application/json" },
"accepts": [{
"scheme": "exact",
"network": "eip155:84532",
"asset": "0x…", // USDC contract
"amount": "10000", // atomic units: 0.01 USDC
"payTo": "0x…",
"maxTimeoutSeconds": 300,
"extra": { "name": "USDC", "version": "2" }
}]
}Guarantees
- Pay only on success. If verification fails you receive another 402 with the reason and nothing is charged.
- No replays. Each payment payload can be used once; reuse returns
402 payment payload already used. - Exact match. Payments for a lower amount, another network, asset or recipient are rejected before settlement.
Error reasons
| error | Meaning |
|---|---|
payment required | No payment header was sent. |
malformed payment header | Header is not a valid base64 x402 payload. |
payment does not match requirements | Amount, network, asset or payTo differs from the quote. |
payment payload already used | Replay of an earlier payment. |
payment invalid: … | Facilitator rejected it (signature, balance, expiry …). |
settlement failed: … | On-chain settlement did not go through; nothing was created. |
A 502 means the facilitator was unreachable, so retry with a fresh signature.