Anywaypossible · Payment Guard

by Anywaypossible

POSTBase

$0.01

per call · USD Coin on Base

Verify an x402 purchase before an AI agent signs. Validate the live HTTP 402 challenge, Base network, USDC asset, quoted price, recipient, price ceiling, buyer funding, optional gas reserve, and destination hazards, then receive a machine-readable safe-to-sign, fund, review, or reject decision. No account or API key.

Endpoint

POST https://anywaypossible.com/api/payment-guard

4

Calls / 30d

2

Unique payers / 30d

Sep 4

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://anywaypossible.com/api/payment-guard", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "expectedPayTo": "0x2222222222222222222222222222222222222222",
    "maxAmountUsdc": "0.10",
    "minGasReserveEth": "0",
    "payerAddress": "0x1111111111111111111111111111111111111111",
    "serviceUrl": "https://example.com/api/report"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://anywaypossible.com/api/payment-guard" \
  -H "Content-Type: application/json" \
  -d '{"expectedPayTo":"0x2222222222222222222222222222222222222222","maxAmountUsdc":"0.10","minGasReserveEth":"0","payerAddress":"0x1111111111111111111111111111111111111111","serviceUrl":"https://example.com/api/report"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "alerts": [],
  "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "checks": [
    {
      "id": "x402_contract",
      "status": "pass"
    }
  ],
  "decision": "safe_to_sign",
  "network": "eip155:8453",
  "quotedAmountUsdc": "0.01",
  "quotedPayTo": "0x2222222222222222222222222222222222222222",
  "recommendedAction": "Sign only the validated payment requirements.",
  "riskLevel": "low",
  "safeToSign": true
}

Payment details

Pay to0xe5690d37805107c56f6195e65a262b234e0e5e75
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from Anywaypossible & similar services