Wire Format
Inspect raw x402 v2 PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE headers and settlement caveats.
Payment handshake
POST /runwithout payment -> server responds402 Payment RequiredwithPAYMENT-REQUIRED(base64accepts[]).- Client selects a chain (
eip155:8453,solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, oreip155:143) and signs the USDC authorization. - Client retries
POST /runwith the same body andPAYMENT-SIGNATURE. - Server settles on-chain and returns
202 AcceptedwithPAYMENT-RESPONSE(containing the on-chain tx hash) andcancel_token.
Raw x402 v2 headers
PAYMENT-REQUIRED(on402): Base64-encoded JSON listing the threeaccepts[]entries (eip155:8453,solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp,eip155:143).PAYMENT-SIGNATURE(on retry): Base64-encodedPaymentPayloadcontaining your EIP-3009transferWithAuthorizationsignature (Base/Monad) or signed SPL transfer (Solana).PAYMENT-RESPONSE(on202): Base64-encoded settlement receipt{ success: true, transaction, network, payer }.
{
"x402Version": 2,
"resource": {
"url": "https://x402.miroshark.xyz/run",
"serviceName": "MiroShark",
"tags": ["Simulation", "Research", "Search", "Crypto", "AI"]
},
"accepts": [
{ "scheme": "exact", "network": "eip155:8453",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "1000000", "payTo": "0x6cab485fc28ec70d3845113b704d4824e4d2b24f",
"maxTimeoutSeconds": 300, "extra": { "name": "USDC", "version": "2" } },
{ "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000", "payTo": "9vWbPNMvt8ui1cNN8jWWPUWT5LPmeXzq7nr3vry1vMPH",
"maxTimeoutSeconds": 300, "extra": { "feePayer": "<facilitator-sponsored>" } },
{ "scheme": "exact", "network": "eip155:143",
"asset": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"amount": "1000000", "payTo": "0x0000CE08fa224696A819877070BF378e8B131ACF",
"maxTimeoutSeconds": 300, "extra": { "name": "USDC", "version": "2" } }
]
}
Settlement caveats
- No chargebacks (
#gotchas-no-chargebacks): On-chain USDC settlement is final. If aPAYMENT-SIGNATURErequest times out mid-flight, check BaseScan, Solscan, or MonadVision for your nonce/signature before retrying so you never double-pay. - Manual refund on failure (
#gotchas-no-automatic-refund-on-failure): If a run ends infailedorbudget_exceeded,/statuspopulatesdata.refund({ eligible, contact, mailto, note }) so you can request a refund with yourrun_id. - Runtime &
429(#gotchas-runs-take-15-20-min): Full runs take ~10-20 minutes.429means concurrency is full (before settlement) - retry with backoff. 402afterPAYMENT-SIGNATURE(#gotchas-402-after-x-payment): Caused by insufficient USDC, a reused EVMnonce, a stale Solana blockhash, or signing the wrong chain'saccepts[]entry.