{"openapi":"3.1.0","info":{"title":"AlgoSentry","description":"Algorand ASA fraud detection API. Machine-to-machine, paid per-call via x402 (USDC/ALGO on Algorand). Returns verdict (ok/warning/high_risk), safety score, and structured evidence.","contact":{"name":"AlgoSentry","url":"https://www.algosentry.cloud/"},"license":{"name":"Proprietary"},"version":"1.0.0"},"paths":{"/v1/asa/registry-check":{"get":{"tags":["ASA Registry"],"summary":"Check if an Algorand ASA is a known scam or clone","description":"Analyzes an Algorand Standard Asset (ASA) for fraud indicators: name similarity to known assets, clawback/freeze flags, creator account age, holder concentration, and suspicious patterns. Returns a verdict (ok/warning/high_risk), a 0-100 safety score, and structured evidence. **Requires x402 payment of 0.02 USDC or 0.05 ALGO per call.**","operationId":"registry_check_v1_asa_registry_check_get","parameters":[{"name":"asset_id","in":"query","required":true,"schema":{"type":"string","description":"Algorand ASA ID (integer). Example: 31566704 for USDC.","title":"Asset Id"},"description":"Algorand ASA ID (integer). Example: 31566704 for USDC.","example":"31566704"}],"responses":{"200":{"description":"Analysis complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryCheckResponse"}}}},"400":{"description":"Invalid asset_id"},"402":{"description":"Payment required (x402)"},"404":{"description":"Asset not found on Algorand"},"429":{"description":"Rate limit exceeded"},"500":{"description":"Upstream or server error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/network/pulse":{"get":{"tags":["Network"],"summary":"Real-time Algorand network snapshot (TPS, fees, current round)","description":"Returns a live snapshot of the Algorand network: current round, estimated TPS over a recent block window, average block time, and current minimum transaction fee. **Requires x402 payment of 0.01 USDC or 0.025 ALGO per call.**","operationId":"network_pulse_v1_network_pulse_get","responses":{"200":{"description":"Snapshot returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkPulseResponse"}}}},"402":{"description":"Payment required (x402)"},"429":{"description":"Rate limit exceeded"},"503":{"description":"Upstream Algorand node unavailable"}}}},"/v1/contract/audit":{"post":{"tags":["Contract Audit"],"summary":"Audit an Algorand smart contract (TEAL or Puya) for security issues","description":"Analyzes TEAL or Puya (Algorand Python) smart contract source code for security issues: missing authorization checks, rekey abuse, unchecked group assumptions, unvalidated CloseRemainderTo/AssetCloseTo, integer overflow, and more. Powered by Claude. **Requires x402 payment — the exact price is derived from submitted code size and current AI inference cost, and is returned in the 402 response.**","operationId":"contract_audit_v1_contract_audit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractAuditRequest"}}},"required":true},"responses":{"200":{"description":"Audit complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractAuditResponse"}}}},"400":{"description":"Missing or oversized source code"},"402":{"description":"Payment required (x402)"},"429":{"description":"Rate limit exceeded"},"503":{"description":"Upstream model unavailable or declined to audit"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ping-sample":{"get":{"tags":["Meta"],"summary":"Free sample response — no payment required","description":"Returns a real registry-check response for USDC (ASA 31566704), served from static data. Use this to validate your integration before submitting a paid request. No X-PAYMENT header required.","operationId":"ping_sample_v1_ping_sample_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AssetMetadata":{"properties":{"asset_id":{"type":"integer","title":"Asset Id"},"name":{"type":"string","title":"Name"},"unit_name":{"type":"string","title":"Unit Name"},"total_supply":{"type":"integer","title":"Total Supply"},"decimals":{"type":"integer","title":"Decimals"},"clawback_enabled":{"type":"boolean","title":"Clawback Enabled"},"freeze_enabled":{"type":"boolean","title":"Freeze Enabled"},"manager_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Address"},"reserve_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reserve Address"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"creator":{"$ref":"#/components/schemas/CreatorInfo"}},"type":"object","required":["asset_id","name","unit_name","total_supply","decimals","clawback_enabled","freeze_enabled","creator"],"title":"AssetMetadata"},"AuditFinding":{"properties":{"code":{"type":"string","title":"Code"},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line"},"description":{"type":"string","title":"Description"}},"type":"object","required":["code","severity","description"],"title":"AuditFinding"},"ContractAuditRequest":{"properties":{"source":{"type":"string","title":"Source","description":"TEAL or Puya (Algorand Python) smart contract source code."},"language":{"anyOf":[{"type":"string","enum":["teal","puya"]},{"type":"null"}],"title":"Language","description":"Source language. Auto-detected from content if omitted."}},"type":"object","required":["source"],"title":"ContractAuditRequest"},"ContractAuditResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.0"},"language":{"type":"string","title":"Language"},"verdict":{"$ref":"#/components/schemas/Verdict"},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score","description":"0 = high risk, 100 = safe"},"findings":{"items":{"$ref":"#/components/schemas/AuditFinding"},"type":"array","title":"Findings","default":[]},"summary":{"type":"string","title":"Summary"},"model":{"type":"string","title":"Model","description":"The Claude model that actually produced this audit (may be a fallback)."},"usage":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Usage","description":"Token usage and estimated inference cost for this call (margin tracking)."},"payment_receipt":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Payment Receipt"}},"type":"object","required":["language","verdict","score","summary","model"],"title":"ContractAuditResponse","description":"Réponse normalisée du endpoint POST /v1/contract/audit.\nSchéma stable — toute modification breaking passera par /v2/."},"CreatorInfo":{"properties":{"address":{"type":"string","title":"Address"},"account_age_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Age Days"},"total_assets_created":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Assets Created"},"is_known_issuer":{"type":"boolean","title":"Is Known Issuer","default":false}},"type":"object","required":["address"],"title":"CreatorInfo"},"Flag":{"properties":{"code":{"type":"string","title":"Code"},"severity":{"type":"string","enum":["info","warning","critical"],"title":"Severity"},"description":{"type":"string","title":"Description"}},"type":"object","required":["code","severity","description"],"title":"Flag"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HolderDistribution":{"properties":{"top_1_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top 1 Pct"},"top_5_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top 5 Pct"},"top_10_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top 10 Pct"},"total_holders":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Holders"}},"type":"object","title":"HolderDistribution"},"NetworkPulseResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.0"},"network":{"type":"string","title":"Network"},"current_round":{"type":"integer","title":"Current Round"},"node_time_since_last_round_ms":{"type":"number","title":"Node Time Since Last Round Ms"},"window_rounds":{"type":"integer","title":"Window Rounds"},"window_seconds":{"type":"number","title":"Window Seconds"},"txn_count_window":{"type":"integer","title":"Txn Count Window"},"tps_estimate":{"type":"number","title":"Tps Estimate"},"avg_block_time_seconds":{"type":"number","title":"Avg Block Time Seconds"},"min_fee_micro_algo":{"type":"integer","title":"Min Fee Micro Algo"},"cached":{"type":"boolean","title":"Cached","default":false},"payment_receipt":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Payment Receipt"}},"type":"object","required":["network","current_round","node_time_since_last_round_ms","window_rounds","window_seconds","txn_count_window","tps_estimate","avg_block_time_seconds","min_fee_micro_algo"],"title":"NetworkPulseResponse","description":"Réponse normalisée du endpoint GET /v1/network/pulse.\nSchéma stable — toute modification breaking passera par /v2/."},"RegistryCheckResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.0"},"asset_id":{"type":"integer","title":"Asset Id"},"verdict":{"$ref":"#/components/schemas/Verdict"},"score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score","description":"0 = high risk, 100 = safe"},"flags":{"items":{"$ref":"#/components/schemas/Flag"},"type":"array","title":"Flags","default":[]},"asset":{"$ref":"#/components/schemas/AssetMetadata"},"holder_distribution":{"anyOf":[{"$ref":"#/components/schemas/HolderDistribution"},{"type":"null"}]},"similarity_matches":{"items":{"$ref":"#/components/schemas/SimilarityMatch"},"type":"array","title":"Similarity Matches","default":[]},"evidence":{"type":"object","title":"Evidence","description":"Raw evidence used to compute the score (for auditability)"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Non-blocking issues with the request or data (e.g. coerced types)"},"cached":{"type":"boolean","title":"Cached","default":false},"payment_receipt":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Payment Receipt"}},"type":"object","required":["asset_id","verdict","score","asset"],"title":"RegistryCheckResponse","description":"Réponse normalisée du endpoint GET /v1/asa/registry-check.\nSchéma stable — toute modification breaking passera par /v2/."},"SimilarityMatch":{"properties":{"asset_id":{"type":"integer","title":"Asset Id"},"known_name":{"type":"string","title":"Known Name"},"known_unit_name":{"type":"string","title":"Known Unit Name"},"name_similarity":{"type":"number","title":"Name Similarity"},"unit_name_similarity":{"type":"number","title":"Unit Name Similarity"}},"type":"object","required":["asset_id","known_name","known_unit_name","name_similarity","unit_name_similarity"],"title":"SimilarityMatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Verdict":{"type":"string","enum":["ok","warning","high_risk"],"title":"Verdict"}}}}