Documentation

Integrate verified financial math in minutes

No API keys, no signup, no SDK required. Two surfaces — a REST API for products and an MCP server for AI assistants — over the same 27 verified models. Free with attribution — in writing.

Quickstart (REST)

Three endpoints per model: the JSON contract (GET /api/v1/models/{model}), the full specification (…/spec), and execution (POST /api/v1/models/{model}). Discover models at GET /api/v1/models.

curl -s https://worthune.com/api/v1/models/relocation \
  -X POST -H 'content-type: application/json' \
  -d '{
    "currentSalary": 95000,
    "newSalary": 108000,
    "currentMonthlyExpenses": 4200,
    "newMonthlyExpenses": 4900,
    "movingCosts": 6000,
    "currentSavings": 40000,
    "annualReturn": 0.07,
    "yearsHorizon": 10
  }'

Or from JavaScript:

const res = await fetch(
  "https://worthune.com/api/v1/models/relocation",
  {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify(inputs), // per the model's contract
  },
);
const result = await res.json();
if (result.ok) {
  console.log(result.outputs.breakEvenMonths);
  console.log(result.specVersion, result.assumptions);
}

MCP setup (AI assistants)

Streamable-HTTP endpoint, no auth: https://worthune.com/api/mcp/mcp — listed in the official MCP registry as com.worthune/models.

The response envelope

Every successful run returns the same shape — designed so a caller (human or AI) can show its work:

Validation & errors

Inputs are validated against the spec's domains at the boundary. Out-of-domain values are rejected, never clamped — engine behavior outside a spec's domain is undocumented, and a silently adjusted answer is worse than an error. All fields are required; unknown fields are rejected.

HTTP 400
{
  "ok": false,
  "model": "relocation",
  "errors": [
    { "field": "newSalary", "message": "must be between 30000 and 300000" },
    { "field": "yearsHorizon", "message": "required" }
  ]
}

Unknown models return 404. Malformed JSON returns 400 with a single error message.

Conventions

Embeds — a verified calculator in one script tag

Drop any of the 27 calculators into your page. Prefill inputs with data-input-* attributes; the frame carries its own verification link and disclaimer. Free with the built-in attribution.

<div data-worthune-embed="relocation"
     data-height="720"
     data-input-currentSavings="40000"></div>
<script async src="https://worthune.com/embed.js"></script>

Eval datasets & the facts API

Model reference

Each page shows the model's input contract and a live request/response pair generated from the real engine: