{"x402":true,"version":1,"service":"Agent Health Monitor","description":"Pay-per-use API that analyzes Base blockchain agent wallets for transaction failures, gas waste, and optimization opportunities.","facilitator":"https://facilitator.payai.network","resources":["https://web-production-a512e.up.railway.app/health/*","https://web-production-a512e.up.railway.app/alerts/subscribe/*","https://web-production-a512e.up.railway.app/optimize/*","https://web-production-a512e.up.railway.app/agent/protect/[address]","https://web-production-a512e.up.railway.app/risk/premium/*","https://web-production-a512e.up.railway.app/counterparties/*","https://web-production-a512e.up.railway.app/network-map/*","https://web-production-a512e.up.railway.app/risk/*","https://web-production-a512e.up.railway.app/retry/[address]","https://web-production-a512e.up.railway.app/ahs/*","https://web-production-a512e.up.railway.app/ahs/route/*","https://web-production-a512e.up.railway.app/ahs/route/policy","https://web-production-a512e.up.railway.app/ahs/batch","https://web-production-a512e.up.railway.app/report-card/*","https://web-production-a512e.up.railway.app/wash/*"],"endpoints":[{"url":"https://web-production-a512e.up.railway.app/health/*","method":"GET","description":"Base blockchain agent wallet health analyzer. Returns health score, gas efficiency, failure analysis, and optimization recommendations for any Base L2 wallet address.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.50"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","is_contract":true,"health_score":82.5,"optimization_priority":"MEDIUM","total_transactions":150,"successful":138,"failed":12,"success_rate_pct":92.0,"total_gas_spent_eth":0.00342,"wasted_gas_eth":0.00041,"estimated_monthly_waste_usd":1.23,"avg_gas_efficiency_pct":65.4,"out_of_gas_count":2,"reverted_count":10,"nonce_gap_count":0,"retry_count":1,"top_failure_type":"reverted","first_seen":"2024-03-01","last_seen":"2025-06-15","recommendations":[{"category":"reliability","severity":"high","message":"Transaction success rate is 92.0%..."}],"eth_price_usd":2500.0,"analyzed_at":"2026-02-16T12:00:00Z"}},"schema":{"type":"object","properties":{"status":{"type":"string"},"report":{"type":"object","properties":{"address":{"type":"string","description":"Wallet address analyzed"},"is_contract":{"type":"boolean","description":"Whether address is a smart contract"},"health_score":{"type":"number","description":"Composite health score 0-100"},"optimization_priority":{"type":"string","description":"CRITICAL, HIGH, MEDIUM, or LOW"},"total_transactions":{"type":"integer","description":"Total outgoing transactions"},"successful":{"type":"integer"},"failed":{"type":"integer"},"success_rate_pct":{"type":"number","description":"Success rate percentage"},"total_gas_spent_eth":{"type":"number"},"wasted_gas_eth":{"type":"number","description":"ETH wasted on failed transactions"},"estimated_monthly_waste_usd":{"type":"number"},"avg_gas_efficiency_pct":{"type":"number"},"out_of_gas_count":{"type":"integer"},"reverted_count":{"type":"integer"},"nonce_gap_count":{"type":"integer"},"retry_count":{"type":"integer"},"top_failure_type":{"type":"string"},"first_seen":{"type":"string"},"last_seen":{"type":"string"},"recommendations":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"severity":{"type":"string"},"message":{"type":"string"}}},"description":"Actionable optimization recommendations"},"eth_price_usd":{"type":"number"},"analyzed_at":{"type":"string"}}}}}}}}},{"url":"https://web-production-a512e.up.railway.app/alerts/subscribe/*","method":"GET","description":"Subscribe to automated wallet health monitoring. Checks wallet health every 6 hours and sends webhook alerts when health score, failure rate, or gas waste thresholds are breached. $2.00 USDC for 30 days of monitoring.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$2.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","message":"Subscription active. Configure your webhook via POST /alerts/configure.","subscription":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","active":true,"webhook_configured":false,"webhook_type":"generic","expires_at":"2026-03-22T12:00:00Z","alerts_sent":0}}}}}},{"url":"https://web-production-a512e.up.railway.app/optimize/*","method":"GET","description":"Gas optimization service for Base L2 agent wallets. Analyzes transaction types, calculates optimal gas limits, identifies wasted gas, and estimates monthly savings.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$5.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","total_transactions_analyzed":150,"current_monthly_gas_usd":45.2,"optimized_monthly_gas_usd":38.5,"estimated_monthly_savings_usd":6.7,"total_wasted_gas_eth":0.00215,"total_wasted_gas_usd":5.37,"tx_types":[{"contract":"0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad","method_id":"0x3593564c","method_label":"execute (Universal Router)","tx_count":85,"failed_count":8,"failure_rate_pct":9.4,"current_avg_gas_limit":350000,"current_p50_gas_used":185000,"current_p95_gas_used":245000,"optimal_gas_limit":281750,"gas_limit_reduction_pct":19.5,"wasted_gas_eth":0.00145,"wasted_gas_usd":3.62}],"recommendations":["Gas limits are 19.5% too high for execute (Universal Router).","Eliminating failed transactions would save ~$6.70/month."],"eth_price_usd":2500.0,"analyzed_at":"2026-02-17T12:00:00Z"}}}}}},{"url":"https://web-production-a512e.up.railway.app/agent/protect/[address]","method":"GET","description":"Protection Agent: Autonomous orchestrator that triages wallet risk and runs the appropriate combination of health check, gas optimization, and retry bot services. Returns a unified report with prioritized actions ranked by potential value recovered.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$25.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","risk_level":"high","health_score":58,"services_run":["health_check","gas_optimizer","retry_bot"],"summary":{"total_issues_found":15,"total_potential_savings_usd":156.0,"retry_transactions_ready":8,"estimated_retry_cost_usd":2.4},"recommended_actions":[{"priority":1,"action":"Execute retry transactions","potential_value_usd":85.0,"description":"8 failed transactions can be retried with optimized gas"}],"analyzed_at":"2026-02-18T12:00:00Z"}}}}}},{"url":"https://web-production-a512e.up.railway.app/risk/premium/*","method":"GET","description":"Premium risk score enriched with Nansen wallet intelligence labels, PnL profitability summary, and operational health metrics (transaction failure rates, nonce gaps, volume anomalies).","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.05"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"risk_score":35,"risk_level":"MEDIUM","verdict":"Medium - elevated failure rate with contract reverts detected","nansen_labels":[{"label":"Smart Money","category":"smart_money"}],"nansen_available":true,"pnl_summary":{"realized_pnl_usd":12500.0,"win_rate":0.65,"traded_token_count":18},"pnl_available":true,"operational_health":{"tx_failure_rate_1hr":0.02,"tx_failure_rate_24hr":0.05,"health_status":"healthy"}},"schema":{"type":"object","properties":{"risk_score":{"type":"integer","description":"Risk score 0-100"},"risk_level":{"type":"string","description":"CRITICAL, HIGH, MEDIUM, or LOW"},"verdict":{"type":"string","description":"One-line risk assessment"},"nansen_labels":{"type":"array","description":"Nansen wallet intelligence labels"},"nansen_available":{"type":"boolean"},"pnl_summary":{"type":"object","description":"Profit/loss summary from Nansen"},"pnl_available":{"type":"boolean"},"operational_health":{"type":"object","description":"Tx failure rates and health status"}}}}}}},{"url":"https://web-production-a512e.up.railway.app/counterparties/*","method":"GET","description":"Know Your Counterparty report showing top wallets and contracts the address interacts with most, enriched with Nansen labels.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.10"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","counterparties":[{"address":"0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad","label":"Uniswap: Universal Router","interaction_count":85,"volume_usd":125000.0,"last_interaction":"2026-02-20"}],"total_counterparties":25,"nansen_available":true},"schema":{"type":"object","properties":{"status":{"type":"string"},"address":{"type":"string","description":"Queried wallet address"},"counterparties":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"label":{"type":"string"},"interaction_count":{"type":"integer"},"volume_usd":{"type":"number"},"last_interaction":{"type":"string"}}},"description":"Top counterparties ranked by interaction count"},"total_counterparties":{"type":"integer"},"nansen_available":{"type":"boolean"}}}}}}},{"url":"https://web-production-a512e.up.railway.app/network-map/*","method":"GET","description":"Wallet Network Map showing related wallets (first funders, deployers, multisig co-signers) enriched with Nansen labels.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.10"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","chain":"ethereum"}},"output":{"type":"json","example":{"status":"ok","address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","chain":"ethereum","related_wallets":[{"address":"0x1234567890abcdef1234567890abcdef12345678","label":"First Funder","relation":"first_funder","chain":"ethereum"}],"total_related":5,"nansen_available":true},"schema":{"type":"object","properties":{"status":{"type":"string"},"address":{"type":"string","description":"Queried wallet address"},"chain":{"type":"string","description":"Blockchain queried"},"related_wallets":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"label":{"type":"string"},"relation":{"type":"string"},"chain":{"type":"string"}}},"description":"Related wallets via funding, deployment, or multisig links"},"total_related":{"type":"integer"},"nansen_available":{"type":"boolean"}}}}}}},{"url":"https://web-production-a512e.up.railway.app/risk/*","method":"GET","description":"Quick risk score for agent pre-flight checks. Returns a 0-100 risk score and one-line verdict. Designed for high-volume, low-latency use.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.001"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"risk_score":22,"risk_level":"LOW","verdict":"Wallet operating normally with no significant issues detected"},"schema":{"type":"object","properties":{"risk_score":{"type":"integer","description":"Risk score 0-100 (0=safe, 100=critical)"},"risk_level":{"type":"string","description":"CRITICAL, HIGH, MEDIUM, or LOW"},"verdict":{"type":"string","description":"One-line human-readable risk assessment"}}}}}}},{"url":"https://web-production-a512e.up.railway.app/retry/[address]","method":"GET","description":"RetryBot: Non-custodial failed transaction retry service. Analyzes failed transactions, classifies failure reasons, and returns optimized ready-to-sign replacement transactions with corrected gas parameters. Agent signs and submits.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$10.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","failed_transactions_analyzed":50,"retryable_count":12,"retry_transactions":[{"original_tx_hash":"0xabc123...","failure_reason":"out_of_gas","optimized_transaction":{"to":"0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad","data":"0x3593564c...","value":"0x0","gas_limit":"0x55730","max_fee_per_gas":"0x5f5e100","max_priority_fee_per_gas":"0x2faf080"},"estimated_gas_cost_usd":0.12,"confidence":"high"}],"total_estimated_retry_cost_usd":1.44,"potential_value_recovered_usd":85.0,"analyzed_at":"2026-02-18T12:00:00Z"}}}}}},{"url":"https://web-production-a512e.up.railway.app/ahs/*","method":"GET","description":"Agent Health Score: Proprietary composite 0-100 diagnostic across wallet hygiene, behavioural patterns, and infrastructure health. Premium agent analysis.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$1.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","agent_health_score":72,"grade":"Needs Attention","confidence":"HIGH","mode":"2D","dimensions":[{"dimension":"wallet_hygiene","score":85,"weight":0.3,"contributing_factors":["Wallet hygiene is healthy"]},{"dimension":"behavioural_patterns","score":63,"weight":0.7,"contributing_factors":["Repeated failures: 6 consecutive"]}],"patterns_detected":[{"name":"Stale Strategy","detected":true,"severity":"warning","description":"Agent is repeatedly failing on the same contract interaction without adapting."}],"recommendations":["Investigate repeated failures","Enable dynamic gas pricing"],"model_version":"AHS-v1","next_scan_recommended":"7 days"}}}}}},{"url":"https://web-production-a512e.up.railway.app/ahs/route/*","method":"GET","description":"Trust routing signal for agent wallets. Returns a lightweight routing recommendation (instant_settle / escrow / reject) based on the most recent AHS grade.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.01"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","agent_health_score":67,"grade":"C","routing_recommendation":"escrow","confidence":"high","scored_at":"2026-04-22T10:00:00Z","stale":false,"policy_applied":false,"allowlisted":false}}}}},{"url":"https://web-production-a512e.up.railway.app/ahs/route/policy","method":"PUT","description":"Configure custom trust routing policy. Set grade-to-action mappings and manage an address allowlist for instant_settle bypass.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.01"}]},{"url":"https://web-production-a512e.up.railway.app/ahs/batch","method":"POST","description":"AHS Batch: Score multiple agent wallets in a single call. Up to 10 wallets per x402 payment ($10.00), or up to 25 via API key.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$10.00"}],"bazaar":{"info":{"input":{"type":"http","method":"POST","discoverable":true,"body":{"addresses":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"]}},"output":{"type":"json","example":{"results":[{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","ahs_score":72,"grade":"C","d1_score":85,"d2_score":63,"pattern":"Stale Strategy","verdict":"Needs Attention","routing_recommendation":"escrow"},{"address":"0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae","ahs_score":88,"grade":"B","d1_score":91,"d2_score":86,"pattern":"Healthy","verdict":"Good","routing_recommendation":"instant_settle"}],"page":1,"page_size":25,"total_addresses":2,"total_scored":2,"credits_used":2,"errors":[]}}}}},{"url":"https://web-production-a512e.up.railway.app/report-card/*","method":"GET","description":"Agent Report Card: Visual health report card with ecosystem benchmarks. Generates a shareable 1200x675 PNG image with AHS score, dimension breakdown, ecosystem comparison, and detected patterns.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"2.00"}],"bazaar":{"info":{"input":{"type":"http","method":"GET","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","agent_health_score":72,"grade":"C — Needs Attention","dimensions":[{"dimension":"D1: Wallet Hygiene","score":68,"weight":0.3},{"dimension":"D2: Behavioural Patterns","score":55,"weight":0.7}],"ecosystem_comparison":{"average_ahs":59.3,"percentile_rank":65,"total_agents_scored":4552},"image_url":"/static/report-cards/0xd8da...6045.png"}}}}}},{"url":"https://web-production-a512e.up.railway.app/wash/*","method":"POST","description":"Agent Wash: Recurring hygiene scan for blockchain agent wallets. Detects dust tokens, spam tokens, gas inefficiency, failed transaction patterns, and nonce gaps. Returns a cleanliness score and prioritised cleanup recommendations.","mime_type":"application/json","payment":[{"scheme":"exact","network":"eip155:8453","pay_to":"0xaD64EFCe9CfeE4d1D1701d9a0009CCa72B9ff000","price":"$0.50"}],"bazaar":{"info":{"input":{"type":"http","method":"POST","discoverable":true,"queryParams":{"address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}},"output":{"type":"json","example":{"status":"ok","report":{"address":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","cleanliness_score":72,"cleanliness_grade":"Clean","total_issues":8,"dust_tokens":5,"spam_tokens":2,"gas_efficiency_pct":68.5,"gas_efficiency_grade":"Good","failed_tx_count_24hr":1,"nonce_gaps":0,"recommendations":["Clear 5 dust tokens to declutter wallet","2 spam tokens detected — consider blocking future airdrops","Looking good — schedule your next wash in 30 days"],"next_wash_recommended":"30 days"}},"schema":{"type":"object","properties":{"status":{"type":"string"},"report":{"type":"object","properties":{"cleanliness_score":{"type":"integer","description":"0-100 cleanliness score"},"cleanliness_grade":{"type":"string","description":"Spotless/Clean/Needs Attention/Dirty/Critical"},"dust_tokens":{"type":"integer"},"spam_tokens":{"type":"integer"},"gas_efficiency_pct":{"type":"number"},"recommendations":{"type":"array","items":{"type":"string"}},"next_wash_recommended":{"type":"string"}}}}}}}}}]}