{
  "openapi": "3.1.0",
  "info": {
    "title": "Briefbar",
    "version": "0.1.0",
    "description": "x402 information desk. Free to discover. Briefs are paid per GET. This deployment uses a demo facilitator."
  },
  "servers": [
    {
      "url": "https://www.briefbar.dev"
    }
  ],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Free SKU catalog",
        "description": "Discovery is unpaid. Use this before calling a brief. Paid routes answer HTTP 402 until PAYMENT-SIGNATURE is present.",
        "responses": {
          "200": {
            "description": "Catalog of priced briefs"
          }
        }
      }
    },
    "/api/demo/receipt": {
      "post": {
        "operationId": "issueDemoReceipt",
        "summary": "Issue a demo PAYMENT-SIGNATURE",
        "description": "Local facilitator. Does not move USDC. Body: { sku, resourceUrl? }.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sku"
                ],
                "properties": {
                  "sku": {
                    "type": "string",
                    "enum": [
                      "entity",
                      "news",
                      "weather",
                      "protocol",
                      "fx",
                      "npm-package",
                      "rfc"
                    ]
                  },
                  "resourceUrl": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Demo payment payload and header"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Process health",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/v1/briefs/entity": {
      "get": {
        "operationId": "getBrief_entity",
        "summary": "Entity brief",
        "description": "Resolves a name to a compact entity card: summary, type, key sentences, and a Wikipedia citation. Built for agents that need a grounded fact pack before they answer a human. Price $0.002 USDC (2000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "ethereum"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/news": {
      "get": {
        "operationId": "getBrief_news",
        "summary": "News brief",
        "description": "A short, timestamped packet of recent Hacker News stories for a query, with titles, points, URLs, and a one-line desk note. Freshness is the product. Price $0.005 USDC (5000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "x402"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/weather": {
      "get": {
        "operationId": "getBrief_weather",
        "summary": "Weather now",
        "description": "Geocodes a city and returns current temperature, wind, and weather code from Open-Meteo. Commodity data, commodity price. Price $0.001 USDC (1000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Austin"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/protocol": {
      "get": {
        "operationId": "getBrief_protocol",
        "summary": "Protocol brief",
        "description": "Machine-readable essays we wrote: what x402 is, what to sell, how to price, how a facilitator works. The human versions live on /protocol. This SKU is the same thinking, cut for an agent context window. Price $0.01 USDC (10000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "what-to-sell"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/fx": {
      "get": {
        "operationId": "getBrief_fx",
        "summary": "FX print",
        "description": "Returns the latest Frankfurter/ECB reference rate for a currency pair (USD-EUR). Commodity FX for agents that need a number, not a terminal. Price $0.001 USDC (1000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "USD-EUR"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/npm-package": {
      "get": {
        "operationId": "getBrief_npm-package",
        "summary": "npm package card",
        "description": "Returns name, latest version, license, description, homepage, and modified timestamp for an npm package. Stable schema for agents that resolve libraries. Price $0.002 USDC (2000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "lodash"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/v1/briefs/rfc": {
      "get": {
        "operationId": "getBrief_rfc",
        "summary": "RFC card",
        "description": "Returns RFC number, title, status, abstract, page count, authors, and canonical URL. Structured metadata for agents that cite RFCs. Price $0.005 USDC (5000 atomic). Unpaid requests return 402 with PAYMENT-REQUIRED.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "8446"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Base64 x402 PaymentPayload. Absent → 402."
          }
        ],
        "responses": {
          "200": {
            "description": "Settled brief JSON"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "x402"
    },
    {
      "name": "briefs"
    }
  ]
}