x402 Envelope Auditor
x402-envelope-auditorNormalize and audit an x402 402-payment envelope before an agent spends. Accepts a raw response body, a JSON envelope, or x402 payment headers and returns requirement count, networks, schemes, payTo recipients, USDC price bounds, the cheapest compatible Base-USDC requirement, a deterministic allow/review/deny decision, facilitator hints, and fail-closed warnings for malformed or non-Base quotes. $0.01/call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"envelope": "<envelope>"
},
"name": "x402-envelope-auditor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headers | No | Optional response headers. Header values may include payment-required JSON or base64 encoded JSON. | |
| maxUsdc | No | Optional caller budget in USDC. Emits a warning when the cheapest requirement exceeds it. | |
| envelope | Yes | Raw x402 response body or JSON object containing accepts/paymentRequirements/requirements. | |
| expectedAsset | No | Expected USDC asset address on Base. | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| expectedNetwork | No | Expected payment network. Defaults to Base mainnet CAIP-2. | eip155:8453 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| payTo | Yes | ||
| schemes | Yes | ||
| decision | Yes | ||
| evidence | Yes | ||
| networks | Yes | ||
| warnings | Yes | ||
| cheapestUsdc | Yes | ||
| requirements | Yes | ||
| withinBudget | Yes | ||
| baseCompatible | Yes | ||
| requirementCount | Yes | ||
| mostExpensiveUsdc | Yes | ||
| cheapestCompatible | Yes |