{"openapi":"3.1.0","info":{"title":"RugGuard","summary":"Pay-per-call rug-check API for crypto smart contracts. Pre-trade systemic risk scan for AI agents on x402.","description":"RugGuard analyzes a token contract on a supported chain and returns a weighted risk score, a verdict, and a list of structured red flags (`OWNER_NOT_RENOUNCED`, `LP_NOT_LOCKED`, `HONEYPOT_DETECTED`, `MINT_AUTHORITY_ACTIVE`, `HIDDEN_OWNER`, `OWNER_CAN_PAUSE`, `TOP10_CONCENTRATION_HIGH`, `SOURCE_NOT_VERIFIED`, `HONEYPOT_TAX_HIGH`, `HONEYPOT_ASYMMETRIC`). Designed to be called before each on-chain purchase by an autonomous agent. Settled in USDC on Base via the Coinbase CDP facilitator (x402). No API key, no signup. Best-effort analytics, not a security guarantee — see `/SECURITY.md`.","contact":{"name":"RugGuard","url":"https://rugguard.io/","email":"security@rugguard.io"},"license":{"name":"Proprietary — see /terms","url":"https://rugguard.io/terms"},"version":"0.0.1"},"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/scan/{chain}/{contract}":{"get":{"tags":["scan"],"summary":"Scan","operationId":"scan_v1_scan__chain___contract__get","parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","description":"Chain id (only 'base' in Phase 0)","title":"Chain"},"description":"Chain id (only 'base' in Phase 0)"},{"name":"contract","in":"path","required":true,"schema":{"type":"string","description":"Contract address","title":"Contract"},"description":"Contract address"},{"name":"X-Payment","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"402":{"description":"Payment required (x402). Body carries paymentRequirements."},"503":{"description":"x402 misconfigured (operator-side)"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/explain":{"get":{"tags":["scan"],"summary":"Explain","operationId":"explain_v1_explain_get","parameters":[{"name":"scan_id","in":"query","required":true,"schema":{"type":"string","description":"UUID returned by a previous /v1/scan call.","title":"Scan Id"},"description":"UUID returned by a previous /v1/scan call."},{"name":"X-Payment","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplainResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"402":{"description":"Payment required (x402)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"503":{"description":"x402 misconfigured (operator-side)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error"},"code":{"type":"string","title":"Code"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["error","code"],"title":"ErrorResponse"},"ExplainResponse":{"properties":{"scan_id":{"type":"string","title":"Scan Id"},"chain":{"type":"string","title":"Chain"},"contract":{"type":"string","title":"Contract"},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score"},"verdict":{"type":"string","title":"Verdict"},"endpoint":{"type":"string","title":"Endpoint"},"elapsed_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Elapsed Ms"},"scanned_at":{"type":"string","format":"date-time","title":"Scanned At"},"flags":{"items":{"$ref":"#/components/schemas/FlagOut"},"type":"array","title":"Flags"},"heuristics_evaluated":{"items":{"$ref":"#/components/schemas/HeuristicEvaluation"},"type":"array","title":"Heuristics Evaluated"},"score_calculation":{"type":"string","title":"Score Calculation","default":"weighted_sum_normalized_0_100"},"disclaimer":{"type":"string","title":"Disclaimer","default":"RugGuard is a data analytics tool, not a security guarantee. Best-effort heuristic scoring. See /security.html."}},"type":"object","required":["scan_id","chain","contract","score","verdict","endpoint","scanned_at","flags","heuristics_evaluated"],"title":"ExplainResponse","description":"Response shape for GET /v1/explain?scan_id=...","example":{"chain":"base","contract":"0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed","disclaimer":"RugGuard is a data analytics tool, not a security guarantee. Best-effort heuristic scoring. See /security.html.","elapsed_ms":18575,"endpoint":"/v1/scan","flags":[{"code":"OWNER_NOT_RENOUNCED","severity":"high"},{"code":"LP_NOT_LOCKED","severity":"critical"},{"code":"MINT_AUTHORITY_ACTIVE","severity":"critical"}],"heuristics_evaluated":[{"code":"OWNER_NOT_RENOUNCED","evidence":{"is_zero_or_dead":false,"owner":"0x704Ec5C12Ca20a293C2C0B72B22619A4231f3c0d"},"outcome":"fail","severity":"high","weight":15}],"scan_id":"01J9-aaaa-bbbb-cccc-dddddddddddd","scanned_at":"2026-04-26T18:00:00Z","score":32,"score_calculation":"weighted_sum_normalized_0_100","verdict":"low_risk"}},"FlagOut":{"properties":{"code":{"type":"string","title":"Code","description":"Stable flag identifier, e.g. OWNER_NOT_RENOUNCED."},"severity":{"type":"string","title":"Severity","description":"One of low | medium | high | critical."}},"type":"object","required":["code","severity"],"title":"FlagOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeuristicEvaluation":{"properties":{"code":{"type":"string","title":"Code","description":"Stable heuristic identifier, e.g. LP_NOT_LOCKED."},"weight":{"type":"integer","title":"Weight","description":"Contribution to the weighted score when this heuristic decides."},"severity":{"type":"string","title":"Severity","description":"low | medium | high | critical."},"outcome":{"type":"string","title":"Outcome","description":"pass | fail | skip."},"evidence":{"type":"object","title":"Evidence","description":"Heuristic-specific structured evidence."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Exception class name if the heuristic crashed."}},"type":"object","required":["code","weight","severity","outcome"],"title":"HeuristicEvaluation","description":"One heuristic's result as recorded at scan time. Used by /v1/explain."},"ScanResponse":{"properties":{"scan_id":{"type":"string","title":"Scan Id","description":"UUID for this scan, usable with /v1/explain."},"chain":{"type":"string","title":"Chain","description":"Chain identifier, e.g. 'base'."},"contract":{"type":"string","title":"Contract","description":"Checksummed contract address."},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score","description":"Weighted risk score, 0 = safe, 100 = critical."},"verdict":{"type":"string","title":"Verdict","description":"safe | low_risk | medium_risk | high_risk | critical."},"flags":{"items":{"$ref":"#/components/schemas/FlagOut"},"type":"array","title":"Flags","description":"Heuristics that failed for this contract."},"summary":{"type":"object","title":"Summary","description":"Quick-look signals (owner, LP status, taxes, mintable, etc.)."},"scanned_at":{"type":"string","format":"date-time","title":"Scanned At"},"cache_hit":{"type":"boolean","title":"Cache Hit","default":false},"disclaimer":{"type":"string","title":"Disclaimer","default":"RugGuard is a data analytics tool, not a security guarantee. Best-effort heuristic scoring. See /security.html."}},"type":"object","required":["scan_id","chain","contract","score","verdict","flags","scanned_at"],"title":"ScanResponse","description":"Response shape for GET /v1/scan/{chain}/{contract}.","example":{"cache_hit":false,"chain":"base","contract":"0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed","disclaimer":"RugGuard is a data analytics tool, not a security guarantee. Best-effort heuristic scoring. See /security.html.","flags":[{"code":"OWNER_NOT_RENOUNCED","severity":"high"},{"code":"LP_NOT_LOCKED","severity":"critical"},{"code":"MINT_AUTHORITY_ACTIVE","severity":"critical"}],"scan_id":"01J9-aaaa-bbbb-cccc-dddddddddddd","scanned_at":"2026-04-26T18:00:00Z","score":32,"summary":{"buy_tax_pct":0.0,"hidden_owner":false,"honeypot":false,"lp_locked":false,"mintable":true,"owner":"0x704Ec5C12Ca20a293C2C0B72B22619A4231f3c0d","owner_renounced":false,"sell_tax_pct":0.0,"source_verified":true,"top10_concentration_pct":57.34,"transfer_pausable":false},"verdict":"low_risk"}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"scan","description":"Pre-trade scan endpoints. Returns risk score 0-100, verdict, structured flags. Settled in USDC via x402."},{"name":"meta","description":"Health, version, schema. Free."}]}