x402 quote

$0.002 per call · USDC via x402 · GET /api/x402-quote · Cached 10m

Probe any URL and decode its HTTP 402 payment requirements (price, asset, network, pay-to) into clean JSON - what an agent needs to decide whether/how to pay. Send GET /api/x402-quote with the required field url and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with url, status, paymentRequired and accepts.

Read-only; does not pay. ?url=https://api.example.com/paid&method=GET

Category: Payments & x402 · Tags: x402 402 payment-required quote discovery

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
urlstringyesURL of the paid resource to probe Also accepted as link, uri, href, page.
methodstringnoHTTP method to probe with (default GET)

Example request

curl -i "https://agent402.tools/api/x402-quote?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fhash&method=POST"

Without payment this returns HTTP 402 Payment Required with the exact price for x402-quote; any x402 v2 or MPP client pays it and retries.

Example response

{
  "url": "https://api.example.com/paid",
  "status": 402,
  "paymentRequired": true,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "asset": "USDC",
      "maxAmountRequired": "1000",
      "payTo": "0x…"
    }
  ]
}
FieldTypeAlways presentIn the example
urlstringnohttps://api.example.com/paid
statusnumberno402
paymentRequiredbooleannotrue
acceptsarray of objectsno1 item in the example

From an MCP client

catalog.call {
  "slug": "x402-quote",
  "params": {
    "url": "https://agent402.tools/api/hash",
    "method": "POST"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for x402-quote; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/x402-quote?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fhash&method=POST");

Related tools

x402 market pulse

FREE w/ compute · or $0.001 · GET /api/x402-market-pulse

Live cross-provider x402 market sentiment. topProviders: the top x402 sellers ecosystem-wide, ranked by REAL on-chain ac…

x402 trending sellers

$0.005 · GET /api/x402-trending

Momentum radar for the x402 seller ecosystem - which sellers are heating up, graded for wash-trade resistance. Reads the…

New B20 tokens

$0.005 · GET /api/b20-new-tokens

Recently deployed B20 tokens on Base: scans the factory's B20Created logs over a block window, locates each new token by…

Rate a call you paid for

$0.001 · POST /api/feedback

Tell this server whether a call you paid for delivered what it promised. Bound to the receipt: give it the settlement tr…

My usage (wallet-keyed purchase history)

$0.005 · POST /api/my-usage

Your own purchase history, keyed to the wallet that pays for the call - no wallet parameter, no signup: the x402 payment…

Build USDC transfer authorization

$0.003 · POST /api/transfer-authorization

Build the EIP-3009 transferWithAuthorization typed data for a gasless USDC transfer on Base/Polygon/Arbitrum/Optimism/Et…