{
  "openapi": "3.1.0",
  "info": {
    "title": "Bazaar Pulse",
    "version": "1.0.0",
    "summary": "The check before the spend: grade an x402 resource before paying it.",
    "description": "Bazaar Pulse: one pre-spend check on an x402 resource. Returns the PayAI Bazaar catalog listing and its payment terms, a live unpaid probe of the resource (HTTP status plus whether the body or PAYMENT-REQUIRED header is a parseable x402 payment envelope), the facilitator's settlement record (24h/7d/30d, unique buyers, reliability, uptime), a squat signal reporting how many catalog entries that host holds and how many of a sampled subset have settled, and a verdict: live_and_settling, live_but_no_buyers, listed_but_dead, or not_listed. Every upstream URL and its HTTP status is returned so the answer can be audited; a failed upstream is reported as an error field, never guessed. Settlement figures are the facilitator's own bucketed values, reproduced verbatim. Catalog listing data is served from an index rebuilt on a schedule, and its build time and age are included in every response. Informational only. Not financial advice, not an endorsement of any seller, and not a guarantee that any resource will honour a payment."
  },
  "servers": [
    {
      "url": "https://pulse.premiumrewards.vip"
    }
  ],
  "paths": {
    "/check": {
      "get": {
        "operationId": "check",
        "summary": "Grade one x402 resource (or a whole host) before paying it",
        "description": "Requires an x402 payment of 5000 atomic USDC ($0.005) on eip155:8453. An unpaid request returns HTTP 402 with the x402 v2 payment envelope in the body and in the base64url PAYMENT-REQUIRED header.",
        "parameters": [
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "URL-encoded x402 resource URL. Required unless host is given.",
            "example": "https://402signal.com/route"
          },
          {
            "name": "host",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Hostname to grade instead of a single resource.",
            "example": "orbisapi.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Grade computed from catalog listing, live unpaid probe and settlement record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "resource",
                        "host"
                      ]
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "live_and_settling",
                        "live_but_no_buyers",
                        "listed_but_dead",
                        "not_listed",
                        "unknown"
                      ]
                    },
                    "verdict_reason": {
                      "type": "string"
                    },
                    "listing": {
                      "type": "object"
                    },
                    "probe": {
                      "type": "object"
                    },
                    "settlement": {
                      "type": "object"
                    },
                    "terms_match": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "squat_signal": {
                      "type": "object"
                    },
                    "inputs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Neither resource nor host supplied, or the value is not a usable URL/hostname.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is the x402 v2 payment envelope.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64url of the JSON envelope",
                "schema": {
                  "type": "string"
                }
              },
              "X-PAYMENT-REQUIRED": {
                "description": "same value, legacy header name",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "const": 2
                    },
                    "error": {
                      "type": "string"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "scheme": {
                            "type": "string",
                            "const": "exact"
                          },
                          "network": {
                            "type": "string",
                            "const": "eip155:8453"
                          },
                          "amount": {
                            "type": "string",
                            "const": "5000"
                          },
                          "asset": {
                            "type": "string",
                            "const": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                          },
                          "payTo": {
                            "type": "string",
                            "const": "0x6cd6B2a3a8926CE9B6F58CB6369C1AF4cB54c1D7"
                          },
                          "maxTimeoutSeconds": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Payment verification could not be completed upstream.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "operationId": "landing",
        "summary": "Free landing page",
        "responses": {
          "200": {
            "description": "text/html"
          }
        }
      }
    },
    "/sample": {
      "get": {
        "operationId": "sample",
        "summary": "Free worked example, fixed to one resource",
        "description": "Runs the same pipeline as /check against a single hardcoded resource (https://402signal.com/route). Query parameters are ignored. Free.",
        "responses": {
          "200": {
            "description": "application/json, same shape as /check"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "llms",
        "summary": "Free agent guide",
        "responses": {
          "200": {
            "description": "text/plain"
          }
        }
      }
    },
    "/pricing": {
      "get": {
        "operationId": "pricing",
        "summary": "Free price and terms",
        "responses": {
          "200": {
            "description": "application/json"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "openapi",
        "summary": "This document",
        "responses": {
          "200": {
            "description": "application/json"
          }
        }
      }
    },
    "/.well-known/x402": {
      "get": {
        "operationId": "x402Discovery",
        "summary": "Canonical x402 v2 payment requirements for the paid resource",
        "responses": {
          "200": {
            "description": "application/json using the same envelope shape as an unpaid /check request"
          }
        }
      }
    }
  },
  "x-x402": {
    "version": 2,
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "5000",
    "displayAmount": "$0.005",
    "payTo": "0x6cd6B2a3a8926CE9B6F58CB6369C1AF4cB54c1D7",
    "facilitator": "https://facilitator.payai.network"
  }
}
