# Streak Probability Calculator

> Streak Probability Calculator is a paid API for AI agents from probability-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Calculates the probability of getting a run of r consecutive identical outcomes somewhere within n independent trials (e.g. coin flips).

## Facts

- Endpoint: GET https://probability-calc.x402tookit.com/streak-odds?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/streak-probability-calculator-edb0e0b3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jO4HwqOtYqjkpa757YhGF

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 streak-probability-calculator-edb0e0b3
```

Example prompt: What's the probability of getting heads 7 times in a row somewhere in 200 coin flips? Use a fair coin (p=0.5) and check for a run of successes.

## When to prefer this

Use this endpoint when you need to compute the probability that a consecutive run of r identical or successful outcomes occurs at least once within n independent trials — particularly for coin-flip-style binary experiments. Prefer this over general binomial calculators when the user cares about streaks or consecutive sequences rather than total counts of successes.

## Known failure modes

- Missing required parameters n or r returns an error
- r greater than n is invalid and returns an error
- n out of range (above 5000 or below 1) returns a validation error
- p outside [0,1] returns an error
- Invalid kind value (not 'heads' or 'either') returns an error

## How this service works

Chance of a run: r successes in a row (or r identical outcomes) somewhere in n independent trials, like coin flips.

## Output

Returns the calculated probability (0–1) of a streak of length r occurring in n trials, a one-in-N representation of those odds, the typical longest expected run, a plain-English summary and verdict, and optionally a disclaimer and degraded flag if the computation was approximate.

## 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",
      "r"
     ],
     "properties": {
      "n": {
       "type": "integer",
       "description": "Number of trials, 1 to 5000"
      },
      "p": {
       "type": "number",
       "description": "Probability of success on each trial (default 0.5)"
      },
      "r": {
       "type": "integer",
       "description": "Streak length wanted, 1 to n"
      },
      "kind": {
       "type": "string",
       "description": "heads (a run of successes, default) or either (a run of identical outcomes, both kinds)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "p": {
       "type": [
        "null",
        "number"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "kind": {
       "type": [
        "null",
        "string"
       ]
      },
      "oneIn": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "trials": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "probability": {
       "type": [
        "null",
        "number"
       ]
      },
      "streakLength": {
       "type": [
        "
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/streak-probability-calculator-edb0e0b3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from probability-calc.x402tookit.com](https://www.zero.xyz/host/probability-calc.x402tookit.com/llms.txt)
