/api/ml/predictPublicPredict performance
Runs the shared runFullPrediction orchestrator and returns a multi-block v1 enrichment response — power output, efficiency, voltage, current density, plus empirical context, out-of-distribution (OOD) detection, prior compliance, calibration, within-paper effects, and hierarchical priors. MFC routes through the full v1 enrichment; MEC/MES/MDC/MMRC/MBES/MNRC route through their dedicated per-class analytical predictor.
AuthNo session guard. Validates the full request shape (Zod) and 400s with the offending field paths on mismatch — e.g. a missing conditions.pressure or configuration.reactorVolume.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| systemType | string | required | Primary system type (e.g. "MFC", "MEC", "MES", "MDC"). |
| materials | object | required | Anode/cathode material + surface-area inputs. |
| conditions | object | required | Operating conditions. Required: temperature, pH, pressure. Optional: substrateConcentration, externalResistance, codMgL, hrtHours, appliedVoltage, substrateId. (codMgL + hrtHours are required for the per-class MEC/MES/MDC/MNRC/MMRC/MBES predictors.) |
| configuration | object | required | Reactor geometry (volume, electrode spacing, chamber count). |
| hybrid | query boolean | optional | Opt into hybrid mode via ?hybrid=true OR the x-use-hybrid: true header. |
Example request
curl -X POST https://messai.io/api/ml/predict \
-H 'Content-Type: application/json' \
-d '{
"systemType": "MFC",
"materials": { "anodeMaterial": "carbon-cloth", "cathodeMaterial": "platinum-carbon", "anodeSurfaceArea": 25, "cathodeSurfaceArea": 25 },
"conditions": { "temperature": 30, "ph": 7, "pressure": 1, "substrateConcentration": 1000, "externalResistance": 1000 },
"configuration": { "reactorVolume": 250, "electrodeSpacing": 2, "numChambers": 1 }
}' | jq '.powerOutput'Example response
{
"powerOutput": { "value": 1240, "unit": "mW/m^2", "ci_low": 410, "ci_high": 3100 },
"efficiency": { "value": 38, "unit": "%" },
"voltage": { "value": 0.48, "unit": "V" },
"currentDensity": { "value": 2.6, "unit": "A/m^2" },
"empirical_context": { "n_matching_papers": 214, "data_status": "populated" },
"epistemic": { "ood": { "is_ood": false, "score": 0.12 } },
"prior_compliance": { "data_status": "populated" },
"calibration": { "data_status": "populated" },
"hierarchical_priors": { "data_status": "populated" }
}Notes
- Every enrichment block reports its own `data_status` — missing artifacts surface honestly (`awaiting_artifact` / `below_threshold`) rather than zero-filling.
- A GET to this path returns a self-describing manifest of the response blocks and the API version.
- The `gp_scm_forward` block is only populated when the GP-SCM Python service is reachable; otherwise it is omitted or marked unavailable.