# Security Math – Birthday Collision Probability

> Security Math – Birthday Collision Probability 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 birthday-problem collision probabilities for random IDs or hash outputs, or computes how many items are needed to reach a target collision probability.

## Facts

- Endpoint: GET https://security-math.x402tookit.com/birthday-collision?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-birthday-collision-probability-f858b8a8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aTToA_Fgf1iKe43vibP8M

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-birthday-collision-probability-f858b8a8
```

Example prompt: What's the birthday collision probability if I generate 1 million random IDs using a base62 alphabet with length 12 — and how many can I safely generate before hitting a 1% collision chance?

## When to prefer this

Use this endpoint when you need to mathematically quantify birthday-problem collision risk for random identifiers, tokens, hashes, or any discrete random space. Prefer it over generic probability calculators when the specific use case is collision detection for security-relevant IDs, since it understands bit-space sizing, base-N alphabets, and returns security-oriented summaries and verdicts. Ideal for developers auditing their ID generation schemes, security reviewers assessing token entropy adequacy, or agents reasoning about whether a random space is large enough for a given scale.

## Known failure modes

- Missing required parameter combination — must provide either (bits or space or alphabetSize+idLength) plus either items or probability; returns error if insufficient parameters
- Probability out of range — probability must be strictly between 0 and 1 exclusive
- Space too small — extremely small bit sizes may produce degenerate results
- Invalid bits value — non-positive or non-numeric bits parameter rejected
- Conflicting parameters — providing both items and probability simultaneously may be ambiguous

## How this service works

Birthday-problem collision odds for random IDs or hash outputs, or the count of items that reaches a target probability.

## Output

Returns the collision probability given a space size and item count, or the number of items needed to reach a target probability. Includes the computed space size in bits, a human-readable summary and verdict, the method used, and a disclaimer. Fields: space, spaceBits, targetProbability, itemsNeeded, itemsNeededMethod, summary, verdict, source, asOf, degraded, reasons, notChecked, disclaimer.

## 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": [],
     "properties": {
      "bits": {
       "type": "number",
       "description": "Size of the ID or hash space in bits (e.g. 32, 64, 122 for UUIDv4, 128, 256); or use alphabetSize and idLength"
      },
      "items": {
       "type": "number",
       "description": "Number of items generated: returns the collision probability"
      },
      "space": {
       "type": "number",
       "description": "Or the number of possibilities directly (e.g. 365 for days in a year)"
      },
      "idLength": {
       "type": "integer",
       "description": "Length of the random string ID, with alphabetSize"
      },
      "probability": {
       "type": "number",
       "description": "Target collision probability, 0 to 1 exclusive: returns the number of items needed"
      },
      "alphabetSize": {
       "type": "integer",
       "description": "Alphabet size of a random string ID (e.g. 62 for base62, 10 for digits); with idLength"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "space": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "spaceBits": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
      
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/security-math-birthday-collision-probability-f858b8a8/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)
