Skip to main content
An agent arriving at your domain needs two things: a catalog of what it can request, and instructions for paying. A general AiFinPay skill cannot know which routes your website monetizes.

Publish a public catalog

Serve GET /.well-known/x402.json without requiring payment. With Express:
For Next.js or another framework, return 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. Put readable links in /llms.txt, for example (replace the example origin):
Resolve relative links against the page’s origin. If your consumers need absolute links, generate them from the configured public origin for that environment. A staging site must not send agents to a production catalog that has not been deployed. Keep these files accessible to agent user agents. An HTTP 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.