# Bayes' Theorem Posterior Probability Calculator

> Bayes' Theorem Posterior 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).

Computes posterior probability from a prior, sensitivity, and false-positive rate using Bayes' theorem, with natural frequencies and odds form output.

## Facts

- Endpoint: GET https://probability-calc.x402tookit.com/bayes?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/bayes-theorem-posterior-probability-calculator-49177115
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wF-y8DW8K-pvSe2Los61c

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 bayes-theorem-posterior-probability-calculator-49177115
```

Example prompt: Using Bayes' theorem, what's the posterior probability that someone actually has a disease if the base rate (prevalence) is 1% (0.01), the test sensitivity is 90% (0.9), and the false positive rate is 5% (0.05)? Also show me the natural frequencies for a population of 10000.

## When to prefer this

Choose this endpoint when you need to perform Bayesian inference from a prior probability, sensitivity, and false-positive rate — especially for medical testing, diagnostic accuracy, or any scenario where you want to update a belief with new evidence. It is ideal when you need natural frequency representations alongside the probability, or when working with non-statisticians who benefit from plain-language summaries. Prefer this over manual calculation when you need both odds form and probability form simultaneously.

## Known failure modes

- Missing required parameters (prior or sensitivity) returns a 400 error
- Prior, sensitivity, specificity, or falsePositiveRate outside [0,1] range returns a validation error
- Providing neither specificity nor falsePositiveRate may result in an incomplete computation
- Population set to 0 or negative integer causes a computation error
- Conflicting specificity and falsePositiveRate values (where fpr != 1 - specificity) may be flagged or one ignored

## How this service works

Bayes' theorem: posterior probability from a prior, sensitivity and false-positive rate, with natural frequencies and odds form.

## Output

Returns posterior probability (P(hypothesis|evidence)), prior and posterior odds, specificity and false positive rate, and a natural frequencies breakdown (true positives, false positives, true negatives, false negatives) for the specified population, along with a plain-language summary and verdict.

## 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": [
      "prior",
      "sensitivity"
     ],
     "properties": {
      "prior": {
       "type": "number",
       "description": "Prior probability of the hypothesis (prevalence or base rate), 0 to 1"
      },
      "population": {
       "type": "integer",
       "description": "Population for natural frequencies (default 10000)"
      },
      "sensitivity": {
       "type": "number",
       "description": "P(positive evidence | hypothesis true), 0 to 1 (true positive rate)"
      },
      "specificity": {
       "type": "number",
       "description": "Or P(negative evidence | hypothesis false); false positive rate = 1 - specificity"
      },
      "falsePositiveRate": {
       "type": "number",
       "description": "P(positive evidence | hypothesis false), 0 to 1 (give this or specificity)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "prior": {
       "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"
       ]
      },
      "priorOdds": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "sensitivity": {

… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bayes-theorem-posterior-probability-calculator-49177115/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)
