Skip to content

x402 discovery

The discovery feed is Cryptonly’s public list of paid endpoints. AI agents and x402 directories read it to find APIs they can pay for. Listing is optional and free.

Each account is listed as one service, under its listing name and icon. Set them before you list endpoints:

  • Listing name: set it in x402 Settings › Discovery. Use up to 32 Latin letters, digits, spaces or punctuation. It goes into every 402 as resource.serviceName. An account without a listing name is not listed.
  • Icon: the logo from the account’s checkout branding (light version first), sent as resource.iconUrl. Use a square PNG, JPEG or WebP; marketplaces show it at favicon size and don’t support SVG.
Open discovery settings

Turn on List publicly when you add or edit an endpoint. The Status column of the Endpoints tab shows which endpoints are listed.

Open endpoints
Paid endpoints table: three endpoints are listed and one is private; /v1/forecast/:city is set in code at 0.02 USDC.Paid endpoints table: three endpoints are listed and one is private; /v1/forecast/:city is set in code at 0.02 USDC.

Agents choose endpoints by what they read about them:

FieldWhat it tells agents
DescriptionWhat the endpoint returns and when to call it, in plain language, up to 500 characters. Sent as resource.description.
TagsUp to 5 topics, such as weather or finance, that marketplaces search by. Sent as resource.tags.

Install @x402/extensions next to your @cryptonly/x402-* package too. It then adds the route template and path parameters to the endpoint’s 402 response.

The Advanced fields describe the endpoint for agents:

FieldWhat it tells agents
Payment timeoutHow long a signed payment stays valid. Sent as maxTimeoutSeconds.
Response typeThe content type of the response, such as application/json.
Input JSON SchemaHow to call the endpoint: query parameters for GET, HEAD and DELETE, the body for POST, PUT and PATCH.
Output JSON SchemaWhat the endpoint returns.

Add the Bazaar extension to the route, on top of the setup from Prices in your code:

import { bazaarResourceServerExtension, declareDiscoveryExtension } from '@x402/extensions/bazaar';
server.registerExtension(bazaarResourceServerExtension);
app.use(
paymentMiddleware(
{
'GET /v1/quote/:symbol': {
accepts: [
{ scheme: 'exact', price: '$0.005', network: 'eip155:8453', payTo: process.env.PAY_TO! },
],
description: 'Token price quote',
tags: ['finance', 'prices'],
extensions: declareDiscoveryExtension({
output: { example: { symbol: 'SOL', usd: 150.25 } },
}),
},
},
server,
),
);

The route is listed after its first payment. A route with path parameters is listed once, as /v1/quote/:symbol. The feed takes the description and tags from your 402, and the name and icon from your listing.

  • Every 10 minutes, Cryptonly makes an unpaid request to each listed endpoint. It must answer 402 and ask to be paid to one of your addresses.
  • An endpoint that fails 3 checks in a row, or passes none for 24 hours, is removed from the feed. It comes back once it passes again.
  • To remove an endpoint yourself, turn off List publicly, or stop declaring discovery in code.
  • Your account needs a listing name.
  • You can list up to 50 endpoints per account.
  • Endpoints of verified businesses are marked with extensions.cryptonly.verifiedMerchant: true.

The feed is public JSON in the x402 Bazaar format, at GET https://api.cryptonly.net/x402/discovery/resources:

Terminal window
curl "https://api.cryptonly.net/x402/discovery/resources?limit=20"
Open the feed

The sandbox feed is at https://sandbox-api.cryptonly.net/x402/discovery/resources. The feed needs no API key.

Each item carries serviceName, iconUrl and tags next to description and accepts. Filter with payTo, network, scheme and extensions (for example extensions=bazaar), and page with limit and offset.

Or use a client:

import { fetchDiscoveryResources } from '@cryptonly/x402';
const { items } = await fetchDiscoveryResources({ network: 'eip155:8453', limit: 50 });