Skip to content

Price change webhook

$0.01 per callUSDC via x402POST /api/price-webhook

Register an https URL and get a signed POST when the list price of a tool you watch changes on this server (a retry carries the same X-Agent402-Delivery id). Send POST /api/price-webhook with the required field url and pay $0.01 per call over x402 or MPP (there is no free tier). It returns a JSON object with id, url, slugs, secret, signature and 6 more.

Give "url" and, optionally, "slugs" (up to 50 tool slugs; omit it to watch every tool). The answer carries the subscription id and its secret: each delivery is JSON ({ type: "price.changed", changes: [{ slug, from, to }] }) with an X-Agent402-Signature header, t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>" with the secret>, so the receiver can check it came from here. A subscription lasts 90 days ("expiresAt"); register the same url again from the same wallet to renew it (same id and secret). One wallet holds up to 25. A delivery is tried up to 5 times; a 2xx ends it and a 410 removes the subscription. Remove it yourself, free, with POST /api/price-webhook/unsubscribe and the id and secret. The watched price is the list price on /api/pricing; a tool that is quoted per request keeps its list price there. Deterministic code, no model.

Category: Payments & x402Tags: webhook price pricing notification callback subscribeAlso found as: price-alert price-change-webhook pricing-webhook

Try in playground →

Parameters

NameTypeRequiredDescription
urlstringyesThe https URL that receives the signed POST. No credentials in the URL; it must resolve to a public address. Also accepted as link, uri, href, page.
slugsarray of stringnoTool slugs to watch (up to 50), as listed on /api/pricing. Omit it to watch every tool.

Example request

curl -i -X POST https://agent402.tools/api/price-webhook \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/","slugs":["search","answer"]}'

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

Watch a call get paid

RequestPOST /api/price-webhook
402$0.01 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "id": "pw_3f9a1c2e4b6d8f0a1c3e5a7b9d1f2e4c",
  "url": "https://example.com/",
  "slugs": [
    "answer",
    "search"
  ],
  "secret": "a402whsec_<64 hex characters>",
  "signature": {
    "header": "X-Agent402-Signature",
    "scheme": "t=<unix seconds>,v1=<hex HMAC-SHA256, with the secret, of \"<t>.<body>\": the timestamp, a dot, and the body as sent>"
  },
  "event": "price.changed",
  "unsubscribe": {
    "method": "POST",
    "url": "https://agent402.tools/api/price-webhook/unsubscribe",
    "body": {
      "id": "pw_3f9a1c2e4b6d8f0a1c3e5a7b9d1f2e4c",
      "secret": "<the secret above>"
    }
  },
  "expiresAt": "2027-02-19T12:00:00.000Z",
  "registered": false,
  "delivers": false,
  "note": "example.com is a documentation host: the registration is answered as a real one would be, and nothing is stored or sent."
}
FieldTypeAlways presentIn the example
idstringyespw_3f9a1c2e4b6d8f0a1c3e5a7b9d1f2e4c
urlstringyeshttps://example.com/
slugsarray of stringyes2 items in the example
secretstringyesa402whsec_<64 hex characters>
signatureobjectyes2 fields: header, scheme
eventstringyesprice.changed
unsubscribeobjectyes3 fields: method, url, body
expiresAtstringyes2027-02-19T12:00:00.000Z
registeredbooleanyesfalse
deliversbooleanyesfalse
notestringyesexample.com is a documentation host: the registration is answered as a real o...

From an MCP client

catalog.call {
  "slug": "price-webhook",
  "params": {
    "url": "https://example.com/",
    "slugs": [
      "search",
      "answer"
    ]
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for price-webhook; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.14.1.

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?.({ maxAmountPerPayment: "$0.01" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/price-webhook", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "url": "https://example.com/",
    "slugs": [
      "search",
      "answer"
    ]
  }),
});

Related tools

Audit report (one wallet's paid history, signed)

$0.01POST /api/audit-report

An audit report of your own wallet's paid history here, a record of every paid call: each call over a window of up.

B20 activation check

$0.002GET /api/b20-activation-check

Is B20 live on Base mainnet?

B20 feature id

FREE w/ computeor $0.001POST /api/b20-feature-id

Pure-CPU helper: turn a B20 feature string (e.g. base.b20_asset) into its bytes32 feature id and ready-to-send.

B20 payment memos

$0.005GET /api/b20-memos

Payment memos attached to B20 transfers: pairs each Memo(address,bytes32) log with its Transfer at the previous log.

New B20 tokens

$0.005GET /api/b20-new-tokens

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

B20 token info

$0.005GET /api/b20-token-info

ERC-20 metadata plus B20 signals for any Base address: name, symbol, decimals, total supply, best-effort paused/cap.