Publish a public catalog
ServeGET /.well-known/x402.json without requiring payment. With Express:
buildDiscoveryDocument(options)
from your own route handler. Mount the gate separately; the discovery helper
neither protects routes nor scans your router automatically. Feed both from
the same resource configuration.
Each discovery resource contains its path, tier, unit price and receipt scope.
Quote and pay endpoint URLs identify where to negotiate payment. Chain,
asset, amount and expiry come from a fresh quote.
Also publish an API catalog or OpenAPI document with HTTP methods, parameters
and response schemas. Knowing /api/agent/search exists does not tell an agent
whether the required argument is q or query.
Link from the website
Put readable links in/llms.txt, for example (replace the example origin):
Link header or a visible developer link can provide another entry.
A request to an actual gated route also returns HTTP 402 with resource,
price, scope and payment steps. Read the linked client’s capabilities before
assuming that wallet creation enables automatic payment.
Where discovery is stored
The self-hosted discovery helper does not save a file or synchronize its
resource array with the dashboard. Its Express response is generated at
middleware initialization and can be cached for five minutes. Updating a
linked skill at a stable URL does not require a site redeploy; changing an
installed gate or embedded URL does.
Verify before inviting agents
From each deployed origin, follow/llms.txt links and confirm that discovery
and the API catalog return 200. Compare the listed resources with real gate
mounts. Request a protected route as an agent and check the 402’s merchant,
resource, price, minimum batch and scope. Then verify payment support against
the installed client and the quoted route. A working 402 alone proves only
that the paywall is reachable.