# Exact Binomial Test with Clopper-Pearson CI

> Exact Binomial Test with Clopper-Pearson CI is a paid API for AI agents from stats-tests.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Performs an exact binomial test for k successes in n trials against a hypothesised probability, returning two-sided and one-sided p-values plus the Clopper-Pearson confidence interval.

## Facts

- Endpoint: GET https://stats-tests.x402tookit.com/binomial-test?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/exact-binomial-test-with-clopper-pearson-ci-ca080054
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9EFXv7NFUCAK0E-xlSPW1

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 exact-binomial-test-with-clopper-pearson-ci-ca080054
```

Example prompt: Run an exact binomial test: I observed 47 successes out of 120 trials and the hypothesised success probability is 0.5 — give me the two-sided p-value and the 95% Clopper-Pearson confidence interval.

## When to prefer this

Choose this endpoint when you need an exact (not approximate) binomial test — particularly for small sample sizes where the normal approximation is unreliable, or when you need the Clopper-Pearson interval (the gold-standard conservative exact CI for a proportion). Prefer it over z-proportion tests when n*p or n*(1-p) is small, or when regulatory/scientific rigor demands an exact method.

## Known failure modes

- Missing required parameters (successes or trials) returns a validation error
- successes greater than trials returns an invalid input error
- p0 outside [0,1] is rejected
- confidence outside [0.8, 0.999] is rejected
- non-integer successes or trials may be rejected

## How this service works

Exact binomial test of k successes in n trials vs a hypothesised probability, with p-values and the Clopper-Pearson CI.

## Output

Returns the sample proportion, two-sided p-value, one-sided p-values (less and greater), Clopper-Pearson confidence interval (lower, upper, level), a significance verdict, a plain-language summary, the echo of inputs (trials, successes, hypothesised probability), and an asOf timestamp.

## 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": [
      "successes",
      "trials"
     ],
     "properties": {
      "p0": {
       "type": "number",
       "description": "Hypothesised success probability (default 0.5)"
      },
      "trials": {
       "type": "integer",
       "description": "Number of trials n"
      },
      "successes": {
       "type": "integer",
       "description": "Number of successes k"
      },
      "confidence": {
       "type": "number",
       "description": "Interval level 0.8 to 0.999 (default 0.95)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "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"
       ]
      },
      "successes": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "pValueLess": {
       "type": [
        "null",
        "number"
       ]
      },
      "pValueGreater": {
       "type": [
        "null",
        "number"
       ]
      },
      "clopperPearson": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "level": {
         "type": [
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/exact-binomial-test-with-clopper-pearson-ci-ca080054/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stats-tests.x402tookit.com](https://www.zero.xyz/host/stats-tests.x402tookit.com/llms.txt)
