Skip to main content

Economics API

The cost database is served by the IDAES backend under /api/tea/*. Routes mount only when DATABASE_URL is configured; the backend boots stateless without it. Read routes are open; the override write route requires the backend API key.

Endpoints

MethodPathPurpose
GET/api/tea/healthDB liveness + correlation count
POST/api/tea/cost-equipmentCost one piece of equipment by type/subtype/material/size/pressure
POST/api/tea/cost-unitCost by Jasper unit type (resolves via the unit-cost map)
POST/api/tea/cost-columnColumn: shell + internals (trays or packing)
GET/api/tea/cost-blendedMulti-source blended estimate with inter-source range
POST/api/tea/estimateFull project: equipment list + feeds + products + utilities → CAPEX, OPEX, revenue, margin, gaps
GET/api/tea/coverageUnit-type coverage report (23/23 cost-bearing covered)
GET/api/tea/sourcesThe queryable source registry with licenses
GET/api/tea/price/chemicalEffective chemical price (override-aware)
GET/api/tea/price/utilityEffective utility price (override-aware)
POST/api/tea/overrideRecord a price override event (API-key gated)
GET/api/tea/overridesQuery the override event log

Example: cost one unit

curl -X POST $BACKEND/api/tea/cost-equipment \
-H 'Content-Type: application/json' \
-d '{
"equipment_type": "HeatExchanger",
"subtype": "FloatingHead",
"material": "CarbonSteel",
"size": 100,
"pressure": 25,
"region": "US-GC",
"aace_class": 5
}'

Response (abridged):

{
"purchased_cost": 126141,
"bare_module_cost": 444734,
"total_module_cost": 524786,
"Fp": 1.137, "Fm": 1.0,
"accuracy_class": "AACE Class 4-5 (+/-30-40%)",
"in_range": true,
"provenance": {
"correlation": "turton",
"cost_index": "bls-ppi-ces",
"contingency": "turton-grassroots-contingency"
}
}

Example: full estimate

POST /api/tea/estimate takes the flowsheet's sized equipment plus annual feed/product/utility flows and returns totals, a per-item breakdown with provenance, and a gaps array for anything that couldn't be costed (excluded from totals, never invented). Common parameters: region (US-GC | US-MW | EU), aace_class (5 | 4), and optional project / scenario refs for override resolution.