Verify a signed x402 402 response was not tampered with (free)
verify_payment_requirementsValidate signed x402 payment requirements from decoded PAYMENT-REQUIRED headers, detecting tampered payTo or amount and returning true/false with a reason code.
Instructions
A 402 response is plaintext: any hop between seller and agent (proxy, CDN, a compromised SDK, a malicious tool) can swap the payTo address. Sellers who sign their payment requirements with OceanAlt put extensions.signedRequirements (Ed25519) inside the PAYMENT-REQUIRED header payload. Pass the decoded header JSON (or its raw base64) and, optionally, the payTo / amount you expect; get verified true/false with a reason code: ok | no_signature | digest_mismatch | signature_invalid | key_unavailable | payto_mismatch | amount_mismatch. Defends against tampering in transit, not against a compromised seller origin. Free, no API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expect | No | What you expect to pay; mismatches are reported. | |
| keys_url | No | Where the seller publishes its keys (defaults to the keys_url inside the signature). | |
| payment_required | No | The decoded PAYMENT-REQUIRED JSON, or the raw base64 header value. |