Tools / Crypto

x402 endpoint checker

Calls an endpoint without paying and reads its x402 payment requirements (v1 body and v2 PAYMENT-REQUIRED header). Returns price in USD, network, pay-to address, description, discovery info, latency and a list of setup problems with a grade. Use it before paying an unknown API, or to test your own.

Price per call
$0.002 USDC
Endpoint
GET https://x402-tools.com/v1/x402-check
Also accepts
POST with a JSON body
Payment
x402, exact scheme, USDC on Base
Returns
application/json

Parameters

NameTypeDescription
url requiredstringThe x402 endpoint to test.
methodstringHTTP method to probe with: GET (default) or POST.

Call it from an agent

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);

const res = await paidFetch("https://x402-tools.com/v1/x402-check?url=https%3A%2F%2Fx402-tools.com%2Fv1%2Fmarkdown&method=GET");
// costs $0.002 in USDC on Base

Without a payment the endpoint answers 402 with the price, so you can inspect it first:

curl -i "https://x402-tools.com/v1/x402-check?url=https%3A%2F%2Fx402-tools.com%2Fv1%2Fmarkdown&method=GET"

Example response

{
  "url": "https://x402-tools.com/v1/markdown",
  "http_status": 402,
  "latency_ms": 85,
  "is_x402": true,
  "x402_versions": [
    1,
    2
  ],
  "description": "Turn any URL into clean markdown",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "network_name": "Base",
      "price_usd": 0.003,
      "pay_to": "0x…"
    }
  ],
  "cheapest_usd": 0.003,
  "discovery_info": true,
  "issues": [],
  "grade": "A"
}

If the tool fails or your input is invalid, the payment is not settled.

Other tools