Blog · 2026-11-02

One line that checks every x402 payment before it goes through

By Nicklaus Williams · Markdown twin

Most agent stacks already wrap fetch to attach a payment signature when they see HTTP 402. The missing line is "ask whether this seller looks sane before we sign."

x402check-client 0.1.5 adds that as an opt in wrapper.

Install

npm install x402check-client

wrapFetch

import { wrapFetch } from "x402check-client";

const fetchPaid = wrapFetch(globalThis.fetch, {
  onAvoid: "throw",      // or "return-check"
  onCaution: "allow",    // or "throw" / "return-check"
  maxAmountUsd: 0.05,    // optional extra guard on the seller's live price
});

// Use fetchPaid anywhere your agent used to call fetch for x402 sellers.
const res = await fetchPaid("https://seller.example/tool");

On an avoid verdict the wrapper refuses to continue into payment. On ok it still lets your existing x402 payment wrapper do the Exact USDC settle on Base.

Axios

import axios from "axios";
import { createAxiosRequestInterceptor } from "x402check-client";

axios.interceptors.request.use(createAxiosRequestInterceptor({ onAvoid: "throw" }));

MCP and AGENTS.md

If your agent reads project instructions, drop in AGENTS.md or the skill at /.well-known/agent-skills/x402-preflight/SKILL.md. The rule is the same: preflight before paying.

Remote MCP: https://x402check.dev/mcp

Registry: dev.x402check/mcp

Cost

No fabricated uptime claims, no public dump of other people's endpoints. You get the verdict and history for the URL you asked about.

More: all posts · docs · x402check.dev