{
  "protocol": "otis-402/1",
  "name": "Otis",
  "description": "Micropayment rail for AI agents. Sub-cent USD payments over HTTP 402.",
  "currency": "USD",
  "unit": "micro-usd",
  "micro_per_usd": 1000000,
  "api_base": "https://smykuikmvldfozhxmynd.supabase.co/functions/v1",
  "endpoints": {
    "register_agent": {
      "method": "POST",
      "path": "/agent-register",
      "auth": "none",
      "body": { "name": "string", "operator_email": "string?" },
      "returns": "agent_key (oa_live_…, shown once)"
    },
    "wallet": {
      "method": "GET",
      "path": "/agent-wallet",
      "auth": "Authorization: Bearer <agent_key>"
    },
    "fund_wallet": {
      "method": "POST",
      "path": "/agent-wallet",
      "auth": "Authorization: Bearer <agent_key>",
      "body": { "action": "faucet | topup", "amount_usd": "number (topup only)" }
    },
    "pay": {
      "method": "POST",
      "path": "/x402-pay",
      "auth": "Authorization: Bearer <agent_key>",
      "body": { "site": "site_…", "path": "/…", "method": "GET" },
      "returns": "signed receipt token; retry the resource with header X-Otis-Token"
    },
    "verify": {
      "method": "POST",
      "path": "/x402-verify",
      "auth": "none",
      "body": { "site": "site_…", "token": "ort_…", "path": "/…?", "method": "GET?" }
    },
    "demo": {
      "method": "GET",
      "path": "/demo-gate?site=site_demo_playground&path=/premium/market-report",
      "auth": "none (402) or X-Otis-Token header (200)"
    }
  },
  "challenge_schema": {
    "protocol": "otis-402/1",
    "site": "site key of the merchant",
    "path": "requested path",
    "method": "HTTP method",
    "accepts": [
      {
        "rail": "otis-wallet",
        "currency": "USD",
        "price_micro": "integer micro-USD",
        "pay_url": "where to POST payment"
      }
    ]
  },
  "receipt_token": {
    "format": "ort_<base64url payload>.<base64url HMAC-SHA256 signature>",
    "ttl_seconds": 300,
    "verification": "HMAC with the site signing secret, offline, or POST /x402-verify"
  },
  "fees": { "platform_bps": 250, "monthly": 0, "minimum_volume": 0 },
  "docs": "/docs",
  "llms_txt": "/llms.txt"
}
