{
  "openapi": "3.0.3",
  "info": {
    "title": "Base Chain Read API",
    "version": "1.0.0",
    "description": "Base Chain Read API (x402, pay per call, USDC on Base)\n\nPay $0.001-$0.01 per call. No account, no API key. Live reads from public Base RPC.\n\nCopy-paste (returns HTTP 402 with x402 payment requirements; pay with an x402 client):\n  curl -i \"https://agent-b-production-8ff6fffc.up.railway.app/chain/base/balance?id=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"\n\n  GET /chain/base/balance?id=<wallet>   native ETH balance\n  GET /chain/base/wallet?id=<wallet>    ETH + USDC balance, nonce, contract flag\n  See /openapi.json for the full list.\n\nUnpaid requests get HTTP 402 with x402 v2 payment requirements (PAYMENT-REQUIRED header).\nInvalid ids return 400 and are not charged. Discovery: /openapi.json, /llms.txt, /.well-known/x402.\nFree demo (no payment, fixed CNPJ): https://agent-b-production-8ff6fffc.up.railway.app/demo/cnpj\nResults are live onchain reads with block number and retrieval time in each response.\n",
    "contact": {
      "name": "Base Chain Read API",
      "url": "https://agent-b-production-8ff6fffc.up.railway.app",
      "email": "latamfxdata@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://agent-b-production-8ff6fffc.up.railway.app"
    }
  ],
  "paths": {
    "/chain/base/token": {
      "get": {
        "summary": "Base (chain 8453) token risk check: ERC-20 name/symbol/decimals/totalSupply, EIP-1967 proxy flag, owner renounced, paused, mint and blacklist selector flags, heuristic verdict safe/caution/danger with reasons. JSON from public RPC, not an audit.",
        "operationId": "chain_base/token",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/wallet": {
      "get": {
        "summary": "Base (chain 8453) wallet lookup: native ETH balance, USDC balance, transaction nonce, contract-or-EOA flag and latest block, via JSON-RPC. Onchain wallet data for agents, normalized JSON.",
        "operationId": "chain_base/wallet",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/balance": {
      "get": {
        "summary": "Base (chain 8453) native ETH balance for an EVM address at the latest block, normalized JSON.",
        "operationId": "chain_base/balance",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/erc20-balance": {
      "get": {
        "summary": "Base (chain 8453) ERC-20 balance for a wallet. Optional query param token=<contract>, default USDC. Returns symbol, decimals, raw units and formatted value.",
        "operationId": "chain_base/erc20-balance",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/nonce": {
      "get": {
        "summary": "Base (chain 8453) transaction count (nonce) for an EVM address at the latest block.",
        "operationId": "chain_base/nonce",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/total-supply": {
      "get": {
        "summary": "Base (chain 8453) ERC-20 totalSupply with symbol and decimals. id is the token contract address.",
        "operationId": "chain_base/total-supply",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/block-number": {
      "get": {
        "summary": "Base (chain 8453) latest block number. The id parameter is ignored.",
        "operationId": "chain_base/block-number",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "latest"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/chain/base/usdc-transfers": {
      "get": {
        "summary": "Base (chain 8453) USDC transfers in and out of a wallet over the last 500 blocks (eth_getLogs). Optional query param to=<address> keeps only transfers between the two wallets. Max 50 rows.",
        "operationId": "chain_base/usdc-transfers",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result (JSON)"
          },
          "400": {
            "description": "Invalid id"
          },
          "402": {
            "description": "Payment required (x402 v2)"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    }
  }
}