{
  "openapi": "3.1.0",
  "info": {
    "title": "FabTally Decode — on-chain decoder for developers & agents",
    "version": "1.0.0",
    "description": "Per-call decoding reads that turn raw EVM bytes into human-readable JSON — the capability buried inside $49-999/mo RPC plans: decode-log (event LOGS -> event name + typed named args, nailing tuple/array/nested/anonymous/indexed cases), decode-calldata (function call -> signature + typed args), selector-lookup (4-byte selector or event topic -> signature), abi-fetch (verified ABI + proxy resolution). No ABI needed — resolves via Sourcify/Blockscout verified source + 4byte.directory. All read-only, keyless, stateless, descriptive. Paid via x402 (USDC on Base) or a prepaid credit key; each has a rate-limited free teaser. Also available as an MCP server. Chains: ethereum, base, arbitrum, optimism, polygon, bsc.",
    "x-guidance": "Paid (x402 USDC on Base, or prepaid X-FabTally-Key): POST /v1/decode-log ($0.003), /v1/decode-calldata ($0.002), /v1/selector-lookup ($0.001), /v1/abi-fetch ($0.002) — each has a rate-limited /free teaser. Unpaid paid-calls return an x402 402 challenge; pay and retry with the X-PAYMENT header. Bad input -> 400, never charged. Chains: ethereum, base, arbitrum, optimism, polygon, bsc.",
    "contact": {
      "email": "hello@fabtally.com"
    }
  },
  "servers": [
    {
      "url": "https://decode.fabtally.com"
    }
  ],
  "paths": {
    "/agent/overview": {
      "get": {
        "operationId": "overview",
        "summary": "Capabilities, pricing, payment info (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Overview"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Health (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/decode-log": {
      "post": {
        "operationId": "decode_log",
        "summary": "decode-log (paid, $0.003 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Decode EVM event LOGS to human-readable JSON. Give {chain, tx_hash} to decode every log in a transaction, OR {chain, address, topics[], data} for a single log; optional {abi}. Returns each event's name, canonical signature, and named/typed args — correctly handling tuple/array/nested params, anonymous events, and indexed vs non-indexed. Resolves the ABI via Sourcify/Blockscout verified source + 4byte event signatures when none is supplied. Read-only, stateless.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "3000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://decode.fabtally.com/v1/decode-log",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "tx_hash": "0x…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/decode-log/free": {
      "post": {
        "operationId": "decode_log_free",
        "summary": "decode-log — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for decode-log (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "tx_hash": "0x…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/decode-calldata": {
      "post": {
        "operationId": "decode_calldata",
        "summary": "decode-calldata (paid, $0.002 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Decode a contract function call. Give {chain, to?, data, abi?}; get the 4-byte selector resolved to a function signature (via provided ABI, the verified contract source, or 4byte.directory) plus fully decoded, typed arguments (tuples/arrays/nested included). Read-only, stateless.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "2000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://decode.fabtally.com/v1/decode-calldata",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045000000000000000000000000000000000000000000000000000000003b9aca00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/decode-calldata/free": {
      "post": {
        "operationId": "decode_calldata_free",
        "summary": "decode-calldata — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for decode-calldata (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045000000000000000000000000000000000000000000000000000000003b9aca00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/selector-lookup": {
      "post": {
        "operationId": "selector_lookup",
        "summary": "selector-lookup (paid, $0.001 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Resolve a 4-byte function selector (0x + 8 hex) OR a 32-byte event topic hash (0x + 64 hex) to its human-readable signature(s) via 4byte.directory + openchain.xyz. Returns all matches (selectors can collide) with a verified flag. Read-only, stateless.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "1000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://decode.fabtally.com/v1/selector-lookup",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "selector": "0xa9059cbb"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/selector-lookup/free": {
      "post": {
        "operationId": "selector_lookup_free",
        "summary": "selector-lookup — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for selector-lookup (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "selector": "0xa9059cbb"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/abi-fetch": {
      "post": {
        "operationId": "abi_fetch",
        "summary": "abi-fetch (paid, $0.002 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Fetch the verified ABI + metadata for a contract. Give {address, chain}; get the ABI JSON, verification status/source (Sourcify or Blockscout), the callable function/event signatures, and full proxy-implementation resolution (EIP-1967/1822/OZ-legacy/beacon) — returning the implementation's ABI when it's a proxy. Read-only, stateless.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "2000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://decode.fabtally.com/v1/abi-fetch",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/abi-fetch/free": {
      "post": {
        "operationId": "abi_fetch_free",
        "summary": "abi-fetch — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for abi-fetch (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "chain": "ethereum",
                "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    }
  }
}