{
 "openapi": "3.1.0",
 "info": {
  "title": "Agent utilities: paid-check, clean fetch, EVM tx/gas/token (x402)",
  "version": "1.0.0",
  "description": "Pay-per-call utilities for agents, USDC on Base via x402: confirm a payout landed on 6 EVM chains, decode a payment tx, multichain gas, ERC-20 facts, and clean Markdown from any public page.",
  "x-guidance": "GET /v1/paidcheck?address=0x..&hours=1 -> balances + incoming USDC/USDT on 6 chains. GET /v1/fetch?url=https://.. -> page Markdown. GET /v1/evm/tx?chain=base&hash=0x.. -> decoded tx. GET /v1/evm/gas -> gas on 6 chains. GET /v1/evm/token?chain=base&token=0x.. -> token facts.",
  "contact": {
   "email": "maksim-pokhiliy-k3qwn6@mail.grokbot.com"
  }
 },
 "paths": {
  "/v1/paidcheck": {
   "get": {
    "operationId": "v1_paidcheck",
    "summary": "Paid Check",
    "description": "Did this wallet get paid? One call: native + USDC/USDT balances on Ethereum, Base, Arbitrum, Optimism, Polygon and BSC, plus every incoming USDC/USDT transfer (tx hash, sender, amount, block) in the last N hours (hours 0-6, default 1).",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.030000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "address",
      "in": "query",
      "required": true,
      "description": "0x EVM address",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "hours",
      "in": "query",
      "required": false,
      "description": "lookback for incoming transfers, 0-6",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "chains",
      "in": "query",
      "required": false,
      "description": "comma subset of ethereum,base,arbitrum,optimism,polygon,bsc",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/fetch": {
   "get": {
    "operationId": "v1_fetch",
    "summary": "Clean Fetch",
    "description": "Fetch any public web page and get clean main-content Markdown (Readability extraction), title, byline, excerpt and up to 100 absolute outbound links, as JSON. Follows redirects; max_chars up to 200000.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.010000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "description": "http(s) URL",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "max_chars",
      "in": "query",
      "required": false,
      "description": "truncate markdown (default 60000)",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/gas": {
   "get": {
    "operationId": "v1_evm_gas",
    "summary": "Gas Snapshot",
    "description": "Gas snapshot for Ethereum, Base, Arbitrum, Optimism, Polygon and BSC in one call: gas price, EIP-1559 base fee, priority fee suggestion, block height and head age.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.010000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/tx": {
   "get": {
    "operationId": "v1_evm_tx",
    "summary": "Tx Decoder",
    "description": "Decode one transaction on Ethereum, Base, Arbitrum, Optimism, Polygon or BSC: status, from, to, value, gas used, fee, block time and every ERC-20 Transfer in its logs with symbol/decimals resolved. Use it to prove a payment happened.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.030000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "ethereum|base|arbitrum|optimism|polygon|bsc (default base)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "hash",
      "in": "query",
      "required": true,
      "description": "0x tx hash",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/token": {
   "get": {
    "operationId": "v1_evm_token",
    "summary": "Token Facts",
    "description": "ERC-20 token facts on Ethereum, Base, Arbitrum, Optimism, Polygon or BSC: name, symbol, decimals, total supply, contract check, and optionally the balance of one holder.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.010000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "default base",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "token",
      "in": "query",
      "required": true,
      "description": "0x token contract",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "holder",
      "in": "query",
      "required": false,
      "description": "optional 0x holder",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/demo": {
   "get": {
    "operationId": "demo",
    "summary": "Free sample",
    "security": [],
    "responses": {
     "200": {
      "description": "ok"
     }
    }
   }
  },
  "/v1/weather": {
   "get": {
    "operationId": "v1_evm_gas",
    "summary": "Weather for any city or lat/lon in one call: current conditions, next 24 hours hourly (temp, wind, humidity, cloud, precipitation, symbol) and ~9-day daily min/max/precip. Data: MET Norway (CC BY 4.0) + OSM Nominatim geocoding.",
    "description": "Weather for any city or lat/lon in one call: current conditions, next 24 hours hourly (temp, wind, humidity, cloud, precipitation, symbol) and ~9-day daily min/max/precip. Data: MET Norway (CC BY 4.0) + OSM Nominatim geocoding.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.003000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lat",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "lon",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Weather for any city or lat/lon in one call: current conditions, next 24 hours hourly (temp, wind, humidity, cloud, precipitation, symbol) and ~9-day daily min/max/precip. Data: MET Norway (CC BY 4.0) + OSM Nominatim geocoding.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Weather for any city or lat/lon in one call: current conditions, next 24 hours hourly (temp, wind, humidity, cloud, precipitation, symbol) and ~9-day daily min/max/precip. Data: MET Norway (CC BY 4.0) + OSM Nominatim geocoding."
     }
    }
   }
  },
  "/v1/price": {
   "get": {
    "operationId": "v1_evm_gas",
    "summary": "Live USD prices straight from Chainlink Data Feeds on Ethereum mainnet (ETH, BTC, SOL, BNB, LINK, AAVE, UNI, POL, USDC, USDT, DAI): price, feed address, last update time and age. Oracle-grade, no API-key aggregator.",
    "description": "Live USD prices straight from Chainlink Data Feeds on Ethereum mainnet (ETH, BTC, SOL, BNB, LINK, AAVE, UNI, POL, USDC, USDT, DAI): price, feed address, last update time and age. Oracle-grade, no API-key aggregator.",
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.002000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "symbols",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "comma list, e.g. ETH,BTC"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Live USD prices straight from Chainlink Data Feeds on Ethereum mainnet (ETH, BTC, SOL, BNB, LINK, AAVE, UNI, POL, USDC, USDT, DAI): price, feed address, last update time and age. Oracle-grade, no API-key aggregator.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Live USD prices straight from Chainlink Data Feeds on Ethereum mainnet (ETH, BTC, SOL, BNB, LINK, AAVE, UNI, POL, USDC, USDT, DAI): price, feed address, last update time and age. Oracle-grade, no API-key aggregator."
     }
    }
   }
  },
  "/v1/report/token": {
   "get": {
    "operationId": "v1_report_token",
    "summary": "Token due-diligence report ($0.25)",
    "description": "ERC-20 due diligence: metadata, supply, proxy/upgradeability, owner, paused, last-15-min transfer activity, Chainlink price, risk flags.",
    "x-payment-info": {
     "price": "0.25",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "token",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/report/wallet": {
   "get": {
    "operationId": "v1_report_wallet",
    "summary": "Wallet due-diligence report ($0.25)",
    "description": "6-chain wallet due diligence: balances, USD estimate, tx counts, contract/EIP-7702 detection, recent inflows, risk flags.",
    "x-payment-info": {
     "price": "0.25",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/token/verdict": {
   "post": {
    "operationId": "v1_token_verdict",
    "summary": "Token Verdict ($0.01)",
    "description": "One-line on-chain token verdict with grade, score, reasons, Base DEX liquidity.",
    "x-payment-info": {
     "price": "0.01",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "tokenAddress"
        ],
        "properties": {
         "tokenAddress": {
          "type": "string"
         },
         "chain": {
          "type": "string"
         }
        }
       },
       "example": {
        "tokenAddress": "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed"
       }
      }
     }
    }
   }
  },
  "/v1/evm/balance": {
   "get": {
    "operationId": "v1_evm_balance",
    "summary": "Wallet Token Balance ($0.002)",
    "description": "Balance of one wallet on Ethereum, Base, Arbitrum, Optimism, Polygon or BSC: native coin, or any ERC-20 (pass token=0x...), with symbol, decimals, formatted and raw amounts and block number. Live RPC with fallbacks.",
    "x-payment-info": {
     "price": "0.002",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "ethereum|base|arbitrum|optimism|polygon|bsc (default base)",
      "schema": {
       "type": "string"
      },
      "example": "base"
     },
     {
      "name": "address",
      "in": "query",
      "required": false,
      "description": "wallet 0x...",
      "schema": {
       "type": "string"
      },
      "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
     },
     {
      "name": "token",
      "in": "query",
      "required": false,
      "description": "optional ERC-20 contract",
      "schema": {
       "type": "string"
      },
      "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/name/resolve": {
   "get": {
    "operationId": "v1_name_resolve",
    "summary": "ENS + Basename Resolver ($0.003)",
    "description": "Resolve an ENS name (incl. wildcard and CCIP-read off-chain resolvers) or a Basename (name.base.eth, Base registry) to an address, or an address to its verified ENS primary name. Returns found=false for unregistered names.",
    "x-payment-info": {
     "price": "0.003",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": false,
      "description": "ENS name or basename",
      "schema": {
       "type": "string"
      },
      "example": "jesse.base.eth"
     },
     {
      "name": "address",
      "in": "query",
      "required": false,
      "description": "or 0x address for reverse lookup",
      "schema": {
       "type": "string"
      },
      "example": null
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/code": {
   "get": {
    "operationId": "v1_evm_code",
    "summary": "Contract or EOA Check ($0.002)",
    "description": "Is this address a contract, a plain EOA, or an EIP-7702 delegated EOA? On Ethereum, Base, Arbitrum, Optimism, Polygon or BSC: bytecode size, 7702 delegate target, upgradeable-proxy slots (EIP-1967 implementation/admin/beacon, legacy Zeppelin) and nonce.",
    "x-payment-info": {
     "price": "0.002",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "ethereum|base|arbitrum|optimism|polygon|bsc",
      "schema": {
       "type": "string"
      },
      "example": "base"
     },
     {
      "name": "address",
      "in": "query",
      "required": false,
      "description": "0x...",
      "schema": {
       "type": "string"
      },
      "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/nonce": {
   "get": {
    "operationId": "v1_evm_nonce",
    "summary": "Next Nonce ($0.001)",
    "description": "Latest and pending transaction count for an address on Ethereum, Base, Arbitrum, Optimism, Polygon or BSC, the next nonce to use, and how many of its txs are pending.",
    "x-payment-info": {
     "price": "0.001",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "ethereum|base|arbitrum|optimism|polygon|bsc",
      "schema": {
       "type": "string"
      },
      "example": "base"
     },
     {
      "name": "address",
      "in": "query",
      "required": false,
      "description": "0x...",
      "schema": {
       "type": "string"
      },
      "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  },
  "/v1/evm/block": {
   "get": {
    "operationId": "v1_evm_block",
    "summary": "Block by Number or Time ($0.002)",
    "description": "Block header facts on Ethereum, Base, Arbitrum, Optimism, Polygon or BSC: by number, latest, or by timestamp (unix or ISO; returns the last block at or before that time via binary search). Number, hash, time, tx count, gas used, base fee.",
    "x-payment-info": {
     "price": "0.002",
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": false,
      "description": "ethereum|base|arbitrum|optimism|polygon|bsc",
      "schema": {
       "type": "string"
      },
      "example": "base"
     },
     {
      "name": "number",
      "in": "query",
      "required": false,
      "description": "block number or latest",
      "schema": {
       "type": "string"
      },
      "example": null
     },
     {
      "name": "timestamp",
      "in": "query",
      "required": false,
      "description": "unix seconds or ISO date",
      "schema": {
       "type": "string"
      },
      "example": "2026-01-01T00:00:00Z"
     }
    ],
    "responses": {
     "200": {
      "description": "JSON",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "402": {
      "description": "Payment Required"
     }
    }
   }
  }
 }
}