{"openapi":"3.1.0","info":{"title":"Nexus Gateway","summary":"EVM Sentinel + M2M legal-code gateway: high-speed static Solidity security scans (honeypot check, drainer detection, 13+2 breach scenarios), deterministic signed fitness attestation (GHSA/CVE, SPDX license, CycloneDX SBOM, exploitability scoring, gas efficiency rank, tamper-evident IPFS forensic evidence bundles), bilingual EN/ID legal contract generation, and structured data payloads. Every paid fitness response is an EIP-712 signed attestation by ERC-8004 agent #636, Merkle-anchored daily on Polygon, verifiable via free public audit endpoints. Read-only static scan, no wallet approval required. Pay per call in USDC on Polygon PoS via x402 (HTTP 402). No API key; identify with the x-client-id header. NOTE: this front-door spec lists the legacy paths only; the full endpoint catalog (22 endpoints incl. /x402/fitness*) is in /manifest.json, with a curated OpenAPI subset (12 paths) at /v1/openapi.json.","version":"5.18.1-frontier","contact":{"name":"Nexus Gateway","url":"https://rakhmadaa-gif.github.io/nexus-core-gateway/"},"x-endpoints-free":["GET /manifest.json","GET /samples","GET /metrics","POST /gateway/dry-run","GET /pricing.manifest.json"]},"servers":[{"url":"https://nexus-m2m-gateway.rakhmadaa.workers.dev","description":"Nexus M2M Gateway (Cloudflare Worker front door)"}],"paths":{"/evm-sentinel/v1/scan-quick":{"post":{"summary":"EVM Sentinel Quick-Check — honeypot / access-control fast scan","description":"Static rule-engine scan focused on honeypot indicators and access control. Output: { risk_score, breach_scenarios[], gas_ratio, action: ALLOW|BLOCK }. Read-only static scan, no wallet approval required. Cost: $0.05 USDC.","x-pricing":"0.05 USDC per call, x402 exact, eip155:137","x-keywords":["honeypot-check","drainer-detector","risk-gate"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"},"example":{"solidity_code":"contract Token { ... }"}}}},"responses":{"200":{"description":"M2M envelope; data carries { risk_score, breach_scenarios, gas_ratio, action, honeypot_indicators }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M2MEnvelope"}}}},"402":{"description":"Payment required (x402 envelope in payment-required header)."}}}},"/evm-sentinel/v1/scan-deep":{"post":{"summary":"EVM Sentinel Deep-Scan — full 9+2 scenario breach analysis","description":"Full static breach analysis: BS-001..BS-009 core scenarios + BS-010 Permit2-drain detection + BS-011 arbitrage-execution manipulation, with per-scenario detail, mitigations, and recommendations. Results cached 1 hour (repeat scans ~50ms). Read-only static scan, no wallet approval required. Cost: $0.50 USDC.","x-pricing":"0.50 USDC per call, x402 exact, eip155:137","x-keywords":["drainer-detector","risk-gate","permit2-drain","arbitrage-manipulation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"},"example":{"solidity_code":"contract Vault { ... }"}}}},"responses":{"200":{"description":"M2M envelope; data carries { risk_score, breach_scenarios, gas_ratio, action, scenario_detail, permit2_drain, arbitrage_manipulation, recommendations }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M2MEnvelope"}}}},"402":{"description":"Payment required (x402 envelope in payment-required header)."}}}},"/v1/code-modules":{"post":{"summary":"EVM Sentinel Quick Scan — audited Solidity code module","description":"Generate a security-audited Solidity contract module (ERC20 / ERC721 / ESCROW) with a 5-point static audit report. Cost: $1.20 USDC.","x-pricing":"1.20 USDC per call, x402 exact, eip155:137","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeModulesRequest"},"example":{"service_type":"code_modules","params":{"type":"ERC20","name":"NexusToken","symbol":"NEX"}}}}},"responses":{"200":{"description":"M2M success envelope with audited contract source + audit report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M2MEnvelope"}}}},"402":{"description":"Payment required. The x402 payment envelope is in the payment-required response header (base64 JSON, x402Version 2, accepts[] with USDC on eip155:137)."}}}},"/v1/legal-code":{"post":{"summary":"Hybrid Legal-Code Pro — bilingual EN/ID legal contract + code mapping","description":"Generate a dual-twin bilingual (English-Indonesian) legal contract mapped to code functions. contract_type: escrow | token_sale. Tiers: light $3.00 / standard $4.50 / enterprise $8.00.","x-pricing":"3.00 / 4.50 / 8.00 USDC per call by params.tier (light/standard/enterprise), x402 exact, eip155:137","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalCodeRequest"},"example":{"service_type":"legal_code","params":{"contract_type":"escrow","tier":"standard","parties":["Party A","Party B"],"jurisdiction":"ID","amount":"1000","currency":"USDC"}}}}},"responses":{"200":{"description":"M2M success envelope with bilingual contract + clause-to-code mapping","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M2MEnvelope"}}}},"402":{"description":"Payment required (x402 envelope in payment-required header)."}}}},"/v1/structured-data":{"post":{"summary":"Verified structured data payload generator","description":"Generate a verified structured JSON payload for Web3, regulatory compliance, or cross-platform orchestration. type: ERC20 | ERC721 | REGULATORY | GENERIC. Cost: $0.20 USDC.","x-pricing":"0.20 USDC per call, x402 exact, eip155:137","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredDataRequest"},"example":{"service_type":"structured_data","params":{"type":"ERC20","name":"NexusToken","symbol":"NEX","decimals":18}}}}},"responses":{"200":{"description":"M2M success envelope with the verified JSON payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M2MEnvelope"}}}},"402":{"description":"Payment required (x402 envelope in payment-required header)."}}}}},"components":{"schemas":{"ScanRequest":{"type":"object","required":["solidity_code"],"properties":{"solidity_code":{"type":"string","description":"Full Solidity source code to scan (max 150000 chars)."}}},"ScanOutput":{"type":"object","description":"Machine scan output: { risk_score: 0.0-1.0, breach_scenarios: string[], gas_ratio: number, action: ALLOW|BLOCK }.","properties":{"risk_score":{"type":"number","minimum":0,"maximum":1},"breach_scenarios":{"type":"array","items":{"type":"string"}},"gas_ratio":{"type":"number"},"action":{"type":"string","enum":["ALLOW","BLOCK"]}}},"CodeModulesRequest":{"type":"object","required":["service_type","params"],"properties":{"service_type":{"const":"code_modules"},"params":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["ERC20","ERC721","ESCROW"]},"name":{"type":"string","description":"Token name (ERC20/ERC721)"},"symbol":{"type":"string","description":"Token symbol (ERC20/ERC721)"}}}}},"LegalCodeRequest":{"type":"object","required":["service_type","params"],"properties":{"service_type":{"const":"legal_code"},"params":{"type":"object","required":["contract_type"],"properties":{"contract_type":{"type":"string","enum":["escrow","token_sale"]},"tier":{"type":"string","enum":["light","standard","enterprise"],"default":"standard"},"parties":{"type":"array","items":{"type":"string"}},"jurisdiction":{"type":"string","default":"ID"},"amount":{"type":"string"},"currency":{"type":"string","default":"USDC"},"deadline":{"type":"string"}}}}},"StructuredDataRequest":{"type":"object","required":["service_type","params"],"properties":{"service_type":{"const":"structured_data"},"params":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["ERC20","ERC721","REGULATORY","GENERIC"]},"name":{"type":"string"},"symbol":{"type":"string"},"decimals":{"type":"integer","default":18},"total_supply":{"type":"integer"}}}}},"M2MEnvelope":{"type":"object","description":"Standard M2M response envelope: { status, payload_id, timestamp, service_type, data, metadata: { node_id, version, latency_ms, credits_charged } }.","properties":{"status":{"type":"string","enum":["success","failed"]},"payload_id":{"type":["string","null"]},"timestamp":{"type":"string","format":"date-time"},"service_type":{"type":"string"},"data":{"type":"object"},"metadata":{"type":"object"}}}}}}