{"openapi":"3.1.0","info":{"title":"x402 Crediting Swarm","version":"1.0.0","description":"3-node swarm that scores x402 Payment Required calls and returns a GO/NO-GO credit recommendation.","x-guidance":"x402 Crediting Swarm scores a Payment Required call before an agent pays it.\n\nWorkflow:\n1. GET /api/swarm — free catalog (price, network, payTo).\n2. POST /api/swarm with JSON { caller_id?, payload }. Unpaid probes return HTTP 402 with a PAYMENT-REQUIRED header (x402 v2). Do not expect a JSON challenge body.\n3. Retry the same JSON body with a signed PAYMENT-SIGNATURE (AgentCash: npx agentcash fetch <origin>/api/swarm -m POST -b '...' --payment-network base --payment-protocol x402).\n4. On 200, read final_recommendation (GO / NO-GO / NO-GO (Caution)) and final_creditability_score (0-1000).\n\npayload.endpoint_url is the vendor resource to score. Optional payload.payTo / payload.vendor_history improve the report. The swarm may spend operator AgentCash USDC on live SYNTHORA/market-intel probes; if that wallet is empty, flags include insufficient_balance instead of invented Bazaar facts.\n\nDo not send fee_paid. Payment is protocol-gated, not a client boolean.","contact":{"name":"DragonandPanda / Sevtech","email":"kwizzlesurp10@gmail.com","url":"https://x402-crediting-swarm.vercel.app"}},"servers":[{"url":"https://x402-crediting-swarm.vercel.app","description":"This origin"}],"tags":[{"name":"Catalog","description":"Free discovery"},{"name":"Evaluation","description":"Paid swarm scoring"}],"paths":{"/api/swarm":{"get":{"operationId":"getSwarmCatalog","summary":"Free catalog for the paid evaluation resource","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Catalog: price, network, payTo, body schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}},"post":{"operationId":"evaluateX402Payload","summary":"Score an x402 Payment Required payload (3-node GO/NO-GO credit report)","tags":["Evaluation"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.050000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateRequest"},"example":{"caller_id":"agentcash","payload":{"endpoint_url":"https://api.decentralized-catalog.market/v1/resource","vendor_id":"vendor_crypto_993x","requested_amount_sats":500,"payTo":"0x0d25a44f74868ece53b305c97139cf4b62963410","vendor_history":{"fulfillment_rate":0.98,"dispute_ratio":0.01}}}}}},"responses":{"200":{"description":"Consensus threat intelligence report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateResponse"}}}},"400":{"description":"Paid retry with a body missing payload object"},"402":{"description":"Payment Required"},"500":{"description":"Evaluation failed after payment"}}}}},"components":{"schemas":{"EvaluateRequest":{"type":"object","required":["payload"],"properties":{"caller_id":{"type":"string","description":"Optional agent identifier for telemetry"},"payload":{"$ref":"#/components/schemas/X402Payload"}}},"X402Payload":{"type":"object","required":["endpoint_url"],"properties":{"endpoint_url":{"type":"string","format":"uri","description":"Vendor x402 resource URL to preflight"},"vendor_id":{"type":"string"},"requested_amount_sats":{"type":"number"},"payTo":{"type":"string","description":"Advertised payTo to compare against the live 402"},"pay_to":{"type":"string"},"vendor_history":{"type":"object","properties":{"fulfillment_rate":{"type":"number"},"dispute_ratio":{"type":"number"}}}}},"EvaluateResponse":{"type":"object","required":["status","final_creditability_score","final_recommendation","trust_level","aggregated_flags","node_reports"],"properties":{"status":{"type":"string","enum":["success"]},"caller_id":{"type":"string"},"final_creditability_score":{"type":"integer","minimum":0,"maximum":1000},"final_recommendation":{"type":"string","enum":["GO","NO-GO","NO-GO (Caution)"]},"trust_level":{"type":"string"},"aggregated_flags":{"type":"array","items":{"type":"string"}},"node_reports":{"type":"array","items":{"$ref":"#/components/schemas/NodeReport"}},"agentcash_intel":{"type":"object"}}},"NodeReport":{"type":"object","required":["node","score","recommendation","flags","trust_level"],"properties":{"node":{"type":"string"},"score":{"type":"integer","minimum":0,"maximum":1000},"recommendation":{"type":"string"},"flags":{"type":"array","items":{"type":"string"}},"trust_level":{"type":"string"}}},"Catalog":{"type":"object","properties":{"name":{"type":"string"},"method":{"type":"string"},"price":{"type":"string"},"network":{"type":"string","example":"eip155:8453"},"payTo":{"type":"string","example":"0x0d25a44f74868ece53b305c97139cf4b62963410"},"facilitator":{"type":"string"},"facilitator_url":{"type":"string"},"catalog":{"type":"object"},"body":{"type":"object"}}}}}}