{
 "openapi": "3.1.0",
 "x-discovery": {
  "ownershipProofs": [
   "0xb107b1c73411f02586b715eba39066d97d331476af401c49a480795c4b53a39f4eb884d52fe8138f02c5d6581c19d6f5bb790e848dbe5bff42074eb44815ab661c"
  ]
 },
 "info": {
  "title": "SYNTHORA x402 API",
  "version": "1.1.0",
  "description": "Pay-per-call data and safety intelligence for autonomous agents. Every endpoint is protected by HTTP 402 (x402), settled in USDC on Base mainnet (eip155:8453). No API key, no signup, no KYC: the payment IS the authentication. Responses are Ed25519-signed.\n\nFlow: (1) POST the endpoint with no payment header, (2) receive HTTP 402 with an `accepts` array describing price and payTo, (3) re-POST with the `X-PAYMENT` header carrying an EIP-3009 transferWithAuthorization, (4) receive the signed result.\n\nThis document describes the canonical request/response contract. The full live catalogue of 222 payable resources is published at https://pay.hergertsynthora.com/.well-known/x402.json",
  "contact": {
   "name": "SYNTHORA S.L.",
   "url": "https://pay.hergertsynthora.com"
  },
  "x-guidance": "Two flagship endpoints live on this origin, both paid per call in USDC on Base mainnet (eip155:8453), payTo 0x10800a5a5B9d72251566EC651E862A8b4B427dE0.\nPOST /service with {\"input\":\"0x<contract on Base>\"} -> Ed25519-signed contract-safety verdict (honeypot, rug-pull, hidden mint, owner privileges). 0.005 USDC.\nPOST /preflight with {\"input\":{\"endpoint_url\":\"<x402 url>\",\"expected_payTo\":\"0x...\"}} -> verify-before-pay check that a target x402 endpoint and its payTo are alive and unchanged, so you never send USDC to a dead or hijacked payTo. Returns safe | changed | down | unknown. 0.010 USDC. Compose it BEFORE paying any third-party x402 endpoint.\nThese two are the flagships; the full catalogue of 222 payable resources (each on its own subdomain, 0.001-0.010 USDC) is machine-readable and free at GET /.well-known/x402.json. No API key, no signup: the 402 challenge IS the auth. Send the X-PAYMENT header with an EIP-3009 transferWithAuthorization to settle."
 },
 "servers": [
  {
   "url": "https://pay.hergertsynthora.com",
   "description": "Flagship endpoints"
  }
 ],
 "externalDocs": {
  "description": "Full x402 discovery manifest (222 live payable resources)",
  "url": "https://pay.hergertsynthora.com/.well-known/x402.json"
 },
 "paths": {
  "/service": {
   "post": {
    "operationId": "contractGuard",
    "summary": "On-chain contract safety check (0.005 USDC)",
    "description": "Pre-trade safety for agents: honeypot, rug-pull, hidden-mint and owner-privilege detection on a Base contract. Returns an Ed25519-signed verdict.",
    "tags": [
     "safety"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ServiceRequest"
       },
       "example": {
        "input": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/SignedResult"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/preflight": {
   "post": {
    "operationId": "payToPreflight",
    "summary": "Verify-before-pay check on any x402 endpoint (0.010 USDC)",
    "description": "Synchronous check that a target x402 endpoint and its payTo are alive and unchanged immediately before you pay, so an agent never sends USDC to a dead, changed or hijacked payTo. Returns an Ed25519-signed verdict: safe | changed | down | unknown.",
    "tags": [
     "safety"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.010000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "input"
        ],
        "properties": {
         "input": {
          "type": "object",
          "required": [
           "endpoint_url",
           "expected_payTo"
          ],
          "properties": {
           "endpoint_url": {
            "type": "string",
            "format": "uri"
           },
           "expected_payTo": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$"
           }
          }
         }
        }
       },
       "example": {
        "input": {
         "endpoint_url": "https://pay.hergertsynthora.com/service",
         "expected_payTo": "0x10800a5a5B9d72251566EC651E862A8b4B427dE0"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/SignedResult"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/.well-known/x402.json": {
   "get": {
    "operationId": "discoveryManifest",
    "summary": "x402 discovery manifest (free)",
    "description": "Machine-readable catalogue of every live payable resource, with price, payTo, network and input/output schema. Only resources that returned a valid 402 challenge at generation time are listed.",
    "tags": [
     "discovery"
    ],
    "responses": {
     "200": {
      "description": "Discovery manifest",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/.well-known/agent.json": {
   "get": {
    "operationId": "agentCard",
    "summary": "A2A Agent Card (free)",
    "description": "Agent-to-Agent protocol card listing the mesh's skills.",
    "tags": [
     "discovery"
    ],
    "responses": {
     "200": {
      "description": "A2A agent card",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/v1/wallet-enrich": {
   "post": {
    "operationId": "walletEnrich",
    "summary": "Wallet enrichment for any EVM address: risk score, sanctions exposure, tx behavior, labels (0.15 USDC)",
    "description": "Enrich any EVM wallet (0x address or ENS name) in one call: 0-100 risk score (low/medium/high), sanctions exposure screening (OFAC SDN wallet lists: Tornado Cash, Lazarus, Garantex), on-chain activity on Ethereum + Base (native balance, tx count, contract-vs-EOA) and labels (ENS reverse, GoPlus address-security flags: phishing, mixer, cybercrime, money laundering). Ed25519-signed. Paid per call via x402 in USDC on Base mainnet (eip155:8453). Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "wallet-enrichment",
     "risk",
     "sanctions",
     "compliance",
     "kyt"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.150000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "address": {
          "type": "string",
          "description": "EVM wallet address (0x...) or ENS name"
         }
        },
        "required": [
         "address"
        ]
       },
       "example": {
        "address": "vitalik.eth"
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/polymarket-whales": {
   "post": {
    "operationId": "polymarket_whales",
    "summary": "Latest large Polymarket trades (whale tracking) with wallet, size, market and tx (0.15 USDC)",
    "description": "Live whale-tracking on Polymarket: the latest large trades (default >= 5000 USD, tunable via min_usd) with wallet, side, outcome, size, price, USD value, market title/slug and tx hash, straight from Polymarket public trades data API. Built for prediction-market agents that track smart money before trading. No charge on service failure. Ed25519-signed. $0.15 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "whale-tracking",
     "smart-money",
     "trading-signal",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.150000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "min_usd": {
          "type": "number",
          "description": "Minimum trade size in USD (default 5000)"
         },
         "limit": {
          "type": "integer",
          "description": "Max trades to return (1-100, default 25)"
         },
         "side": {
          "type": "string",
          "description": "buy | sell | all (default all)"
         }
        }
       },
       "example": {
        "min_usd": 10000,
        "limit": 20,
        "side": "all"
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/polymarket-odds-movers": {
   "post": {
    "operationId": "polymarket_odds_movers",
    "summary": "Polymarket markets ranked by biggest odds move in 1h/24h/1wk with volume and spread (0.10 USDC)",
    "description": "Polymarket odds movers: active markets ranked by biggest price swing in the last 1h / 24h / 1wk (window param), with yes price, change and direction, best bid/ask, spread, 24h volume, liquidity and end date. The momentum signal prediction bots scan before entering a market. No charge on service failure. Ed25519-signed. $0.10 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "odds",
     "momentum",
     "trading-signal",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.100000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "window": {
          "type": "string",
          "description": "1h | 24h | 1wk (default 24h)"
         },
         "limit": {
          "type": "integer",
          "description": "Max markets (1-50, default 15)"
         },
         "min_volume": {
          "type": "number",
          "description": "Min 24h volume USD (default 10000)"
         }
        }
       },
       "example": {
        "window": "24h",
        "limit": 15,
        "min_volume": 10000
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/polymarket-resolution-watch": {
   "post": {
    "operationId": "polymarket_resolution_watch",
    "summary": "Polymarket markets near resolution with UMA status (proposed/disputed) and risk flags (0.10 USDC)",
    "description": "Polymarket resolution watch: markets ending within N days (default 7) with UMA resolution status (proposed/disputed), UMA bond and reward, hours to resolution, last price, 24h volume, liquidity and a uma_risk flag for contested or undecided resolutions. Lets prediction agents avoid or exploit resolution risk. No charge on service failure. Ed25519-signed. $0.10 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "uma",
     "resolution",
     "risk",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.100000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "days": {
          "type": "number",
          "description": "Days ahead to scan (0-60, default 7)"
         },
         "limit": {
          "type": "integer",
          "description": "Max markets (1-100, default 20)"
         },
         "min_volume": {
          "type": "number",
          "description": "Min 24h volume USD (default 0)"
         }
        }
       },
       "example": {
        "days": 7,
        "limit": 20,
        "min_volume": 0
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/dispute-risk": {
   "post": {
    "operationId": "dispute_risk",
    "summary": "Polymarket resolution/dispute risk score 0-100 with UMA status, bond and holder concentration (0.05 USDC)",
    "description": "Resolution/dispute risk score (0-100) for Polymarket markets: UMA status (proposed/disputed), UMA bond and reward, rules-text ambiguity (length, deadline date, declared resolution source), top-3 holder concentration as a vote-manipulation proxy, and days to resolution. Pass a market_slug or condition_id for one market, or nothing to scan the top markets resolving in the next 14 days. Built for prediction agents that price resolution risk before trading. No charge on service failure. Ed25519-signed. $0.05 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "uma",
     "dispute",
     "resolution-risk",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.050000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "market_slug": {
          "type": "string",
          "description": "Polymarket market slug (optional)"
         },
         "condition_id": {
          "type": "string",
          "description": "0x condition id (optional, overrides slug)"
         },
         "limit": {
          "type": "integer",
          "description": "Max markets in scan mode (1-20, default 10)"
         },
         "min_volume": {
          "type": "number",
          "description": "Min 24h volume USD in scan mode (default 0)"
         }
        }
       },
       "example": {
        "market_slug": "will-trump-win-the-2024-election"
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/insider-radar": {
   "post": {
    "operationId": "insider_radar",
    "summary": "Polymarket insider-style alerts: fresh wallets, big size vs volume, extreme-odds entries before moves (0.03 USDC)",
    "description": "Insider-style trade detection on Polymarket: scans the latest large fills (min_usd, default 10000 USD) over lookback_hours (default 24) and flags wallets that are fresh (few lifetime trades), sized big vs the market 24h volume, or entered at extreme odds right before the market moved. Each alert carries wallet, market, size, tx hash, a 0-100 severity score and explicit reasons; approximations are declared in the methodology field. For prediction agents tracking informed money. No charge on service failure. Ed25519-signed. $0.03 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "insider",
     "smart-money",
     "trading-signal",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.030000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "min_usd": {
          "type": "number",
          "description": "Minimum trade size USD (default 10000)"
         },
         "lookback_hours": {
          "type": "number",
          "description": "Hours to look back (1-168, default 24)"
         },
         "limit": {
          "type": "integer",
          "description": "Max alerts (1-100, default 25)"
         }
        }
       },
       "example": {
        "min_usd": 10000,
        "lookback_hours": 24,
        "limit": 25
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  },
  "/v1/market-resolution": {
   "post": {
    "operationId": "market_resolution",
    "summary": "Canonical Polymarket market resolution status: state, UMA status, sources and estimated payout (0.01 USDC)",
    "description": "Canonical resolution status for one Polymarket market (market_slug or condition_id required): market state (active/resolving/closed), UMA resolution statuses (proposed/disputed), end date and hours to resolution, declared resolution source plus sources found in the rules text, current outcome prices, UMA bond/reward and estimated payout per outcome (1.00 USDC per winning share, implied EV). The call a prediction bot makes before and after trading a market. No charge on service failure. Ed25519-signed. $0.01 USDC per call via x402 on Base. Free trial: 3 calls per wallet with header X-WALLET.",
    "tags": [
     "polymarket",
     "prediction-markets",
     "uma",
     "resolution",
     "market-status",
     "x402",
     "usdc"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.010000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "market_slug": {
          "type": "string",
          "description": "Polymarket market slug (required unless condition_id)"
         },
         "condition_id": {
          "type": "string",
          "description": "0x condition id (overrides slug)"
         }
        }
       },
       "example": {
        "market_slug": "will-trump-win-the-2024-election"
       }
      }
     }
    },
    "responses": {
     "200": {
      "": "#/components/responses/SignedResult"
     },
     "402": {
      "": "#/components/responses/PaymentRequired"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "ServiceRequest": {
    "type": "object",
    "required": [
     "input"
    ],
    "properties": {
     "input": {
      "type": "string",
      "description": "Primary argument. For contract safety, a 0x contract address on Base."
     }
    }
   },
   "SignedResult": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "niche": {
      "type": "string"
     },
     "result": {
      "type": "object"
     },
     "receipt": {
      "type": "object",
      "description": "Ed25519 signature over the result, plus payment reference."
     }
    }
   },
   "PaymentRequirements": {
    "type": "object",
    "properties": {
     "scheme": {
      "type": "string",
      "const": "exact"
     },
     "network": {
      "type": "string",
      "const": "eip155:8453"
     },
     "asset": {
      "type": "string",
      "const": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "description": "USDC on Base"
     },
     "amount": {
      "type": "string",
      "description": "Price in USDC base units (6 decimals)"
     },
     "maxAmountRequired": {
      "type": "string"
     },
     "payTo": {
      "type": "string"
     },
     "maxTimeoutSeconds": {
      "type": "integer"
     }
    }
   }
  },
  "responses": {
   "SignedResult": {
    "description": "Paid result, Ed25519-signed.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/SignedResult"
      }
     }
    }
   },
   "PaymentRequired": {
    "description": "Payment required. Read `accepts` for price and payTo, then retry with the X-PAYMENT header.",
    "content": {
     "application/json": {
      "schema": {
       "type": "object",
       "properties": {
        "x402Version": {
         "type": "integer"
        },
        "error": {
         "type": "string"
        },
        "accepts": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/PaymentRequirements"
         }
        }
       }
      }
     }
    }
   }
  },
  "securitySchemes": {
   "x402Payment": {
    "type": "apiKey",
    "in": "header",
    "name": "X-PAYMENT",
    "description": "EIP-3009 transferWithAuthorization payload, USDC on Base. Obtained by first calling the endpoint and reading the 402 challenge."
   }
  }
 },
 "security": [
  {
   "x402Payment": []
  }
 ],
 "tags": [
  {
   "name": "safety",
   "description": "Pre-trade and pre-payment safety checks"
  },
  {
   "name": "discovery",
   "description": "Free machine-readable discovery documents"
  }
 ]
}