My usage (wallet-keyed purchase history)

$0.005 per call · USDC via x402 · 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 IS the identity, so nobody can read another wallet's profile. Send POST /api/my-usage with no required fields (2 optional) and pay $0.005 per call over x402 with USDC on an EVM chain (the paying wallet is the identity). It returns a JSON object with wallet, days, persistent, totals, byNetwork and 4 more.

Returns totals, per-tool counts, per-chain breakdown, recent receipts with settle tx hashes (independently verifiable on-chain), and this wallet's refunds: any payment that settled for a call that failed to deliver, with its status and our refund transaction once sent. Anyone holding a settlement tx can also check it for free at GET /api/refunds/lookup?tx=<hash>. Requires an EIP-3009 payment (USDC on Base, Polygon, or Arbitrum); Solana/Stellar payments carry no signed payer the server can verify.

Category: Payments & x402 · Tags: usage receipts billing audit wallet x402 history

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
daysnumbernoAggregation window in days, 1-365 (default 30). The recent list is always the latest rows regardless.
limitnumbernoMax recent receipts to return, 1-200 (default 50)

Example request

curl -i -X POST https://agent402.tools/api/my-usage \
  -H "Content-Type: application/json" \
  -d '{"days":30}'

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

Example response

{
  "wallet": "0x902dcf34e53695bdea2ffb354b1a2e58bd598256",
  "days": 30,
  "persistent": true,
  "totals": {
    "calls": 42,
    "paidUsd": 1.234,
    "firstAt": "2026-07-01T00:00:00.000Z",
    "lastAt": "2026-07-09T00:00:00.000Z"
  },
  "byNetwork": {
    "base": {
      "calls": 40,
      "usd": 1.2
    },
    "polygon": {
      "calls": 2,
      "usd": 0.034
    }
  },
  "bySlug": [
    {
      "slug": "hash",
      "calls": 12,
      "usd": 0.012,
      "lastAt": "2026-07-09T00:00:00.000Z"
    }
  ],
  "recent": [
    {
      "at": "2026-07-09T00:00:00.000Z",
      "slug": "hash",
      "priceUsd": 0.001,
      "network": "base",
      "tx": "0x…"
    }
  ],
  "refunds": {
    "count": 1,
    "owedUsd": 0,
    "paidUsd": 0.005,
    "rows": [
      {
        "tx": "0x…",
        "status": "paid",
        "amountUsd": 0.005,
        "network": "eip155:8453",
        "chain": "base",
        "refundTx": "0x…",
        "refundTxUrl": "https://basescan.org/tx/0x…",
        "refundedAt": "2026-07-09T01:00:00.000Z",
        "recordedAt": "2026-07-09T00:00:00.000Z"
      }
    ]
  },
  "note": "Every USDC row keeps its settle tx - verifiable on-chain."
}
FieldTypeAlways presentIn the example
walletstringyes0x902dcf34e53695bdea2ffb354b1a2e58bd598256
daysnumberyes30
persistentbooleanyestrue
totalsobjectyes4 fields: calls, paidUsd, firstAt, lastAt
byNetworkobjectyes2 fields: base, polygon
bySlugarray of objectsyes1 item in the example
recentarray of objectsyes1 item in the example
refundsobjectyes4 fields: count, owedUsd, paidUsd, rows
notestringyesEvery USDC row keeps its settle tx - verifiable on-chain.

From an MCP client

catalog.call {
  "slug": "my-usage",
  "params": {
    "days": 30
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for my-usage; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY (wallet only for this tool). 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/my-usage", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "days": 30
  }),
});

Related tools

Receipts (your settled calls, as accounting rows)

$0.005 · POST /api/receipts

Your own settled calls in the shape a finance system posts: one row per payment with what was bought, the amount settled…

x402 security audit

$0.01 · GET /api/x402-audit

Grade any x402 seller's payment-security posture from the outside - a read-only black-box check mapped to the 'Five Atta…

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…

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…

USDC balance

$0.003 · GET /api/usdc-balance

Read the USDC balance of any address on Base, Polygon, Arbitrum, Optimism, Ethereum, Monad, Celo, Avalanche, or Sei. Rea…

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…