{
  "version": "0.1.0",
  "name": "DrainBrain API",
  "description": "ML-powered Solana token rug pull detection. 5-model ensemble, 175K+ tokens trained. Risk scoring, honeypot detection, temporal analysis.",
  "url": "https://rugslayer.com",
  "documentation_url": "https://rugslayer.com/drainbrain",
  "authentication": {
    "type": "bearer",
    "instructions": "Get a free API key at https://rugslayer.com/drainbrain#keys or POST to /api/drainbrain/v1/keys with {name, email}"
  },
  "flows": [
    {
      "id": "scan-token",
      "name": "Scan Token for Rug Risk",
      "description": "Check if a Solana token is safe before buying. Returns a risk score 0-100, risk level, and rug detection.",
      "steps": [
        {
          "action": "POST /api/drainbrain/v1/scan",
          "input": {
            "mint": "string (Solana token mint address, base58, 32-44 chars)"
          },
          "output": {
            "score": "number 0-100 (higher = more risky)",
            "riskLevel": "LOW | MEDIUM | HIGH | CRITICAL",
            "isRug": "boolean (true if score >= 70)",
            "rugStage": "number 0-5 (Pro/PAYG only)",
            "honeypot": "object {isHoneypot, reason} (Pro/PAYG only)"
          }
        }
      ]
    },
    {
      "id": "batch-scan",
      "name": "Batch Scan Tokens",
      "description": "Scan up to 10 Solana tokens in parallel for rug pull risk. Requires Pro or PAYG tier.",
      "steps": [
        {
          "action": "POST /api/drainbrain/v1/scan/batch",
          "input": {
            "mints": "array of strings (1-10 Solana mint addresses)"
          },
          "output": {
            "results": "array of scan results",
            "errors": "array of failed mints",
            "totalMs": "number (total scan time in ms)",
            "count": "number"
          }
        }
      ]
    },
    {
      "id": "get-api-key",
      "name": "Generate Free API Key",
      "description": "Create a free API key for DrainBrain (100 scans/day, no credit card required).",
      "steps": [
        {
          "action": "POST /api/drainbrain/v1/keys",
          "input": {
            "name": "string (project or bot name)",
            "email": "string (contact email)"
          },
          "output": {
            "apiKey": "string (db_live_xxx - save immediately, shown only once)",
            "id": "string (UUID)",
            "tier": "free"
          }
        }
      ]
    },
    {
      "id": "check-health",
      "name": "Check API Status",
      "description": "Verify DrainBrain API and ML models are operational before scanning.",
      "steps": [
        {
          "action": "GET /api/drainbrain/v1/health",
          "input": {},
          "output": {
            "status": "operational | degraded",
            "models": "object (model availability)"
          }
        }
      ]
    }
  ],
  "alternative_access": {
    "mcp_server": {
      "description": "Harvey Intel MCP server - same tools plus trading signals and social intelligence. Pay per call with USDC, no account needed.",
      "url": "https://agents.rugslayer.com/mcp",
      "npm": "@meltingpixels/harvey-intel"
    }
  }
}
