Integrate the MiniWebtool Contingency Table Calculator API into this project.

## Your task

1. Read the reference below.
2. Ask me where this belongs in the codebase if it is not obvious.
3. Write the integration in the language and style of the surrounding code:
   a small typed client function, errors handled, key read from the
   environment (never hard-coded, never committed).
4. Verify with `/dry-run` first, then exactly one live call.
5. Show me the diff and the live result.

## Credit budget — follow these exactly

This API is metered. A live call costs 1 credit; the free tier
includes 1,000 credits per month. Burning them during integration is the
single most common way to waste this key.

1. **Do all wiring against `/dry-run`, which costs 0 credits.** It validates the
   payload for real and returns a sample result with the exact response shape.
   Iterate there until your request builds and your parsing works.
2. **Make at most ONE live `/run` call** — a single end-to-end confirmation once
   dry-run passes. Print the result, then stop.
3. **Never call the API from unit tests, examples, or a retry loop.** Assert
   against the sample response captured from `/dry-run` instead.
4. **On 4xx, fix the payload — do not retry.** The error body is RFC 7807
   `application/problem+json` and says exactly what is wrong.
5. **On 429, honour `Retry-After`** and back off; do not tighten the loop.
6. **Read `X-MWT-Credits-Remaining`** on every response. If it drops below 50,
   stop making live calls and tell me.
7. If the integration needs repeated calls at runtime, **cache by input** — this
   tool is deterministic, so the same input always returns the same output.

## The API

**Contingency Table Calculator** — Chi-square test of independence for an r x c contingency table with expected counts, standardized residuals, cell contributions, and Cramer's V.

- Live endpoint: `POST https://api.miniwebtool.com/v1/tools/contingency-table-calculator/run` — costs 1 credit
- Dry run: `POST https://api.miniwebtool.com/v1/tools/contingency-table-calculator/dry-run` — costs 0 credits, same auth and validation
- Auth: `Authorization: Bearer <MINIWEBTOOL_API_KEY>`
- Content type: `application/json`
- Tool version: `2026-04-22` (output shape is stable within a major version)
- Full machine-readable spec: `https://api.miniwebtool.com/v1/openapi.json`

### Request body

| field | type | required | notes |
|---|---|---|---|
| `table` | str | no | observed counts, one row per line, values separated by commas or spaces (default `20, 30, 25
15, 40, 20`) |
| `row_labels` | str | no | optional comma-separated row labels |
| `column_labels` | str | no | optional comma-separated column labels |
| `yates_correction` | str | no | one of: auto, yes, no — auto \| yes \| no (default `auto`) |
| `alpha` | str | no | one of: 0.05, 0.01, 0.10 — 0.05 \| 0.01 \| 0.10 (default `0.05`) |
| `precision` | int | no | decimal places, 2-10 (default `4`) |

Example request body:

```json
{
  "table": "20, 30, 25\n15, 40, 20",
  "alpha": "0.05"
}
```

### Response envelope

```json
{
  "request_id": "req_01H…",
  "tool": "contingency-table-calculator",
  "tool_version": "2026-04-22",
  "credits_used": 1,
  "result": {
    "rows": 2,
    "columns": 3,
    "row_labels": [
      "Row 1",
      "Row 2"
    ],
    "column_labels": [
      "Column 1",
      "Column 2",
      "Column 3"
    ],
    "observed": [
      [
        20,
        30,
        25
      ],
      [
        15,
        40,
        20
      ]
    ],
    "expected": [
      [
        17.5,
        35.0,
        22.5
      ],
      [
        17.5,
        35.0,
        22.5
      ]
    ],
    "row_totals": [
      75,
      75
    ],
    "column_totals": [
      35,
      70,
      45
    ],
    "grand_total": 150,
    "degrees_of_freedom": 2,
    "yates_correction_applied": false,
    "chi_square_statistic": 2.6984,
    "p_value": 0.2594460886,
    "p_value_formatted": "0.2594",
    "alpha": 0.05,
    "is_significant": false,
    "conclusion": "Fail to reject the null hypothesis: no evidence of association",
    "critical_value": 5.9915,
    "cramers_v": 0.1341,
    "effect_size_rating": "small",
    "phi_coefficient": null,
    "contingency_coefficient": 0.1329,
    "cell_contributions": [
      [
        0.3571,
        0.7143,
        0.2778
      ],
      [
        0.3571,
        0.7143,
        0.2778
      ]
    ],
    "standardized_residuals": [
      [
        0.9652,
        -1.6366,
        0.8909
      ],
      [
        -0.9652,
        1.6366,
        -0.8909
      ]
    ],
    "min_expected_count": 17.5,
    "cells_with_expected_below_5": 0,
    "expected_count_assumption_met": true
  }
}
```

`result` holds the tool output. Errors come back as
`application/problem+json` with `type`, `title`, `status`, and `detail`.

### Getting a key

If `MINIWEBTOOL_API_KEY` is not already in the environment, stop and ask me for
one — do not sign up, scrape, or guess a key. Free keys: https://api.miniwebtool.com/dashboard/
