{
  "openapi": "3.0.1",
  "info": {
    "title": "NyaSec Autonomous Web3 Micro-API Suite",
    "description": "x402 Pay-Per-Call Web3 & Security APIs on Base L2",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://nyasec.xyz"
    }
  ],
  "paths": {
    "/api/v1/hash-verify": {
      "post": {
        "summary": "Keccak256 & Multi-Hash Verifier",
        "description": "Hashes input string with Keccak256, SHA256, SHA512, MD5",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": { "type": "string" },
                  "algorithm": { "type": "string", "example": "keccak256" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Hash result" },
          "402": { "description": "x402 Payment required (0.001 USDC)" }
        }
      }
    },
    "/api/v1/abi-decode": {
      "post": {
        "summary": "Ethereum ABI Calldata Decoder",
        "description": "Decodes raw EVM calldata against specified parameter types",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "calldata": { "type": "string" },
                  "types": { "type": "array", "items": { "type": "string" } }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Decoded parameters" },
          "402": { "description": "x402 Payment required" }
        }
      }
    },
    "/api/v1/eth-units": {
      "post": {
        "summary": "Ethereum Unit Transformer",
        "description": "Converts values between wei, gwei, ether, and USDC",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": { "type": "string" },
                  "from": { "type": "string" },
                  "to": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Converted result" }
        }
      }
    },
    "/api/v1/smart-contract-audit": {
      "post": {
        "summary": "Solidity Smart Contract Security Inspector",
        "description": "Analyzes Solidity source code for SWC security vulnerabilities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sourceCode": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Security audit report" }
        }
      }
    },
    "/api/v1/ai-roast": {
      "post": {
        "summary": "Constructive AI Code & Site Roast",
        "description": "Generates brutal yet insightful technical roasts and actionable fixes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "codeOrUrl": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Roast output" }
        }
      }
    },
    "/api/v1/bounty-feed": {
      "post": {
        "summary": "Live AI Bounty Intelligence Feed",
        "description": "Returns winnable open bounties scored by probability",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "minRewardUsdc": { "type": "number" },
                  "maxSubmissions": { "type": "number" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Bounty feed array" }
        }
      }
    }
  }
}
