Developers · REST API

Script against the MESSAI corpus

Six endpoints cover most external use cases — predict performance, search the 21,895-paper corpus, fetch a paper's extractions, read a parameter's Bayesian posterior, ask the citation-grounded chat, and score a paper's reproducibility by DOI.

POST /api/ml/predict

Predict performance

Returns power density, current density, coulombic efficiency, voltage, and a multi-block enrichment response for a reactor configuration. MFC routes through the full v1 enrichment; MEC/MES/MDC/MMRC/MBES/MNRC route through their dedicated per-class predictor.

Request body

{
  "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
  }
}

Example

curl -X POST https://messai.io/api/ml/predict \
  -H 'Content-Type: application/json' \
  -d @request.json | jq '.powerOutput'

Notes

  • Every enrichment block reports its own `data_status`; missing artifacts surface honestly rather than zero-filling.
  • Hybrid mode opt-in via `?hybrid=true` query or `x-use-hybrid` header.
GET /api/papers/[id]

Single paper detail

Returns the full ResearchPaper record by paper id (CUID), including authors, abstract, DOI, year, primarySystemType, and a count of canonical-slug-linked extractions.

Parameters

Path params:
  id  string  Paper CUID (e.g. "clxxxx...")

Example

curl 'https://messai.io/api/papers/clxxxx123' | jq '{title,authors,year,extractionCount}'

Notes

  • Public; no auth required.
  • For lookup by DOI, use /api/reproducibility/score-by-doi/[doi] or search with ?q=<doi>.
GET /api/parameters/[slug]/hierarchical-prior

Bayesian posterior for a parameter

Returns the v1 (PyMC NUTS) hierarchical posterior fit for a parameter's slug: pooled μ + 95% CI, per-system_type strata, MCMC diagnostics (R̂, ESS, divergences).

Parameters

Path params:
  slug  string  Canonical parameter slug (e.g. "power_density_areal")

Example

curl 'https://messai.io/api/parameters/power_density_areal/hierarchical-prior' | jq '.pooled'

Notes

  • data_status: "populated" / "awaiting_artifact" / "parameter_not_in_priors" / "read_error" — branch on it.
  • Log-scale parameters return both fit-scale (mu_log, tau_log) and back-transformed (mu, ci95_low, ci95_high).
POST /api/chat

Citation-grounded chat

Stream LLM responses backed by ~50 corpus / ML tools. All factual claims must cite papers retrieved via tool calls.

Request body

{
  "messages": [{"role": "user", "content": "What anode materials maximise power density for acetate substrates?"}],
  "mode": "lab-research"
}

Example

curl -X POST https://messai.io/api/chat \
  -H 'Content-Type: application/json' \
  -d @messages.json

Notes

  • Streams as `text/event-stream`. Token usage is metered per API key.
  • mode: "lab-research" | "lab-design" | "lab-mutation"
GET /api/reproducibility/score-by-doi/[doi]

Score a paper by DOI

Looks up a paper by DOI in the corpus, scores its extracted parameters against the ISMET 2026 5-parameter minimum + the 18-parameter comprehensive checklist.

Parameters

Path params:
  doi  string  DOI (URL-encoded if it contains slashes — e.g. "10.1021%2Fes0605016")

Example

curl 'https://messai.io/api/reproducibility/score-by-doi/10.1021%2Fes0605016' | jq '.fiveParam.scorePercent'

Notes

  • Returns one of 4 shapes (`found` / `paper_found_no_extraction` / `not_in_corpus` / `error`) — branch on `status`.