{
  "openapi": "3.1.0",
  "info": {
    "title": "FabTally Guard — de-risk-a-dollar verification for agents",
    "version": "1.0.0",
    "description": "Cheap per-call checks an AI agent runs BEFORE a costly action: deps-check (vet a package for CVEs/typosquats/deprecation before installing), x402-preflight (verify another x402 endpoint's 402 challenge and price before paying it), json-repair (coerce near-miss LLM JSON to a schema), and url-read (public url -> clean Markdown + token count for RAG). 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.",
    "x-guidance": "Paid (x402 USDC on Base, or prepaid X-FabTally-Key): POST /v1/deps-check ($0.003), /v1/x402-preflight ($0.002), /v1/json-repair ($0.002), /v1/url-read ($0.004) — 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.",
    "contact": {
      "email": "hello@fabtally.com"
    }
  },
  "servers": [
    {
      "url": "https://guard.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/deps-check": {
      "post": {
        "operationId": "deps_check",
        "summary": "deps-check (paid, $0.003 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Vet a software package BEFORE installing it. Give {ecosystem: npm|pypi|crates, name, version?}; get existence, latest-vs-requested, deprecation/yank markers, known CVEs from OSV.dev, typosquat similarity to popular names, SPDX license, and age/download signals with a plain-English risk verdict. 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://guard.fabtally.com/v1/deps-check",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "ecosystem": "npm",
                "name": "lodash",
                "version": "4.17.20"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/deps-check/free": {
      "post": {
        "operationId": "deps_check_free",
        "summary": "deps-check — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for deps-check (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "ecosystem": "npm",
                "name": "lodash",
                "version": "4.17.20"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/x402-preflight": {
      "post": {
        "operationId": "x402_preflight",
        "summary": "x402-preflight (paid, $0.002 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Verify another x402 endpoint BEFORE paying it. Give {url}; get whether an unpaid call returns a valid x402 v2 402 challenge, whether the quoted amount/asset/network/payTo match the site's /.well-known/x402, TLS validity, reachability, and openapi presence — plus the parsed price you would pay. 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://guard.fabtally.com/v1/x402-preflight",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://belt.fabtally.com/v1/timezone"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/x402-preflight/free": {
      "post": {
        "operationId": "x402_preflight_free",
        "summary": "x402-preflight — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for x402-preflight (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://belt.fabtally.com/v1/timezone"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/json-repair": {
      "post": {
        "operationId": "json_repair",
        "summary": "json-repair (paid, $0.002 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Coerce near-miss LLM JSON to a JSON-Schema-conformant object: strip code fences/prose, fix trailing commas/quotes/unquoted keys, normalise Python literals, balance brackets, then coerce types, apply defaults, and drop extraneous keys. Give {json (string), schema}; get the repaired object OR precise per-field errors.",
        "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://guard.fabtally.com/v1/json-repair",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "json": "{'name':'Ada', age:'37', extra:1,}",
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "age"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "age": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/json-repair/free": {
      "post": {
        "operationId": "json_repair_free",
        "summary": "json-repair — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for json-repair (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "json": "{'name':'Ada', age:'37', extra:1,}",
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "age"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "age": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    },
    "/v1/url-read": {
      "post": {
        "operationId": "url_read",
        "summary": "url-read (paid, $0.004 USDC on Base)",
        "tags": [
          "Paid"
        ],
        "description": "Fetch a PUBLIC url and return clean Markdown + a token estimate for RAG ingestion — readability extraction, boilerplate stripped. Give {url}; get title, Markdown, token/char/word counts. Respects robots.txt, public pages only, no login/paywall bypass, nothing stored.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.004000"
          },
          "protocols": [
            {
              "x402": {
                "scheme": "exact",
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "maxAmountRequired": "4000",
                "payTo": "0xccB5d25C698FdfdaA7B21d54088774cF512A90e3",
                "resource": "https://guard.fabtally.com/v1/url-read",
                "facilitator": "https://facilitator.daydreams.systems",
                "maxTimeoutSeconds": 60
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com/"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (never charged)"
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge)"
          }
        }
      }
    },
    "/v1/url-read/free": {
      "post": {
        "operationId": "url_read_free",
        "summary": "url-read — rate-limited free teaser",
        "tags": [
          "Free"
        ],
        "security": [],
        "description": "Free teaser for url-read (daily per-IP quota).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com/"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Teaser result"
          },
          "429": {
            "description": "Free daily quota exceeded"
          }
        }
      }
    }
  }
}