{"openapi":"3.1.0","info":{"title":"Assay","version":"0.1.0","summary":"Is this agent's reputation real?","description":"A pre-flight for agent payments. Reads the ERC-8004 registries through The Graph and returns a verdict — VERIFIED, UNPROVEN or WASH_REPUTATION_DETECTED — with the evidence, what would change it, and a provenance envelope naming the exact subgraph deployment and block. Confidence is earned only from payment-backed reviews by independent addresses. The same engine reconciles lending markets across Messari standardized subgraphs, and refuses to compare sources whose schema or methodology versions differ.","license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://assay-dusky.vercel.app"}],"security":[],"paths":{"/api/v1/agents/{chain}/{agentId}":{"get":{"operationId":"assayAgent","summary":"Full verdict with evidence, next steps and provenance","parameters":[{"name":"chain","in":"path","required":true,"description":"Registry key (base, ethereum, bsc, polygon, base-sepolia, bsc-chapel) or numeric chain id.","schema":{"type":"string","examples":["base","8453"]}},{"name":"agentId","in":"path","required":true,"description":"ERC-8004 agent id on that chain.","schema":{"type":"string","examples":["25975"]}}],"responses":{"200":{"description":"The report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"404":{"description":"Unknown chain or agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Gateway error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Chain has no reliable indexer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/preview/{chain}/{agentId}":{"get":{"operationId":"previewAgent","summary":"Verdict and confidence only (free tier)","parameters":[{"name":"chain","in":"path","required":true,"description":"Registry key (base, ethereum, bsc, polygon, base-sepolia, bsc-chapel) or numeric chain id.","schema":{"type":"string","examples":["base","8453"]}},{"name":"agentId","in":"path","required":true,"description":"ERC-8004 agent id on that chain.","schema":{"type":"string","examples":["25975"]}}],"responses":{"200":{"description":"Verdict only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"404":{"description":"Unknown chain or agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/resolve":{"get":{"operationId":"resolveEndpoint","summary":"Which registered agents claim this endpoint URL?","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","format":"uri","examples":["https://mcp.zyf.ai"]}}],"responses":{"200":{"description":"Matches across every healthy chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resolve"}}}},"400":{"description":"Missing url","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/corroborate/{ref}":{"get":{"operationId":"corroborateOwner","summary":"The same owner across every healthy chain, each agent assessed","parameters":[{"name":"ref","in":"path","required":true,"description":"Owner address or chain:agentId.","schema":{"type":"string","examples":["base:25975"]}}],"responses":{"200":{"description":"Cross-chain report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Corroboration"}}}},"404":{"description":"Unknown reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/lending/market":{"get":{"operationId":"compareLendingMarket","summary":"Reconcile one lending market across two Messari subgraphs, or refuse","description":"Compares only when both sources share schemaVersion and methodologyVersion, re-read from each subgraph on every request. Otherwise returns METHODOLOGY_MISMATCH or SCHEMA_MISMATCH and no number. One source returns a snapshot instead.","parameters":[{"name":"asset","in":"query","required":false,"description":"Token symbol. Defaults to USDC.","schema":{"type":"string","examples":["USDC","WETH"]}},{"name":"sources","in":"query","required":true,"description":"One or two registry keys, comma-separated.","schema":{"type":"string","examples":["compound-v3-ethereum,spark-lend-ethereum"]}}],"responses":{"200":{"description":"The comparison, each side with its own deployment and block","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LendingReport"}}}},"400":{"description":"Missing or too many sources","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown lending source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Gateway error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Source not servable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/lending/preview":{"get":{"operationId":"previewLendingComparability","summary":"Whether two lending sources may be compared at all (free tier)","parameters":[{"name":"a","in":"query","required":true,"schema":{"type":"string","examples":["compound-v3-ethereum"]}},{"name":"b","in":"query","required":true,"schema":{"type":"string","examples":["spark-lend-ethereum"]}}],"responses":{"200":{"description":"Comparability and the versions that decided it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComparabilityPreview"}}}},"400":{"description":"Missing a or b","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown lending source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/lending/sources":{"get":{"operationId":"listLendingSources","summary":"The lending registry with schema and methodology versions","responses":{"200":{"description":"Sources","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LendingSources"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/lookup":{"get":{"operationId":"lookupCounterparty","summary":"Which registered agents a payment would go to (free)","description":"Joins a 402's payTo address and resource URL to ERC-8004 registrations by owner, declared wallet and endpoint, across every healthy chain. Used by the x402 guard before any payment is signed.","parameters":[{"name":"address","in":"query","required":false,"description":"The payTo address from a 402.","schema":{"type":"string","examples":["0x69747c4ce6185d21a33b3bcdba980d659600ac7b"]}},{"name":"url","in":"query","required":false,"description":"The paid resource's URL.","schema":{"type":"string","format":"uri"}}],"responses":{"200":{"description":"Matching registrations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyLookup"}}}},"400":{"description":"Neither address nor url given","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/badge/{chain}/{agentId}":{"get":{"operationId":"agentBadge","summary":"An embeddable SVG badge with the agent's current verdict (free)","description":"Cached at the edge for fifteen minutes. Link it to /agent/{chain}/{agentId}, the public page that shows the path to VERIFIED.","parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","examples":["base-sepolia"]}},{"name":"agentId","in":"path","required":true,"schema":{"type":"string","examples":["9200"]}}],"responses":{"200":{"description":"SVG","content":{"image/svg+xml":{}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/policy/{policyId}":{"get":{"operationId":"getPolicy","summary":"A company's saved payment policy, as the guard reads it (free)","description":"What the company's agents do with each verdict: pay, pay up to a cap, refuse, or ask a person, plus an approval threshold in dollars. Edited in the dashboard.","parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","examples":["pol_5b6408e6d9bf9f70"]}}],"responses":{"200":{"description":"The rules and when they were saved"},"404":{"description":"No policy saved under that id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/trail/export":{"get":{"operationId":"exportLedger","summary":"The whole ledger as CSV, for audit (free)","responses":{"200":{"description":"CSV","content":{"text/csv":{}}},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chains":{"get":{"operationId":"listChains","summary":"The chain registry with health flags","responses":{"200":{"description":"Chains"},"429":{"description":"Free-tier rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/healthz":{"get":{"operationId":"health","summary":"Liveness","responses":{"200":{"description":"OK"},"503":{"description":"Not ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from the dashboard (ak_test_…). Accepted on every paid route instead of an x402 payment; each call is metered on the ledger and billed monthly."}},"schemas":{"Verdict":{"type":"string","enum":["VERIFIED","UNPROVEN","WASH_REPUTATION_DETECTED"]},"Finding":{"type":"object","required":["code","severity","statement","measured"],"properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["critical","warning","info"]},"statement":{"type":"string"},"measured":{"type":"string"}}},"Provenance":{"type":"object","required":["chain","chainId","subgraphId","deployment","block","hasIndexingErrors","sampleCap","sampleTruncated","readAt"],"properties":{"chain":{"type":"string"},"chainId":{"type":"integer"},"subgraphId":{"type":"string"},"deployment":{"type":"string","description":"The exact subgraph deployment hash the answer was read from."},"block":{"type":"integer"},"blockTime":{"type":["string","null"]},"hasIndexingErrors":{"type":"boolean"},"sampleCap":{"type":"integer"},"sampleTruncated":{"type":"boolean"},"readAt":{"type":"string"},"latencyMs":{"type":"integer"},"thresholds":{"type":"object","description":"The rules the verdict was computed under."}}},"Report":{"type":"object","required":["agent","assessment","signals","provenance"],"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"owner":{"type":"string"},"wallet":{"type":["string","null"]},"ens":{"type":["string","null"]},"x402Support":{"type":["boolean","null"]},"registeredDaysAgo":{"type":["integer","null"]}}},"assessment":{"type":"object","required":["verdict","confidence","headline","findings","nextSteps"],"properties":{"verdict":{"$ref":"#/components/schemas/Verdict"},"confidence":{"type":"integer","minimum":0,"maximum":100},"headline":{"type":"string"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"nextSteps":{"type":"array","items":{"type":"string"},"description":"What would change this verdict, priced in payment-backed reviews."}}},"signals":{"type":"object","description":"The measurements the findings were computed from."},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Preview":{"type":"object","properties":{"agent":{"type":"string"},"verdict":{"$ref":"#/components/schemas/Verdict"},"confidence":{"type":"integer"},"provenance":{"type":"object"},"full":{"type":"string"}}},"Resolve":{"type":"object","properties":{"input":{"type":"string"},"candidates":{"type":"array","items":{"type":"string"}},"matches":{"type":"array","items":{"type":"object"}},"chainsQueried":{"type":"array","items":{"type":"string"}},"truncated":{"type":"array","items":{"type":"string"}},"failures":{"type":"array","items":{"type":"object"}}}},"Corroboration":{"type":"object","properties":{"owner":{"type":"string"},"chains":{"type":"array","items":{"type":"object"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"consistent":{"type":"boolean"}}},"Comparability":{"type":"string","enum":["COMPARABLE","SCHEMA_MISMATCH","METHODOLOGY_MISMATCH","REGISTRY_DRIFT"]},"LendingReport":{"type":"object","required":["asset","comparison","provenance","readAt","tolerance"],"properties":{"asset":{"type":"string"},"comparison":{"type":"object","required":["comparability","reconciliation","statement"],"properties":{"comparability":{"$ref":"#/components/schemas/Comparability"},"reconciliation":{"type":"string","enum":["AGREE","DISAGREE","NOT_ATTEMPTED"]},"statement":{"type":"string"},"deltas":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"a":{"type":"number"},"b":{"type":"number"},"relDiff":{"type":"number"},"withinTolerance":{"type":"boolean"}}}},"sources":{"type":"array","items":{"type":"object"}}}},"provenance":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"deployment":{"type":"string"},"block":{"type":"integer"},"hasIndexingErrors":{"type":"boolean"}}}},"readAt":{"type":"string"},"tolerance":{"type":"number"}}},"ComparabilityPreview":{"type":"object","required":["a","b","comparability","statement","versions"],"properties":{"a":{"type":"string"},"b":{"type":"string"},"comparability":{"$ref":"#/components/schemas/Comparability"},"statement":{"type":"string"},"versions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"schemaVersion":{"type":"string"},"methodologyVersion":{"type":"string"},"network":{"type":"string"}}}},"readAt":{"type":"string"}}},"LendingSources":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object"}},"note":{"type":"string"}}},"CounterpartyLookup":{"type":"object","properties":{"address":{"type":["string","null"]},"url":{"type":["string","null"]},"matches":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"chain":{"type":"string"},"chainId":{"type":"integer"},"agentId":{"type":"string"},"name":{"type":["string","null"]},"matchedOn":{"type":"string","enum":["owner","agentWallet","endpoint"]}}}},"chainsQueried":{"type":"array","items":{"type":"string"}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"detail":{"type":"string"}}}}}}