{
  "openapi": "3.1.0",
  "info": {
    "title": "FabTally Safe — read-only crypto safety & signature verification API",
    "version": "1.0.0",
    "description": "Pay-per-call read-only crypto safety. Multi-chain token honeypot/rug check (GoPlus + honeypot.is, 0-100 risk score), EIP-712 / Permit / Permit2 / Seaport signature decode, approval-risk scan with self-executed revoke calldata, and keyless pre-sign transaction simulation. Settlement via x402 (USDC on Base) or a prepaid X-FabTally-Key credit. Descriptive only — not financial advice.",
    "x-guidance": "Paid JSON endpoints (x402, USDC on Base): POST /v1/token-safety {address, chain} ($0.02); POST /v1/decode-signature {typed_data} ($0.01); POST /v1/approvals {address, chain} ($0.01); POST /v1/simulate {chain, to, data, from?, value?} ($0.02). Free teasers: append /free to each. Unpaid paid-calls return an x402 402 challenge; pay and retry, or use a prepaid X-FabTally-Key header. Read-only — never holds funds, signs, or broadcasts.",
    "contact": {
      "email": "hello@fabtally.com"
    }
  },
  "servers": [
    {
      "url": "https://safe.fabtally.com"
    }
  ],
  "paths": {
    "/agent/overview": {
      "get": {
        "operationId": "overview",
        "summary": "Capabilities, pricing, payment info (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Overview"
          }
        }
      }
    },
    "/v1/token-safety": {
      "post": {
        "operationId": "token_safety",
        "summary": "Multi-chain token honeypot/rug check + 0-100 risk score (paid $0.02)",
        "tags": [
          "Paid"
        ],
        "description": "Multi-chain token honeypot / rug safety check. Give {address, chain} (ethereum, base, bsc, polygon, arbitrum, optimism) — aggregates GoPlus token-security + honeypot.is buy/sell-tax simulation into a normalized 0-100 risk score with plain-English, explainable reasons: honeypot / can't-sell, buy/sell tax, mint/blacklist/pausable/ownership privileges, top-holder concentration, LP-lock, contract verified/bytecode. Descriptive on-chain facts only — NOT a buy/sell signal, not financial advice.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "20000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://safe.fabtally.com/v1/token-safety",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "chain"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "0x token contract address."
                  },
                  "chain": {
                    "type": "string",
                    "description": "ethereum | base | bsc | polygon | arbitrum | optimism."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/token-safety/free": {
      "post": {
        "operationId": "token_safety_free",
        "summary": "Token safety — score band + top-line flags (FREE)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Token safety — score band + top-line flags (FREE)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "chain"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "0x token contract address."
                  },
                  "chain": {
                    "type": "string",
                    "description": "ethereum | base | bsc | polygon | arbitrum | optimism."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/decode-signature": {
      "post": {
        "operationId": "decode_signature",
        "summary": "Decode EIP-712 / Permit / Permit2 / Seaport signature (paid $0.01)",
        "tags": [
          "Paid"
        ],
        "description": "\"What am I signing\" — decode an off-chain EIP-712 typed-data signature (Permit / Permit2 / Seaport / generic) into plain English with risk flags: unlimited approval, unknown/known-malicious spender, never-expiring or already-expired deadlines, zero-consideration NFT-drain orders. Off-chain signatures are the top wallet-drainer vector; this is a pure-offline decode (no key, no broadcast).",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "10000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://safe.fabtally.com/v1/decode-signature",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 30
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "typed_data"
                ],
                "properties": {
                  "typed_data": {
                    "type": "object",
                    "description": "EIP-712 typed data: {domain, types, primaryType, message}. `eip712` also accepted."
                  },
                  "chain": {
                    "type": "string",
                    "description": "Optional chain override (else read from domain.chainId)."
                  }
                }
              }
            }
          }
        },
        "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-signature/free": {
      "post": {
        "operationId": "decode_signature_free",
        "summary": "Signature decode — type + summary + risk level (FREE)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Signature decode — type + summary + risk level (FREE)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "typed_data"
                ],
                "properties": {
                  "typed_data": {
                    "type": "object",
                    "description": "EIP-712 typed data: {domain, types, primaryType, message}. `eip712` also accepted."
                  },
                  "chain": {
                    "type": "string",
                    "description": "Optional chain override (else read from domain.chainId)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/approvals": {
      "post": {
        "operationId": "approvals",
        "summary": "Wallet approval-risk scan + revoke calldata (paid $0.01)",
        "tags": [
          "Paid"
        ],
        "description": "Wallet approval / allowance RISK scan. Give {address, chain} — lists every ERC-20/721 approval ranked by exposure, flags unlimited amounts + unverified/known-malicious spenders + address-poisoning 'fake-approval revoke bait', and returns the exact revoke calldata you execute YOURSELF (we never execute/broadcast).",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "10000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://safe.fabtally.com/v1/approvals",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "chain"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "0x wallet address to scan."
                  },
                  "chain": {
                    "type": "string",
                    "description": "ethereum | base | bsc | polygon | arbitrum | optimism."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/approvals/free": {
      "post": {
        "operationId": "approvals_free",
        "summary": "Approvals — counts + top-3 risks (FREE)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Approvals — counts + top-3 risks (FREE)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "chain"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "0x wallet address to scan."
                  },
                  "chain": {
                    "type": "string",
                    "description": "ethereum | base | bsc | polygon | arbitrum | optimism."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate": {
      "post": {
        "operationId": "simulate",
        "summary": "Keyless pre-sign transaction simulation (paid $0.02)",
        "tags": [
          "Paid"
        ],
        "description": "Keyless pre-sign transaction analysis. Give {chain, from, to, data, value?} — public-RPC eth_call revert check + static calldata decode predicting approval/transfer deltas + risk flags (unlimited approval, approval-for-all, reverts). Honest keyless limitation stated in the response (no full fork trace).",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "20000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://safe.fabtally.com/v1/simulate",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chain",
                  "to"
                ],
                "properties": {
                  "chain": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string",
                    "description": "0x sender (optional but improves accuracy)."
                  },
                  "to": {
                    "type": "string",
                    "description": "0x target contract/recipient."
                  },
                  "data": {
                    "type": "string",
                    "description": "0x calldata (omit for a plain value transfer)."
                  },
                  "value": {
                    "type": "string",
                    "description": "Value in wei (optional)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/simulate/free": {
      "post": {
        "operationId": "simulate_free",
        "summary": "Simulate — method + revert + risk level (FREE)",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Simulate — method + revert + risk level (FREE)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chain",
                  "to"
                ],
                "properties": {
                  "chain": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string",
                    "description": "0x sender (optional but improves accuracy)."
                  },
                  "to": {
                    "type": "string",
                    "description": "0x target contract/recipient."
                  },
                  "data": {
                    "type": "string",
                    "description": "0x calldata (omit for a plain value transfer)."
                  },
                  "value": {
                    "type": "string",
                    "description": "Value in wei (optional)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Health (free)",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}