{
  "openapi": "3.1.0",
  "info": {
    "title": "Wallet Quantum Exposure Check by Agentropolis",
    "version": "0.1.0",
    "summary": "Is a Bitcoin or Ethereum/Base address's public key already on-chain, and how much sits behind it? Exposure only.",
    "description": "$0.05 USDC per call via x402 on Base. $0.05 USDC per call on Base mainnet. Deterministic, no LLM. Exposure check only, not financial advice; no current machine can break secp256k1.",
    "contact": {
      "email": "hello@agentropolis.io"
    },
    "x-guidance": "POST /api/exposure with {address}. Branch on risk_tier and public_key_revealed. risk_tier: none | low (key hidden) | moderate (key revealed, empty) | high (revealed + balance) | critical (revealed + >=1 BTC/10 ETH) | unknown (could not establish)."
  },
  "servers": [
    {
      "url": "https://agentropolis-quantum-exposure.vercel.app"
    }
  ],
  "paths": {
    "/api/exposure": {
      "post": {
        "operationId": "checkWalletQuantumExposure",
        "summary": "Check whether an address's public key is exposed on-chain",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.05"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "rails": [
            {
              "protocol": "x402",
              "version": 2,
              "scheme": "exact",
              "network": "eip155:8453",
              "networkName": "Base mainnet",
              "asset": "USDC",
              "assetAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "50000",
              "priceUsd": "0.05",
              "payTo": "0xeE6239F3E17bEBe5e89F21F29D74D68CAa0d78CE",
              "facilitator": "Coinbase CDP (gas sponsored; payer needs no ETH)",
              "header": "PAYMENT-SIGNATURE"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExposureRequest"
              },
              "example": {
                "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exposure result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposureResult"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required"
          },
          "422": {
            "description": "Invalid address (not charged)"
          },
          "503": {
            "description": "Public explorers/RPCs unavailable (not charged)"
          }
        }
      },
      "get": {
        "operationId": "checkWalletQuantumExposureGet",
        "summary": "Same check via query string",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.05"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "rails": [
            {
              "protocol": "x402",
              "version": 2,
              "scheme": "exact",
              "network": "eip155:8453",
              "networkName": "Base mainnet",
              "asset": "USDC",
              "assetAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "50000",
              "priceUsd": "0.05",
              "payTo": "0xeE6239F3E17bEBe5e89F21F29D74D68CAa0d78CE",
              "facilitator": "Coinbase CDP (gas sponsored; payer needs no ETH)",
              "header": "PAYMENT-SIGNATURE"
            }
          ]
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exposure result"
          },
          "402": {
            "description": "x402 payment required"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ExposureRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Bitcoin mainnet address (1…, 3…, bc1q…, bc1p…) or EVM address (0x…)."
          }
        },
        "required": [
          "address"
        ],
        "additionalProperties": false
      },
      "ExposureResult": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "enum": [
              "bitcoin",
              "evm"
            ]
          },
          "address_type": {
            "type": "string",
            "enum": [
              "P2PK",
              "P2PKH",
              "P2SH",
              "P2WPKH",
              "P2WSH",
              "P2TR",
              "EOA",
              "CONTRACT"
            ]
          },
          "public_key_revealed": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "confirmed",
              "probable",
              "unknown"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          },
          "balance": {
            "type": "object"
          },
          "risk_tier": {
            "type": "string",
            "enum": [
              "none",
              "low",
              "moderate",
              "high",
              "critical",
              "unknown"
            ]
          },
          "risk_reason": {
            "type": "string"
          },
          "quantum_note": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "coverage": {
            "type": "object"
          }
        },
        "required": [
          "address",
          "address_type",
          "public_key_revealed",
          "evidence",
          "balance",
          "risk_tier",
          "disclaimer"
        ]
      }
    }
  }
}