agentgrade

← Knowledge Base

What is Bazaar?

Bazaar is the discovery layer for x402. It answers: "What can I buy here, and how much does it cost?" Agents browse a structured catalog of services, prices, and input/output schemas at /.well-known/x402.json.

How it works

Publish /.well-known/x402.json:

{
  "x402Version": 2,
  "name": "Your Service",
  "description": "What your service does",
  "network": "base",
  "facilitator": "coinbase",
  "payTo": "0xYourWallet",
  "services": [
    {
      "method": "POST",
      "path": "/api/generate",
      "description": "Generate content",
      "amount": "100000",
      "discoverable": true,
      "outputSchema": {
        "input": {
          "type": "http",
          "method": "POST",
          "bodyFields": {
            "prompt": { "type": "string", "required": true }
          }
        },
        "output": {
          "result": { "type": "string" }
        }
      }
    }
  ],
  "freeEndpoints": [
    { "method": "GET", "path": "/api/status", "description": "Health check (free)" }
  ]
}

Key fields

402 header extensions

For full Bazaar support, also include extensions.bazaar in your 402 response header:

{
  "x402Version": 2,
  "accepts": [...],
  "extensions": {
    "bazaar": { "discoverable": true }
  }
}

Spec maturity

Part of x402 v2. Bazaar discovery is defined within the x402 specification.

Learn more