What’s new: CDP’s x402 Bazaar now supports semantic search,
structured filters, and quality-based ranking so your agent can zero in on relevant paid APIs instead
of relying on a flat catalog alone. See CDP semantic search and how ranking works.
The paginated resources list is still available for inventory-style browsing.
The Bazaar is under active development. Semantic search, quality ranking, and
the MCP server interface are recent additions — expect the API surface to
evolve as we incorporate feedback.
Overview
Our Bazaar endpoints address x402 service discoverability by providing:- For buyers (API consumers, including agents): call the discovery endpoints to list or search the CDP Facilitator’s catalog, inspect pricing and schemas, then pay and call the resource.
- For sellers (API providers): when the CDP Facilitator sees a valid x402 payment that implements Bazaar cataloging, your declared metadata can surface in the CDP Bazaar discovery APIs.
Access modes
- Paginated catalog (HTTP) (
GET /v2/x402/discovery/resources) — inventory-style browsing withlimitandoffset. For custom UIs, dashboards, and backend integrations. Paths, parameters, and examples are in CDP discovery endpoints (HTTP) and Paginated catalog below. - Semantic search (HTTP) (
GET /v2/x402/discovery/search) — same CDP index as the catalog, optimized for query, filters, and quality ranking, not for walking the full catalog. See CDP Bazaar: Semantic search. - MCP Server (
GET /v2/x402/discovery/mcp) — for AI agents via Model Context Protocol (search_resources/proxy_tool_callwrap paid calls). See Bazaar MCP Server and the MCP Server guide.
How it works
In x402 v2, the Bazaar has been codified as an official extension in the reference SDK (@x402/extensions/bazaar). This extension enables:
- Sellers declare discovery metadata (input/output schemas) in their route configuration.
- The CDP Facilitator extracts and catalogs that metadata when it processes payments for your routes (discovery indexing runs after settle completes; verify alone is not enough).
- Buyers call the discovery APIs below: a paginated catalog, semantic search, or merchant lookup.
When does my endpoint appear? There is no separate registration step. The CDP Facilitator catalogs your service the first time it settles a payment for that endpoint (the usual client flow is verify then settle; indexing happens when settlement succeeds). If your service does not appear in CDP Bazaar discovery, ensure at least one successful settlement has completed through the CDP Facilitator.
v1 vs v2
| Aspect | v1 (Deprecated) | v2 (Current) |
|---|---|---|
| Discovery data | outputSchema field in PaymentRequirements | extensions.bazaar field in route config |
| Schema validation | None | JSON Schema validation |
| Input specification | Not supported | Full input/output schema support |
Seller integration
Install, middleware, CDP API keys, and full route examples live in the Quickstart for sellers. For Bazaar indexing you still need to:- Point your resource server at the CDP Facilitator URL
https://api.cdp.coinbase.com/platform/v2/x402for verify and settle. - Register
bazaarResourceServerExtension(Node/Go/Python equivalents) and attachdeclareDiscoveryExtension()(or the language-specific helper) on routes you want discoverable. - Complete at least one successful settlement through CDP (after verify) so discovery can index the resource.
Route consolidation for high-cardinality path segments: Bazaar automatically normalizes route URLs where a path segment consists entirely of a recognized high-cardinality identifier — a UUID, Ethereum address, Ethereum transaction hash, Solana address, or Solana transaction hash. Those segments are replaced with a generic route template parameter, and all matching URLs are consolidated into a single Bazaar entry. For example,
/data/0xabc...def/report and /data/0x123...456/report would surface as one entry rather than two.To keep each resource as a distinct Bazaar entry, add a prefix or suffix to the path segment so it is not a bare identifier — for example, /user-<uuid> or /<uuid>-report instead of /<uuid>.Discovery extension options
ThedeclareDiscoveryExtension function accepts configuration for different HTTP methods:
Bazaar extension validation
For a route to be discoverable, the Bazaar extensioninput must pass strict JSON Schema validation against schema.properties.input in your declared extension (see the extension shape below).
The CDP Facilitator includes an EXTENSION-RESPONSES header on verify and settle responses so your resource server can tell whether Bazaar metadata was accepted. If validation fails, the resource server will see a rejected status for the Bazaar extension; otherwise you will typically see processing (discovery indexing is asynchronous, so this does not yet confirm the resource appears in search).
Buyer integration
Use the Quickstart for buyers for guides on installation, endpoint discovery, and paying with x402. Semantic search (GET …/v2/x402/discovery/search), filters, ranking, and example URLs are on this page under Semantic search. Paginated discovery returns items; search returns resources — the JSON shapes differ.
CDP discovery endpoints (HTTP)
This section documents the CDP Bazaar discovery endpoints (https://api.cdp.coinbase.com/.../v2/x402/discovery/...): paths, query parameters, and example payloads. The catalog (/discovery/resources) and semantic search (/discovery/search) routes are documented on this page only — there are no matching OpenAPI operation pages under the x402 Facilitator API Reference. The merchant discovery route does appear there as Get merchant resources by payTo address.
Auth: these
GET …/discovery/* routes are read-only catalog APIs and do not require CDP API keys. You still need CDP API keys on your resource server to run verify/settle through the CDP Facilitator (see Quickstart for sellers).CDP Facilitator discovery endpoint
Paginated catalog of x402-enabled HTTP resources. Results are returned in browse order (newest first). Use this endpoint when you want to page through the full index (items + pagination). For relevance-ranked results and filters, use semantic search instead.
The default
limit is 20 results per request, with a hard cap of 1000 per response. Use offset and limit to walk the catalog.Query parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by protocol type (e.g. "http"). |
limit | number | Page size (default 20 on CDP; maximum 1000 per request). |
offset | number | Pagination offset (default 0). |
Response body (200 OK)
Example `200` JSON (paginated catalog)
Example `200` JSON (paginated catalog)
items[] fields
| Field | Type | Required | Description |
|---|---|---|---|
resource | string | Yes | Monetized resource URL. |
type | string | Yes | Resource type (currently "http"). |
x402Version | number | Yes | x402 protocol version the resource supports. |
accepts | array | Yes | Accepted payment requirements for this resource. |
lastUpdated | string | Yes | ISO 8601 timestamp of the last catalog update for this entry. |
metadata | object | No | Optional description and Bazaar input/output metadata. |
CDP Bazaar: Semantic search
The CDP Facilitator exposes a dedicated endpoint for free-text and structured search over the same CDP-indexed catalog as the paginated resources route (results stay in sync). Result order blends search relevance with service quality; see Quality ranking. No API key is required. UnlikeGET .../discovery/resources, this endpoint is optimized for search
and filter, not for walking the full catalog: there is no cursor or offset
pagination. Refine your query and filters (and use limit, capped at 20) to
narrow results. The response includes partialResults when the matching set is
larger than your limit and the service truncates to fit.
Quality ranking
CDP orders semantic search results using two kinds of signal:-
Retrieval relevance — how well the service matches your
queryand filters, using the mode indicated bysearchMethodin the response (for example semanticvectorvs full-text retrieval over the same indexed text CDP stores for Bazaar). -
Service quality (objective signals) — a composite, facilitator-side score informed by observable CDP data, including:
- Buyer reach — how many distinct buyers the service has served (through the CDP Facilitator)
- Transaction volume — how many transactions (successful payments) the resource has processed
- Recency — how recently the service has been used
- Metadata quality — quality and completeness of Bazaar / discovery metadata (for example descriptions, input/output schemas, and examples)
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Free-text semantic search. Max 400 characters. If omitted, the call behaves like a filter-only listing (still subject to limit and ranking). |
network | string | No | CAIP-2 network id (e.g. eip155:8453). Legacy x402 v1 SDK names such as base and base-sepolia are also accepted. Max 200 characters. |
asset | string | No | Asset filter (e.g. usdc). Case-insensitive. Max 200 characters. |
scheme | string | No | Payment scheme filter (e.g. exact, upto). Max 200 characters. |
payTo | string | No | Filter by recipient address. Max 200 characters. |
maxUsdPrice | string | No | Maximum price in USD; must parse as a float. Max 200 characters. |
extensions | array of strings | No | Match resources that advertise a given x402 extension (e.g. custom). Repeat the query key for multiple values: ?extensions=custom&extensions=... |
limit | integer | No | Max results to return. Must be ≥ 1. Hard cap: 20. |
Response (200 OK)
Example `200` JSON (semantic search)
Example `200` JSON (semantic search)
Example query URLs
Example query URLs
| Field | Type | Description |
|---|---|---|
resources | array | Rows matching the query and filters, ordered by CDP using relevance + quality ranking. |
partialResults | boolean | true if additional matches existed but were truncated to satisfy limit. |
searchMethod | string | How CDP satisfied the query when applicable (e.g. semantic vector vs full-text). This reflects Bazaar-side configuration and fallbacks — it is not a request parameter. |
x402Version | number | Discovery payload version. |
resources includes the resource URL, type, x402Version,
optional description, lastUpdated, and accepts entries in the same payment
requirement shape as the paginated catalog.
Merchant discovery endpoint
Within CDP’s catalog, look up active resources for a given merchantpayTo address (EVM or Solana as documented).
Endpoint:
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
payTo | string | Yes | The merchant’s wallet address (EVM 0x-prefix or Solana base58) |
limit | integer | No | Number of resources to return (default: 25, max: 100) |
offset | integer | No | Number of resources to skip for pagination (default: 0) |
Response schema
Example `200` JSON (merchant)
Example `200` JSON (merchant)
404 if no active resources are found for the given address, and 400 if the payTo parameter is missing or invalid.
For OpenAPI schemas and status codes for this route, see Get merchant resources by payTo address in the x402 Facilitator section of the API Reference.
Bazaar MCP Server
The Bazaar exposes a Model Context Protocol (MCP) server that lets AI agents discover and call paid endpoints. On the client side, the@x402/mcp package wraps a standard MCP client with automatic payment handling — the agent never touches wallets or signing directly.
How the MCP server works
The Bazaar MCP server exposes two tools. The@x402/mcp client wraps callTool() with a payment loop so payment is transparent to the agent:
search_resources— Semantic search across the Bazaar index. Returns matching resource descriptions, pricing, input/output schemas, and relevance-ordered results.proxy_tool_call— Call a discovered resource by passing itstoolNameand arguments. Under the hood, the@x402/mcpclient sends the call to the Bazaar MCP server. If the server responds with a payment-required error, the client automatically creates a payment payload using the configured x402 client, attaches it to the MCP request’s_metafield, and retries the call. The server then verifies and settles the payment on-chain before forwarding the request to the resource server and returning the response.
callTool() invocation — the @x402/mcp client handles 402 detection, payment creation, and retry internally.
MCP Server endpoint
The MCP server endpoint for the CDP facilitator is:Client setup
@x402/mcp package for advanced configuration including custom payment hooks, dynamic pricing, and server-side setup.
Extension architecture
When you implement Bazaar for routes that settle through CDP, declare metadata using the x402 v2 extensions pattern:Example extension shape
Example extension shape
Key components
| Component | Purpose |
|---|---|
bazaarResourceServerExtension | Server extension that enriches declarations with HTTP method info |
declareDiscoveryExtension() | Helper to create properly structured extension declarations |
withBazaar() | Client wrapper that adds discovery query methods |
extractDiscoveryInfo() | Reference SDK helper that reads Bazaar metadata from payment payloads (what CDP indexes after successful settlement) |
Best practices
For sellers
- Provide clear examples: include realistic
output.examplevalues that demonstrate your API’s response format. - Document inputs: use
inputSchemawith descriptions to help clients understand required parameters. - Use appropriate types: specify correct JSON Schema types (
string,number,boolean,array,object). - Write semantic descriptions: natural-language descriptions (e.g.,
"Real-time weather conditions for any city") rank higher in semantic search than bare endpoint names like/weather. Include adescriptionfield in your route config or Bazaar extension metadata. - Validate against the Bazaar schema: ensure your extension
inputstrictly matchesschema.properties.input, and inspect theEXTENSION-RESPONSESheader on verify/settle (see Bazaar extension validation) if discovery is not picking up your route.
For buyers
- Cache discovery results: don’t query discovery on every request.
- Handle pagination: on
/discovery/resources, useoffsetandlimitfor large result sets. On the CDP/discovery/searchendpoint, there is no pagination—tightenqueryand filters instead of page-walking the catalog. - Validate compatibility: confirm each hit’s
acceptsentries match the wallet and networks you use with CDP (see Network Support). - Prefer search for CDP discovery at scale: use
/v2/x402/discovery/searchwhen you need relevance, filters, or quality-ranked results; use/discovery/resourceswhen you need a traditional paginated inventory.
Support
- GitHub: github.com/x402-foundation/x402
- Discord: Join #x402 channel
- Documentation: x402 Overview
FAQ
How do I get listed in the Bazaar, and when does my service show up?
Register thebazaarResourceServerExtension, include declareDiscoveryExtension() in your route configuration, and complete a payment through the CDP Facilitator so that CDP settles at least once for that URL (verify + settle is the normal flow). There is no separate registration step: the first successful settlement for a Bazaar-enabled route is when CDP catalogs it.
Can I opt out of discovery?
Yes; omit the Bazaar extension from a route’s configuration. Only routes that declare Bazaar metadata can appear in CDP discovery.What networks are supported?
CDP discovery surfaces whatever networks your indexed resources advertise inaccepts. For which chains the CDP Facilitator can verify and settle on, see Network Support.
How often is the discovery catalog updated?
CDP updates catalog entries as it processes new settle traffic for Bazaar-enabled routes.Is there a test Bazaar for development?
Yes. Use the CDP Facilitator on Base Sepolia or Solana Devnet with CDP API keys—the same…/v2/x402/discovery/... endpoints will surface services once verify/settle has run through CDP (see Network Support). If you need a no-signup testnet facilitator, the x402.org facilitator exposes its own separate catalog at https://x402.org/facilitator/discovery/resources; that index is not the CDP Bazaar.