Preview docs. Hallucination Guard is the only live endpoint today.
The rest of the API surface ships through the rest of 2026. Join the waitlist to be first in line and shape what we build first.
API reference
Custom Calculator Engine API
Embeddable profit-calculator builder with PRISM dimensional analysis. Schemas describe lines and formulas; runs evaluate them deterministically and return ranked levers + headline takeaways.
Powers the hosted Custom Profit Calculator module.
POST /v1/calculator-engine/schemas
Define a calculator schema once. Reuse it for every run. Returns a schema_id.
JSON
POST /v1/calculator-engine/schemas
{
"tk-key">"name": "Airbnb Arbitrage P&L",
"tk-key">"lines": [
{ "tk-key">"id": "rev_nights", "tk-key">"label": "Nightly revenue", "tk-key">"formula": "adr * occupancy * 30" },
{ "tk-key">"id": "exp_rent", "tk-key">"label": "Rent", "tk-key">"type": "expense" },
{ "tk-key">"id": "exp_furn_amort", "tk-key">"label": "Furnishing amort.", "tk-key">"type": "expense" },
{ "tk-key">"id": "net", "tk-key">"label": "Net monthly", "tk-key">"formula": "rev_nights - exp_rent - exp_furn_amort" }
]
}
→ 200 OK
{ "tk-key">"schema_id": "calc_9e2..." }Schema rules
- Line IDs must be unique within a schema
- Formulas may reference other line IDs and inputs by name
- Cycles are rejected with
422 schema_validation_failed - Allowed operators:
+ - * / ( ) min() max() round()
POST /v1/calculator-engine/run
Evaluate a schema against a set of input values. Returns computed outputs plus a PRISM dimensional analysis layer.
JAVASCRIPT
const result = await prism.calculatorEngine.run({
schema_id: "calc_9e2...",
values: { adr: 185, occupancy: 0.72, exp_rent: 2400, exp_furn_amort: 350 },
});
console.log(result.outputs.net); "tk-cmt">// 1246
console.log(result.analysis.headline); "tk-cmt">// "Net is positive but thin..."
console.log(result.analysis.ranked_levers);PYTHON
result = prism.calculator_engine.run(
schema_id=class="tk-str">"calc_9e2...",
values={class="tk-str">"adr": 185, class="tk-str">"occupancy": 0.72, class="tk-str">"exp_rent": 2400, class="tk-str">"exp_furn_amort": 350},
)
print(result.outputs[class="tk-str">"net"])
print(result.analysis.headline)JSON
→ 200 OK
{
"tk-key">"outputs": { "tk-key">"rev_nights": 3996, "tk-key">"exp_rent": 2400, "tk-key">"exp_furn_amort": 350, "tk-key">"net": 1246 },
"tk-key">"analysis": {
"tk-key">"ranked_levers": [
{ "tk-key">"lever": "occupancy", "tk-key">"impact_per_pct": 55, "tk-key">"direction": "positive", "tk-key">"current": 0.72 },
{ "tk-key">"lever": "adr", "tk-key">"impact_per_dollar": 21.6, "tk-key">"direction": "positive" }
],
"tk-key">"headline": "Net is positive but thin. Occupancy moves your margin twice as fast as ADR at this rent.",
"tk-key">"broken_assumptions": []
}
}Output fields
outputs: every line in the schema, evaluated. Includes both inputs (echoed) and computed lines.analysis.ranked_levers: input variables ranked by marginal impact on the most-downstream output. Sign + magnitude per lever.analysis.headline: one-sentence takeaway in the dimensional-analysis voice.analysis.broken_assumptions: flags inputs outside reasonable ranges (e.g. occupancy > 1.0, negative rent).