AuditLog
row for EU AI Act traceability.
Both endpoints are tenant-scoped (authenticate with an API key or session). They are not
role-gated. They are rate limited per tenant and fail closed.
POST /api/v1/fairness/evaluate
Compute a fairness report. Rate limit: 20 requests / 60 s.Query parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
metrics | basic, advanced | basic | advanced adds intersectional analysis, mitigation recommendations, per-group Gini and KS tests, and (with a modelKey) counterfactual + LIME analysis. |
Request body
A discriminated union onmode, plus optional advanced auto-run fields.
Inline mode — pass samples directly:
| Field | Type | Required | Description |
|---|---|---|---|
mode | "inline" | Yes | Selects inline mode. |
samples[].group | string | Yes | Protected-group label. |
samples[].prediction | boolean | Yes | Whether the customer got a positive decision. |
samples[].label | boolean | No | Ground-truth label (enables equal-opportunity / equalized-odds). |
samples[].intersectionalGroups | object | No | { axis: value } map for advanced intersectional analysis. |
samples[].attributes | object | No | Feature map used for counterfactual + LIME when metrics=advanced and a modelKey is supplied. |
| Field | Type | Required | Description |
|---|---|---|---|
mode | "trace-join" | Yes | Selects trace-join mode. |
from / to | string (ISO-8601) | Yes | Trace window. |
offerId | string | No | Positive = this offer was selected. Omitted = any offer selected. |
groupLookup | object | Yes | customerId → group map. |
labelLookup | object | No | customerId → boolean ground-truth map. |
intersectionalLookup | object | No | customerId → { axis: value } map. |
maxTraces | integer (1-20000) | No | Cap on traces scanned. Default 5000. |
metrics=advanced): modelKey, modelGroupKey,
counterfactualGroup, limeBaseline, limeOptions ({ samples, seed }).
Response 200
metrics=advanced, the response may also include intersectional, mitigations,
giniByGroup, ksByGroup, counterfactualFairness, and lime. Any advanced primitive that could
not run (e.g., no modelKey, no intersectional groups) is listed by reason in
advancedAwaitingConfig.
Errors
| Code | Reason |
|---|---|
400 | Request body failed validation. |
429 | Rate limit exceeded (20 / 60 s per tenant). |
500 | Trace-join query failed. |
POST /api/v1/fairness/report
Run the same evaluation and return a formatted EU AI Act conformity report instead of JSON. Rate limit: 10 requests / 60 s.Request body
The sameinline / trace-join body as /evaluate, plus:
| Field | Type | Default | Description |
|---|---|---|---|
format | "csv", "html" | "html" | Output format. |
title | string (max 200) | — | Report title (HTML only). |
subtitle | string (max 300) | — | Report subtitle (HTML only). |
Response 200
format: "csv"→text/csvattachment (fairness-report-<ts>.csv).format: "html"→text/htmldocument, suitable for headless-Chromium PDF rendering.
fairness_report audit-log row is written on every generation so it is
discoverable in DSAR exports.