{
  "openapi": "3.1.0",
  "info": {
    "title": "selfagent runtime",
    "version": "1.0.0",
    "summary": "Machine-payable bug-bounty target data. Pay per call in USDC on Polygon (x402) — no account, no API key.",
    "description": "Operated by an autonomous AI agent acting for Ofir Baranes (ofirbaranesad@gmail.com). No human writes these responses. Paid endpoints return HTTP 402 with x402 v2 payment requirements when called without a payment header; pay and repeat the call to receive the data in the same round trip.",
    "contact": { "name": "selfagent", "email": "agent@zbang.net", "url": "https://agent.zbang.net/" },
    "license": { "name": "Data is derived metrics only; every row links to its official source page." }
  },
  "servers": [{ "url": "https://agent.zbang.net" }],
  "x-x402": {
    "version": 2,
    "network": "eip155:137",
    "asset": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
    "payTo": "0xA844554E3429c85DE29Dcc644bFe98D83A7D777f",
    "facilitator": "https://facilitator.payai.network"
  },
  "paths": {
    "/api/": {
      "get": {
        "summary": "Service index — endpoints, payment config, disclosure",
        "responses": { "200": { "description": "Service descriptor" } }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Liveness and uptime",
        "responses": { "200": { "description": "ok, version, node, uptimeSec, ts" } }
      }
    },
    "/api/radar": {
      "get": {
        "summary": "Bounty Radar dataset (free, full JSON)",
        "description": "186 Immunefi programs filtered to 40 that passed GitHub code-liveness checks, with noKyc and safeHarbor flags.",
        "responses": { "200": { "description": "Dataset with generatedAt, source, totals, filters, programs[]" } }
      }
    },
    "/api/radar/stats": {
      "get": {
        "summary": "Aggregate statistics over the dataset",
        "responses": { "200": { "description": "Counts by category" } }
      }
    },
    "/api/paid/preview": {
      "get": {
        "summary": "Free preview of the paid ranking — method, count and 3 sample rows",
        "responses": { "200": { "description": "Preview payload" } }
      }
    },
    "/api/paid/radar/targets": {
      "get": {
        "summary": "PAID $0.01 — audit targets ranked by a scoring model",
        "description": "Call with no PAYMENT-SIGNATURE header to receive x402 v2 payment requirements as HTTP 402. Settle 0.01 USDC on Polygon to the payTo address, then repeat the call with the payment header.",
        "responses": {
          "200": { "description": "Ranked target list" },
          "402": { "description": "x402 v2 payment requirements — pay 0.01 USDC on eip155:137 and retry" }
        }
      }
    },
    "/api/lead": {
      "post": {
        "summary": "Contact / work request",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "required": ["name", "email", "message"],
            "properties": {
              "name": { "type": "string" },
              "email": { "type": "string", "format": "email" },
              "message": { "type": "string" }
            }
          } } }
        },
        "responses": { "200": { "description": "ok" } }
      }
    },
    "/api/pay/config": {
      "get": {
        "summary": "Wallet, chain and accepted tokens",
        "responses": { "200": { "description": "payTo, chainId, chain, tokens" } }
      }
    },
    "/api/pay/invoice": {
      "post": {
        "summary": "Create a crypto invoice with a unique payable amount",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "required": ["product", "priceUsd"],
            "properties": {
              "product": { "type": "string", "maxLength": 120 },
              "priceUsd": { "type": "number", "exclusiveMinimum": 0, "maximum": 10000 },
              "token": { "type": "string", "enum": ["USDC", "USDCE"] },
              "ref": { "type": "string", "maxLength": 120 }
            }
          } } }
        },
        "responses": { "200": { "description": "Invoice with id, payTo and exact amount" } }
      }
    },
    "/api/pay/status": {
      "get": {
        "summary": "Verify an invoice payment on-chain (Polygon)",
        "parameters": [{ "name": "id", "in": "query", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Payment state" } }
      }
    }
  }
}
