{
 "openapi": "3.1.0",
 "info": {
  "title": "autonomous-audit",
  "version": "1.0.0",
  "description": "Pay-per-call Solidity smart-contract security audits, settled in USDC on Base over x402 v2. No account, no API key: POST Solidity source, pay the 402 challenge, get JSON findings.",
  "x-guidance": "Call POST on a path, receive HTTP 402 with an x402 v2 challenge in the PAYMENT-REQUIRED header (and body), sign an EIP-3009 exact USDC transfer for the requested amount to payTo on eip155:8453, retry with the PAYMENT-SIGNATURE header. Settlement is done by https://facilitator.payai.network.",
  "contact": {
   "name": "Shroud Audit",
   "email": "shroud94133084@fldubai.com",
   "url": "https://audit-402.agras-recovery.workers.dev"
  },
  "license": {
   "name": "MIT"
  }
 },
 "servers": [
  {
   "url": "https://audit-402.agras-recovery.workers.dev"
  }
 ],
 "tags": [
  {
   "name": "audit"
  },
  {
   "name": "solidity"
  },
  {
   "name": "security"
  }
 ],
 "x-discovery": {
  "ownershipProofs": [
   "0x9a033397ffD48BB186C2a7b77aB550B26ee90c35"
  ]
 },
 "paths": {
  "/api/audit/surface": {
   "post": {
    "operationId": "api_audit_surface",
    "summary": "Static surface scan of one Solidity contract",
    "description": "Static surface scan of one Solidity contract: exposed state-changing functions, access-control modifiers, external calls, upgradeability, and a machine-readable risk list. Returns JSON.",
    "tags": [
     "smart-contract",
     "audit",
     "solidity",
     "security"
    ],
    "security": [],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "1.00"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "source"
        ],
        "properties": {
         "source": {
          "type": "string",
          "description": "Full Solidity source text of the single contract to audit."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Audit result (JSON): findings with id/sev/msg, 0-100 score, stats.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required — x402 v2 exact scheme, USDC on Base (eip155:8453).",
      "headers": {
       "payment-required": {
        "schema": {
         "type": "string"
        },
        "description": "base64url JSON of the x402 v2 challenge"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/audit/full": {
   "post": {
    "operationId": "api_audit_full",
    "summary": "Full automated audit of one Solidity contract",
    "description": "Full automated audit of one Solidity contract: surface scan plus reentrancy / access-control / arithmetic / oracle patterns, severity ranking, and a patch suggestion per finding. Returns JSON.",
    "tags": [
     "smart-contract",
     "audit",
     "solidity",
     "security",
     "reentrancy"
    ],
    "security": [],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "3.00"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "source"
        ],
        "properties": {
         "source": {
          "type": "string",
          "description": "Full Solidity source text of the single contract to audit."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Audit result (JSON): findings with id/sev/msg, 0-100 score, stats.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required — x402 v2 exact scheme, USDC on Base (eip155:8453).",
      "headers": {
       "payment-required": {
        "schema": {
         "type": "string"
        },
        "description": "base64url JSON of the x402 v2 challenge"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "x402": {
    "type": "apiKey",
    "in": "header",
    "name": "PAYMENT-SIGNATURE",
    "description": "x402 v2 payment payload (base64url JSON)."
   }
  }
 }
}