Verify a signed x402 402 response (free)
verify_payment_requirementsBefore paying an x402 402 response, check that its payment requirements (payTo, amount, asset, network, resource) were signed by the seller and not altered in transit by a proxy, CDN, SDK or another tool. x402 v2 carries the requirements in the PAYMENT-REQUIRED response header (base64 JSON): pass either the decoded JSON or the raw base64 value as body. Optionally pass expect:{payTo, amount} — the address and amount you are about to pay — and the tool also checks they match what was signed. verified:false with reason_code no_signature means the seller does not sign (unprotected, not necessarily malicious); digest_mismatch or signature_invalid means the response was tampered with — do not pay.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The decoded PAYMENT-REQUIRED header JSON (object), or the raw base64 header value (string). | |
| expect | No | What you are about to pay; checked against the signed fields. | |
| keys_url | No | Override the seller's public-key URL (defaults to extensions.signedRequirements.keys_url). |