AI API

AI-powered smart contract analysis endpoint. Requires a Pro-tier API key.

Review Contract

POST /api/ai/review

Analyzes a Solidity source file for security issues. Used by w3m audit --ai.

Request Body:

{
  "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n...",
  "filename": "MyToken.sol"
}

Response:

{
  "issues": [
    {
      "severity": "warning",
      "description": "Unbounded loop in distribute() could cause out-of-gas",
      "suggestion": "Consider using a pull-based distribution pattern"
    }
  ],
  "summary": "1 warning found. No critical issues detected."
}
⚠️

The review endpoint returns 403 for accounts without a Pro plan.