Overview
The Bazaar solves a critical problem in the x402 ecosystem: discoverability. Without it, x402-compatible endpoints and MCP tools are like hidden stalls in a vast market. The Bazaar provides:- For Buyers (API Consumers): Programmatically discover available x402-enabled services (HTTP endpoints and MCP tools), understand their capabilities, pricing, and schemas
- For Sellers (API Providers): Automatic visibility for your x402-enabled services to a global audience of developers and AI agents
- For AI Agents: Dynamic service discovery without pre-baked integrations - query, find, pay, and use
How It Works
Facilitators that support the Bazaar extension may provide a/discovery/resources endpoint that returns all x402-compatible services registered through the respective facilitator. Services (HTTP endpoints and MCP tools) are discoverable when they include the bazaar extension in their route configuration.
Note: The spec for marketplace items is open and part of the x402 scheme, meaning any facilitator can implement their own discovery layer.
Basic Flow
- Discovery: Clients query the
/discovery/resourcesendpoint to find available services - Selection: Choose a service based on price, capabilities, and requirements
- Execution: Use x402 to pay for and access the selected service
- No Manual Setup: No API keys, no account creation, just discover and pay
API Reference
List Endpoint
Retrieve all available x402-compatible endpoints and MCP tools:Coinbase
PayAI
useFacilitator hook as described below.
Response Schema
Each resource in the list contains the following fields:
type field indicates the resource type:
"http"- HTTP endpoints (GET, POST, PUT, PATCH, DELETE, HEAD)"mcp"- MCP (Model Context Protocol) tools
outputSchema.input object will contain:
type: "mcp"- Identifies this as an MCP tooltool- The MCP tool name (used intools/callrequests)inputSchema- JSON Schema for the tool’s arguments (follows MCPTool.inputSchemaformat)description- Human-readable description of the tool (optional)transport- MCP transport protocol:"streamable-http"(default) or"sse"(optional)example- Example arguments object (optional)
resource, input.tool) since MCP multiplexes multiple tools over a single server endpoint.
Quickstart for Buyers
Step 1: Discover Available Services
Fetch the list of available x402 services using the facilitator client:- TypeScript
- Go
- Python
Step 2: Call a Discovered Service
Once you’ve found a suitable service, use an x402 client to call it:- TypeScript
- Python
Quickstart for Sellers
Listing with Bazaar Extension
Add the bazaar extension to your route configuration to make your API or MCP tools discoverable. Supported Resource Types:- HTTP Endpoints - Standard REST APIs (GET, POST, PUT, PATCH, DELETE, HEAD)
- MCP Tools - Model Context Protocol tools for AI agent integration
Adding Metadata
To enhance your listing with descriptions and schemas, include them when setting up your x402 middleware. You should include descriptions for each parameter to make it clear for agents to call your endpoints:- TypeScript
- Python
- Go
Coming Soon
The x402 Bazaar is rapidly evolving, and your feedback helps us prioritize features.Support
- GitHub: github.com/coinbase/x402
- Discord: Join #x402 channel
FAQ
Q: How do I get my service listed? A: Add the bazaar extension to your route configuration. See the examples above. Q: How can I make endpoint calls more accurate? A: Include descriptions clearly stating what each parameter does and how to call your endpoint, but do so as succinctly as possible. Q: How does pricing work? A: Listing is free. Services set their own prices per API call, paid via x402. Q: What networks are supported? A: Currently Base (eip155:8453), Base Sepolia (eip155:84532), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), and Solana Devnet (solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1) with USDC payments.
Q: Can I list non-x402 services?
A: No, only x402-compatible endpoints can be listed. See our Quickstart for Sellers to make your API x402-compatible.
Q: What are MCP tools and how do they work with Bazaar?
A: MCP (Model Context Protocol) tools are AI-agent-friendly interfaces that can be discovered and paid for through x402. When listing an MCP tool, include type: "mcp" in the bazaar extension along with the tool name and input schema. The unique identifier for MCP tools is the combination of the resource URL and tool name, since multiple tools can be served from a single MCP endpoint.