MiroSharkMiroShark

Wire Format

Inspect raw x402 v2 PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE headers and settlement caveats.

Payment handshake

  1. POST /run without payment -> server responds 402 Payment Required with PAYMENT-REQUIRED (base64 accepts[]).
  2. Client selects a chain (eip155:8453, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, or eip155:143) and signs the USDC authorization.
  3. Client retries POST /run with the same body and PAYMENT-SIGNATURE.
  4. Server settles on-chain and returns 202 Accepted with PAYMENT-RESPONSE (containing the on-chain tx hash) and cancel_token.

Raw x402 v2 headers

  1. PAYMENT-REQUIRED (on 402): Base64-encoded JSON listing the three accepts[] entries (eip155:8453, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, eip155:143).
  2. PAYMENT-SIGNATURE (on retry): Base64-encoded PaymentPayload containing your EIP-3009 transferWithAuthorization signature (Base/Monad) or signed SPL transfer (Solana).
  3. PAYMENT-RESPONSE (on 202): 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 a PAYMENT-SIGNATURE request 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 in failed or budget_exceeded, /status populates data.refund ({ eligible, contact, mailto, note }) so you can request a refund with your run_id.
  • Runtime & 429 (#gotchas-runs-take-15-20-min): Full runs take ~10-20 minutes. 429 means concurrency is full (before settlement) - retry with backoff.
  • 402 after PAYMENT-SIGNATURE (#gotchas-402-after-x-payment): Caused by insufficient USDC, a reused EVM nonce, a stale Solana blockhash, or signing the wrong chain's accepts[] entry.

On this page