{
  "openapi": "3.0.3",
  "info": {
    "title": "The Marketplace directory — bitcoineconomy.ai",
    "description": "Read-only discovery API for Bitcoin-payable services and tools an autonomous AI agent can consume: inference, compute, machine work, verification, commerce bridges, swaps, liquidity, and fiat ramps. Fetch the registry and filter locally — no auth, and no funds move through this API; the agent pays each provider directly over Lightning / L402 / Cashu. MCP-capable agents should use the richer Model Context Protocol server at https://marketplace.bitcoineconomy.ai/mcp instead (find_service, get_service, get_quote, find_tool, get_tool, list_mcp_servers).",
    "version": "1.0.0",
    "contact": {
      "email": "hello@bitcoineconomy.ai",
      "url": "https://bitcoineconomy.ai"
    }
  },
  "servers": [
    {
      "url": "https://marketplace.bitcoineconomy.ai"
    }
  ],
  "paths": {
    "/directory.json": {
      "get": {
        "operationId": "getDirectory",
        "summary": "The curated registry of Bitcoin-payable services an agent buys",
        "description": "The full curated registry (21 entries across 9 categories: inference, compute, machine-work, verification, commerce, privacy, swap, liquidity, fiat-ramp). Each entry carries category, what_an_agent_buys, payment_methods, automatability (api-no-account | api-account | api-kyc), kyc, auth, api_base, pricing_url, quickstart, and mcp_endpoint where the provider runs its own MCP server. One fetch returns everything; filter locally.",
        "responses": {
          "200": {
            "description": "The curated registry document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/tools.json": {
      "get": {
        "operationId": "getToolCatalog",
        "summary": "The tool catalog — what an agent installs/runs to transact",
        "description": "The 27-tool catalog of equipment an agent EQUIPS (vs the registry of what it BUYS): wallets & treasuries, node toolkits, ecash software, bridges & swaps, and the protocol primitives (L402, NWC, BOLT12, LNURL, MCP). Each tool carries toolbox_group, tool_type, layer, prereq_tier, and links.",
        "responses": {
          "200": {
            "description": "The tool catalog document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/live/snapshot.json": {
      "get": {
        "operationId": "getLiveSnapshot",
        "summary": "Live Nostr-announced inventory (Routstr providers, ecash mints)",
        "description": "What announces itself on Nostr right now: Routstr kind-38421 inference providers, NIP-87 ecash mints, kind-38000 reviews. Each provider carries a probe status (alive | unreachable | unverified-tor-only | unroutable — filter status === \"alive\" unless you can reach Tor), latency_ms, model_count, and accepted mints. KV-backed, refreshed every 6h; static fallback at /snapshot.json.",
        "responses": {
          "200": {
            "description": "The live snapshot document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/live/models.json": {
      "get": {
        "operationId": "getPriceIndex",
        "summary": "Cross-provider inference price index (cheapest provider per model)",
        "description": "model id -> every alive provider serving it, cheapest first, in sats per token (+ max_cost per request, the budgeting ceiling). One fetch answers \"who serves model X cheapest right now\". Static fallback at /models.json.",
        "responses": {
          "200": {
            "description": "The price index document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/live/l402index.json": {
      "get": {
        "operationId": "getWiderL402Index",
        "summary": "Wider L402 tier — a selective, attributed pass over 402index.io's verified-L402 feed",
        "description": "Real Lightning-payable (L402) endpoints beyond the curated registry, taken selectively from 402index.io (Ryan Gentry) — health-filtered, reliability-capped, each with a source_page back to its 402index record. provenance: external-index (third-party-indexed + verified, NOT a bitcoineconomy.ai endorsement). KV-backed, refreshed every 6h; static fallback at /l402index.json.",
        "responses": {
          "200": {
            "description": "The Wider L402 index document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/live/uptime.json": {
      "get": {
        "operationId": "getUptimeHistory",
        "summary": "Rolling uptime history for every probed target — recomputable, self-inclusive, Bitcoin-anchored",
        "description": "Per-target rolling uptime over the 6-hourly probe cron, including the marketplace's own surfaces (self:* rows). Recomputable, not a score: carries the raw per-run observations (runs[]), the exact formula, and explicit denominators (unprobeable observations are excluded and counted separately). Nightly anchor runs sign snapshot digests to Nostr and stamp them into Bitcoin via OpenTimestamps (records at /anchors/), making the history tamper-evident. KV-backed; static placeholder at /uptime.json until the first cron.",
        "responses": {
          "200": {
            "description": "The uptime history document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/entries/{slug}.md": {
      "get": {
        "operationId": "getEntry",
        "summary": "One clean Markdown record for a single service",
        "description": "The agent-readable Markdown route for one registry entry — the machine path (payment, auth, api_base, quickstart, mcp_endpoint) plus a link to the full verified card.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The service slug (from directory.json entries[].slug).",
            "schema": {
              "type": "string",
              "enum": [
                "routstr",
                "ppq-ai",
                "maple",
                "lnvps",
                "bitlaunch",
                "openagents",
                "invinoveritas",
                "unhuman",
                "bitrefill",
                "mullvad",
                "boltz",
                "sideshift",
                "flashnet",
                "sideswap",
                "loop",
                "amboss",
                "rails",
                "strike",
                "river",
                "kraken",
                "coinbase"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entry as Markdown.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
