Documentation
API reference
The same engine behind the Playground and the MCP server is a REST API — for pipelines, automation, and typed clients in any language. The interactive explorer below is generated from the engine's OpenAPI document, so it is always in sync with the running API.
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/metadata | Supported minerals & species, and engine capabilities |
POST | /api/v1/scale/predict | Predict scale for one brine at a condition |
POST | /api/v1/scale/mix | Mix two brines by volume, then predict |
POST | /api/v1/scale/profile | Evaluate one brine along a sequence of conditions |
Example
Predict scale for a barite-prone water:
curl -X POST https://api.crysalt.com/api/v1/scale/predict \
-H "Content-Type: application/json" \
-d '{
"brine": { "ions": [
{"species":"Na+","mgPerL":10000}, {"species":"Cl-","mgPerL":20000},
{"species":"Ba2+","mgPerL":500}, {"species":"SO42-","mgPerL":2400} ], "ph": 7 },
"condition": { "temperatureC": 25, "pressureBar": 1 },
"options": { "activityModel": "Pitzer" }
}'
The response carries the per-mineral results and the brine diagnostics (values illustrative):
{
"converged": true,
"ph": 6.98,
"ionicStrength": 0.78,
"minerals": [
{ "mineral": "BaSO4", "saturationRatio": 41.2, "saturationIndex": 1.61,
"precipitatedMoles": 0.0021, "precipitatedMassGrams": 0.49, "ksp": 1.16e-10 }
],
"aqueous": [ /* per species: molality, mg/L, activity coefficient */ ],
"reactions": [ /* per reaction: log10 K used in the solve */ ],
"warnings": [],
"gases": []
}
Set a gas mole fraction on the condition (e.g. co2MoleFractionInGas) to open
the brine to a gas phase; the response's gases array then reports each gas's partial
pressure and net amount exsolved. The full request/response schemas — including mix and
profile — are in the interactive explorer, and the raw spec generates a typed client in
any language.