{"uid":"cap_0gZnI_L0Gzt243f-HxVMZ","slug":"fastx402-x402-payment-header-decoder-f7370386","name":"FastX402 x402 Payment Header Decoder","description":"146 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.","url":"https://fastx402.tools/x402-requirements-decode?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["header"],"properties":{"header":{"type":"string","description":"Value of the PAYMENT-REQUIRED response header (base64 JSON)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"error":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"amount":{"type":"string"},"pay_to":{"type":"string"},"scheme":{"type":"string"},"is_usdc":{"type":"boolean"},"network":{"type":"string"},"network_name":{"type":"string"},"amount_atomic":{"type":"string"},"max_timeout_seconds":{"type":"integer"}}}},"resource":{"type":"string"},"x402_version":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"error":"Payment required","options":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"0.001","pay_to":"0xFe6Ae9ec9DE12817f23958F11b6CE69194b6Bd7E","scheme":"exact","is_usdc":true,"network":"eip155:8453","network_name":"Base","amount_atomic":"1000","max_timeout_seconds":300}],"resource":"https://fastx402.tools/dns?name=example.com","x402_version":2}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Z0vRmnBMhgx6i1SSAq_IV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decodes a base64-encoded x402 PAYMENT-REQUIRED header into human-readable payment details including network, token, amount, recipient address, and timeout.","exampleAgentPrompt":"Can you decode this x402 PAYMENT-REQUIRED header for me so I can see the network, USDC amount, recipient address, and timeout before I decide to pay? The header value is: eyJ4NDAyX3ZlcnNpb24iOjIsInBheW1lbnRzUmVxdWlyZWQiOlt7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6ImVpcDE1NTo4NDUzIn1dfQ==","exampleUseCases":[{"title":"Inspect 402 challenge before paying","prompt":"I just got a 402 response with this PAYMENT-REQUIRED header — can you decode it and tell me which network it wants payment on, how much USDC, and who the recipient is before I go ahead and pay? Header: eyJ4NDAyX3ZlcnNpb24iOjIsInBheW1lbnRzUmVxdWlyZWQiOlt7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6ImVpcDE1NTo4NDUzIn1dfQ=="},{"title":"Validate x402 header fields in agent pipeline","prompt":"Before my agent pays this x402 challenge, decode the PAYMENT-REQUIRED header value and confirm it's requesting USDC on Base with a max timeout of at least 60 seconds. Header: eyJ4NDAyX3ZlcnNpb24iOjIsInBheW1lbnRzUmVxdWlyZWQiOlt7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6ImVpcDE1NTo4NDUzIn1dfQ=="},{"title":"Explain 402 payment requirement to non-technical user","prompt":"I received a PAYMENT-REQUIRED header from an API in base64 and I don't know what it means — can you decode it and explain in plain English what network, token, amount, and address it's asking me to pay to? Here's the header: eyJ4NDAyX3ZlcnNpb24iOjIsInBheW1lbnRzUmVxdWlyZWQiOlt7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6ImVpcDE1NTo4NDUzIn1dfQ=="}],"resultDescription":"Returns a JSON object with the x402 version, the resource URL, and an array of payment options. Each option includes the asset contract address, human-readable USDC amount, atomic amount, recipient address (pay_to), payment scheme, network identifier (e.g. eip155:8453), network name (e.g. Base), USDC flag, and max timeout in seconds. Also returns an error string if decoding fails.","failureModes":["Invalid or malformed base64 input returns an error field in the response","Missing required 'header' query parameter causes a 400-level error","Non-x402 or unsupported header format may return empty options array","Network timeout or service unavailability returns a 5xx error"],"whenToPreferThis":"Use this endpoint when an AI agent or developer receives an x402 HTTP 402 PAYMENT-REQUIRED response and needs to inspect or explain the encoded payment details before deciding whether or how to pay. It is especially useful for debugging, logging, auditing payment challenges, or presenting human-readable payment info to a user — rather than blindly submitting a payment. Prefer this over manual base64 decoding when you need structured, labelled output with USDC-friendly amounts and network names.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:40:56.136Z","isFirstParty":false,"canonicalSlug":"fastx402-x402-payment-header-decoder-f7370386"}