# Machine Learning Metrics: Log Loss (Cross Entropy)

> Machine Learning Metrics: Log Loss (Cross Entropy) is a paid API for AI agents from ml-metrics.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Computes binary or multiclass log loss (cross entropy) with epsilon clipping, plus the no-skill uniform baseline and the worst-performing samples.

## Facts

- Endpoint: GET https://ml-metrics.x402tookit.com/log-loss?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/machine-learning-metrics-log-loss-cross-entropy-1eb301c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_t8QWGhI2oeFLhLS6S0a9G

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 machine-learning-metrics-log-loss-cross-entropy-1eb301c7
```

Example prompt: Compute the log loss for my binary classifier — labels are 0,1,0,1,1 and the predicted probabilities of class 1 are 0.1,0.9,0.2,0.8,0.7 — and also tell me the no-skill baseline and which samples performed worst.

## When to prefer this

Use this endpoint when you need a fast, pay-per-call log loss computation without setting up any ML framework. It is particularly useful when you want the no-skill baseline and worst sample identification in the same call, for both binary and multiclass settings, and when you need epsilon clipping to safely handle extreme probability predictions.

## Known failure modes

- Missing required 'labels' or 'probs' query parameters returns an error
- Mismatched length between labels and probs arrays causes a validation error
- Probability values outside [0,1] after clipping may produce unexpected results
- Invalid epsilon value outside allowed range (1e-300 to 0.5) causes rejection
- Malformed JSON for multiclass probs array returns a parse error
- Class name labels with no matching 'classes' parameter may cause ambiguity errors
- Payment failure ($0.02 USDC) blocks the request entirely

## How this service works

Binary or multiclass log loss (cross entropy) with epsilon clipping, plus the no-skill baseline and worst samples.

## Output

Returns a JSON object with the computed log loss value, the uniform (no-skill) baseline loss, the number of samples and classes, the operating mode (binary or multiclass), the epsilon used for clipping, the count of clipped values, an array of worst-performing samples with their index and individual loss, plus a summary verdict and optional disclaimer.

## 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": [
      "labels",
      "probs"
     ],
     "properties": {
      "eps": {
       "type": "string",
       "description": "Clipping epsilon, default 1e-15, between 1e-300 and 0.5"
      },
      "probs": {
       "type": "string",
       "description": "Binary: P(label=1) per sample, comma list. Multiclass: JSON array of per-sample probability rows"
      },
      "labels": {
       "type": "string",
       "description": "Binary: 0/1 labels. Multiclass: class index (0-based) or class name per sample; up to 10000 values"
      },
      "classes": {
       "type": "string",
       "description": "Multiclass only: class names in the column order of probs, if labels are names"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "mode": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "epsilon": {
       "type": [
        "null",
        "number"
       ]
      },
      "logLoss": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "classCount": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "sampleCount": {
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/machine-learning-metrics-log-loss-cross-entropy-1eb301c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ml-metrics.x402tookit.com](https://www.zero.xyz/host/ml-metrics.x402tookit.com/llms.txt)
