# Delx Commerce — Expected Calibration Error (ECE) Calculator

> Delx Commerce — Expected Calibration Error (ECE) Calculator is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Computes the Expected Calibration Error (ECE) of a set of binary forecast probabilities against observed outcomes, returning a calibration quality score.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/calibration-ece?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-expected-calibration-error-ece-calculator-d1e5516b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eRLMZqYYVAoCHjDJV2Ka0

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 delx-commerce-expected-calibration-error-ece-calculator-d1e5516b -d '<json body>'
```

Example prompt: Can you compute the Expected Calibration Error for my binary classifier? I have 10 bins, forecasts of [0.1, 0.4, 0.8, 0.9] and actual outcomes of [0, 0, 1, 1].

## When to prefer this

Choose this endpoint when you need a quick, pay-per-call ECE computation without setting up your own calibration library or infrastructure. Ideal for AI agents that need on-demand probabilistic model evaluation as part of an automated ML pipeline, audit workflow, or model comparison task. At $0.001 USDC per call with no signup required, it is cost-effective for low-frequency or one-off calibration checks.

## Known failure modes

- Mismatched array lengths between forecasts and outcomes will likely cause an error or undefined behavior
- Forecast values outside [0,1] range are invalid inputs
- Invalid bins value (e.g. zero or negative integer) may cause computation failure
- Empty forecasts or outcomes arrays may return a null or error response
- Network or payment processing failure may result in no response

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object containing the ECE score (a float indicating average calibration error, lower is better), the number of samples (n) used in the calculation, and a schema identifier string (e.g. 'delx/util-calibration-ece/v1') for result provenance.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "bins": {
   "type": "integer",
   "description": "Number of calibration bins"
  },
  "outcomes": {
   "type": "array",
   "description": "Binary outcomes 0/1 aligned with forecasts"
  },
  "forecasts": {
   "type": "array",
   "description": "Forecast probabilities in [0,1]"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 4,
  "ece": 0.225,
  "schema": "delx/util-calibration-ece/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-expected-calibration-error-ece-calculator-d1e5516b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
