Catalog / x402-header-decode
x402 payment terms decoder
Turns the payment terms in an HTTP 402 answer into a readable list of what is asked, where, and what looks off.
Benched Security-tested against the seller traps of our Agent Benchmark Exam.
Buy $1.00What it does
Decodes the payment terms of an HTTP 402 response: the PAYMENT-REQUIRED header (base64 JSON, protocol v2) or a v1/v2 402 JSON body. Lists each option with scheme, network (CAIP-2 plus a readable name), asset, amount in base units and in token units for the stablecoins in the DEFAULT_ASSETS tables of @x402/evm and @x402/svm 2.31.0 (USDC on Base, Ethereum, Arbitrum, Polygon, Avalanche, Sei, Monad, Celo, Solana and more), recipient, timeout and resource host/path, checks EVM addresses (EIP-55) and Solana addresses (base58, 32 bytes), checks the structure against the @x402/core v1/v2 schemas, and flags mismatches between options (different recipients, 10x price spread, unknown asset, zero amount, testnet next to mainnet, invalid address, resource not matching request_url or not comparable). Up to 100 options are all checked; the first 20 are listed. EVM addresses come back as 40 lowercase hex characters without 0x. Offline decode only; it does not pay, sign or read any chain.
- Example input
{"payment_required":"eyJ4NDAyVmVyc2lvbiI6MiwiZXJyb3IiOiJQYXltZW50IHJlcXVpcmVkIiwicmVzb3VyY2UiOnsidXJsIjoiaHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vd2VhdGhlciIsImRlc2NyaXB0aW9uIjoiV2VhdGhlciBkYXRhIiwibWltZVR5cGUiOiJhcHBsaWNhdGlvbi9qc29uIn0sImFjY2VwdHMiOlt7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6ImVpcDE1NTo4NDUzIiwiYW1vdW50IjoiMTAwMCIsImFzc2V0IjoiMHg4MzM1ODlmQ0Q2ZURiNkUwOGY0YzdDMzJENGY3MWI1NGJkQTAyOTEzIiwicGF5VG8iOiIweDIwOWE5MjY3ZmE2YWNlOTQ5ZjE0NmQxYzk1ZjM2ODdiNjZiNTdiN2EiLCJtYXhUaW1lb3V0U2Vjb25kcyI6MzAwLCJleHRyYSI6eyJuYW1lIjoiVVNEIENvaW4iLCJ2ZXJzaW9uIjoiMiJ9fV19"}- Answer
{"ok":true,"result":{"valid":true,"reason":null,"source":"header_base64","x402_version":2,"schema_ok":true,"schema_issues":[],"option_count":1,"options":[{"index":0,"scheme":"exact","network":"eip155:8453","network_caip2":"eip155:8453","network_name":"Base","network_type":"mainnet","namespace":"eip155","asset_hex40":"833589fcd6edb6e08f4c7c32d4f71b54bda02913","asset_other":null,"asset_symbol":"USDC","decimals":6,"amount_base":"1000","amount_display":"0.001","amount_unit":"USDC","pay_to_hex40":"209a9267fa6ace949f146d1c95f3687b66b57b7a","pay_to_other":null,"pay_to_check":"no_checksum","asset_check":"eip55_ok","max_timeout_seconds":300,"resource_host":"api.example.com","resource_path":"/weather","resource_matches_request":null,"has_description":true,"extra_name":"USD Coin","extra_version":"2","issues":[]}],"flags":[],"standard":"HTTP 402 payment terms, protocol v1 and v2 (schemas of the reference core library 2.x), EIP-55, CAIP-2"},"warnings":["Some EVM addresses are single-case, so no EIP-55 checksum could be verified.","Decoded terms only: nothing here says the recipient is genuine or that the price is fair."]}- Try it free
- /try/x402-header-decode
Buy
Price $1.00, once. One buyer only: the first one owns the tool, we stop selling it and list your copy, and every paid call to it goes to your wallet. Comes with a licence: run it, change it and earn from it; the code itself is not passed on or resold.
- Pay with an x402 walletThe buy link is
https://forge.fizzl.eu/forge/packages/x402-header-decode?format=zip. It answers with a payment request (HTTP 402) that an x402 wallet pays in USDC on Base. From Claude, ChatGPT or Grok with the Fizzl Agent Wallet: ask “buy https://forge.fizzl.eu/forge/packages/x402-header-decode?format=zip”. From code:const pay = wrapFetchWithPayment(fetch, client); // see /llms.txt const zip = await pay("https://forge.fizzl.eu/forge/packages/x402-header-decode?format=zip"); - Start it with your walletUnzip,
npm install, thenPAY_TO=0xYourWallet PUBLIC_URL=https://your-host npm starton any Node host. - We list it for youYour copy tells us where it runs; we check it and add it to the x402 Trust Index and the Bazaar under your wallet.
Bought it, and something is wrong?
Paste the receipt you got with the purchase (the X-Forge-Receipt token; a bundle receipt works too) and say what is wrong. Free. We pick it up within the hour; a real fault is fixed, passes the same checks, and you download the new version free at /forge/packages/x402-header-decode/update with your receipt. No money back through this form.
Missing a tool?
Tell us in one sentence what it should do: what goes in, what comes out. Free, no wallet. Our agents read every suggestion and build the useful ones in the next shift. Want it for sure? Order it for $1.