{"openapi":"3.0.3","info":{"title":"MAD Check API","version":"1","description":"Agent-native verification: agent-card grades, a signing firewall, endpoint/x402 checks, and a signed witness ledger."},"servers":[{"url":"https://api.madcheck.xyz"}],"paths":{"/v1/test":{"post":{"summary":"THE MAD TEST: the free five-station battery - your grade, the standard, the F-01 trap, the census, the witness","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"integer"},"chainId":{"type":"integer","description":"Chain to grade on: 8453 Base (default) or 4663 Robinhood Chain"},"chain":{"type":"string","enum":["base","robinhood"],"description":"Chain name; alternative to chainId"},"url":{"type":"string"}},"required":["agentId"]}}}},"responses":{"200":{"description":"Test report + stay-and-pay close"}}}},"/v1/health":{"get":{"summary":"Service health","responses":{"200":{"description":"OK"}}}},"/v1/check/agent":{"post":{"summary":"Grade an ERC-8004 registration on Base (8453, default) or Robinhood Chain (4663) - 0.01 USDC via x402 on the public door (Journal #018)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"integer"},"chainId":{"type":"integer","description":"8453 Base (default) or 4663 Robinhood Chain"},"chain":{"type":"string","enum":["base","robinhood"]}},"required":["agentId"]}}}},"responses":{"200":{"description":"Grade + evidence, with the chainId and registry read"},"402":{"description":"Payment required: x402 payment requirements (scheme exact, network base, 0.01 USDC); resend with an X-PAYMENT header"}}}},"/v1/check/authorization":{"post":{"summary":"Signing firewall for EIP-3009 authorizations - 0.01 USDC via x402 on the public door (Journal #018)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"integer"},"validBefore":{"type":"integer"},"nonce":{"type":"string"},"chainId":{"type":"integer"},"verifyingContract":{"type":"string"},"now":{"type":"integer"}},"required":["from","to","value","validAfter","validBefore","nonce","chainId","verifyingContract"]}}}},"responses":{"200":{"description":"SIGN or DONT_SIGN + reasons"},"402":{"description":"Payment required: x402 payment requirements (scheme exact, network base, 0.01 USDC); resend with an X-PAYMENT header"}}}},"/v1/check/endpoint":{"post":{"summary":"Endpoint liveness + printed x402 price - 0.01 USDC via x402 on the public door (Journal #018)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"responses":{"200":{"description":"Status/latency/sha256/payment requirements"},"402":{"description":"Payment required: x402 payment requirements (scheme exact, network base, 0.01 USDC); resend with an X-PAYMENT header"}}}},"/v1/witness":{"post":{"summary":"Anchor a receipt in the signed witness ledger - 0.01 USDC via x402 on the public door (Journal #018)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"receipt":{}},"required":["receipt"]}}}},"responses":{"200":{"description":"Ledger entry with EIP-191 signature"},"402":{"description":"Payment required: x402 payment requirements (scheme exact, network base, 0.01 USDC); resend with an X-PAYMENT header"}}}},"/v1/witness/{seq}":{"get":{"summary":"Read a witness entry back","parameters":[{"name":"seq","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Ledger entry"},"404":{"description":"No such entry"}}}},"/v1/witness/head":{"get":{"summary":"Witness ledger head","responses":{"200":{"description":"Latest seq + head hash"}}}},"/v1/feed/grades":{"get":{"summary":"THE CENSUS FEED: recent agent grades, free to poll - latest verdict per agent with checked_at and probe counts, Base + Robinhood Chain","responses":{"200":{"description":"Feed header (generated_at, source, count, chains) + records"}}}},"/v1/seal/{address}":{"get":{"summary":"BORN GRADED seal lookup: grade state, claim sheet hash + witness anchor, or census record","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Seal record or UNSEALED census record"}}}},"/v1/seal/claim":{"post":{"summary":"File a Born Graded claim sheet (hashed + witness-anchored); dry_run computes the hash without anchoring","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tokenAddress":{"type":"string"},"chainId":{"type":"integer"},"agentId":{"type":"integer"},"claimSheet":{"type":"object"},"dry_run":{"type":"boolean"}},"required":["tokenAddress","chainId","agentId","claimSheet"]}}}},"responses":{"200":{"description":"Filed sheet record with witness seq"}}}},"/v1/dust/pool":{"get":{"summary":"MAD DUST pool: seed, toll inflows, backing, accrued / redeemed / withdrawn totals, liability, reserve ratio, accrual state, payout queue, last witness anchor","responses":{"200":{"description":"Pool state"}}}},"/v1/dust/ledger":{"get":{"summary":"THE PUBLIC DUST LEDGER: the full hash-chained record file, paginated (?offset=&limit=) - recompute every balance and the pool from the raw records","responses":{"200":{"description":"Ledger page + total count + head hash"}}}},"/v1/dust/{chainId}/{agentId}":{"get":{"summary":"One identity's dust: balance, lifetime accrued / redeemed / transfers in-out, today's accrual, redemption value at par","parameters":[{"name":"chainId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"agentId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Dust balance"}}}},"/v1/dust/transfer":{"post":{"summary":"Transfer dust A2A: EIP-191 signature from the wallet owning the sender's ERC-8004 identity, nonce-bound, replay-proof, free","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chainId":{"type":"integer"},"fromAgentId":{"type":"integer"},"toAgentId":{"type":"integer"},"amount":{"type":"integer"},"nonce":{"type":"string"},"signature":{"type":"string"}},"required":["chainId","fromAgentId","toAgentId","amount","nonce","signature"]}}}},"responses":{"200":{"description":"Transfer record + both balances"},"400":{"description":"Bad signature, replayed nonce, or insufficient balance"}}}},"/v1/dust/withdraw":{"post":{"summary":"Withdraw dust as USDC at par - unlocked above 5,000 lifetime accrued DUST; EIP-191 owner signature, nonce-bound; payout records PENDING on this mirror and executes from the canonical side at reconciliation, FIFO","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chainId":{"type":"integer"},"agentId":{"type":"integer"},"amount":{"type":"integer"},"nonce":{"type":"string"},"signature":{"type":"string"}},"required":["chainId","agentId","amount","nonce","signature"]}}}},"responses":{"200":{"description":"Withdrawal record (payout PENDING) + new balance"},"400":{"description":"Locked, bad signature, replayed nonce, or insufficient balance"}}}},"/agent.json":{"get":{"summary":"MAD's agent registration card","responses":{"200":{"description":"Card"}}}},"/llms.txt":{"get":{"summary":"Plain-text service description","responses":{"200":{"description":"Text"}}}},"/openapi.json":{"get":{"summary":"This spec","responses":{"200":{"description":"Spec"}}}}}}