# Security Math – Bloom Filter Sizing

> Security Math – Bloom Filter Sizing is a paid API for AI agents from security-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Calculates optimal Bloom filter parameters (bits, bytes, hash count, false-positive rate) given item count and target false-positive probability, or evaluates a given filter size.

## Facts

- Endpoint: GET https://security-math.x402tookit.com/bloom-filter?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/security-math-bloom-filter-sizing-82b028ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f6Lb-08XoJydBOdjGSmba

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability security-math-bloom-filter-sizing-82b028ca
```

Example prompt: What are the optimal Bloom filter parameters for storing 5 million items at a 0.1% false-positive rate — give me the bits, bytes, and ideal hash function count?

## When to prefer this

Use this endpoint when you need mathematically precise Bloom filter sizing — specifically when you want to derive bits, bytes, and hash count from item count and false-positive probability (or vice versa), rather than estimating by rule of thumb. Prefer it over generic calculators when you need the full parameter set (mBits, mBytes, optimalK, fill ratio, bitsPerItem) in a machine-readable format suitable for automated infrastructure sizing or system design decisions.

## Known failure modes

- Missing required parameter n returns an error
- n outside range 1 to 1e12 is rejected
- Neither p nor mBits provided may result in incomplete or default calculation
- p outside valid probability range (0,1) causes error
- Non-numeric values for numeric parameters cause validation failure

## How this service works

Bloom filter sizing: bits, bytes and hash count for n items at a false-positive rate, or the rate for a given size.

## Output

Returns a structured object with the computed filter size in bits (mBits) and bytes (mBytes), optimal hash function count (optimalK), actual hash count used (kUsed), resulting false-positive rate, bits per item, fill ratio, target false-positive rate, and a human-readable summary string. May include degraded flag, reasons, verdict, and disclaimer fields.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "n"
     ],
     "properties": {
      "k": {
       "type": "integer",
       "description": "Hash function count to evaluate (default: the optimum)"
      },
      "n": {
       "type": "number",
       "description": "Number of items to store, 1 to 1e12"
      },
      "p": {
       "type": "number",
       "description": "Target false-positive probability, e.g. 0.01 (give p or mBits)"
      },
      "mBits": {
       "type": "number",
       "description": "Or the filter size in bits to evaluate"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "human": {
       "type": [
        "null",
        "string"
       ]
      },
      "items": {
       "type": [
        "null",
        "number"
       ]
      },
      "kUsed": {
       "type": [
        "null",
        "number"
       ]
      },
      "mBits": {
       "type": [
        "null",
        "number"
       ]
      },
      "mBytes": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "optimalK": {
       "type": [
        "null",
        "number"
       ]
      },
      "fillRatio": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/security-math-bloom-filter-sizing-82b028ca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from security-math.x402tookit.com](https://www.zero.xyz/host/security-math.x402tookit.com/llms.txt)
