API & MCP
Everything a person can do on True Cost Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://truecostcalculator.usefulweb.site/api/v1/calculate– run True Cost CalculatorGET https://truecostcalculator.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
True Cost Calculator
Add the purchase price, financing, expected resale value, recurring costs, maintenance, insurance and energy use. The calculator returns the true total cost of ownership, the cost per year, month and day, the share of each cost bucket, and how many times the sticker price you really pay.
| Field | Type | Default | Description |
|---|---|---|---|
itemType | select (car, pet, appliance, home, gadget, other) | "car" | What is it? |
itemName | text | "My purchase" | Name |
currency | text | "EUR" | Currency. Shown in results only; no conversion is performed. |
purchasePrice (required) | number | 0 | Purchase (sticker) price. Pet: purchase or adoption fee. |
yearsOwned | number | 5 | Years you will own it |
resaleValue | number | 0 | Expected resale value at the end |
loanAmount | number | 0 | Loan amount. Leave 0 if you pay cash. |
aprPercent | number | 0 | Loan APR |
loanTermMonths | integer | 0 | Loan term |
maintenancePerYear | number | 0 | Maintenance, repairs or vet care per year. Car or appliance: servicing and repairs. Pet: vet visits, vaccinations, medication and other health care. |
insurancePerYear | number | 0 | Insurance per year. Pet: health or liability insurance. |
energyConsumption | number | 0 | Energy, fuel or food consumption. Car: e.g. 6 (litres per 100 km). Appliance: e.g. 1.2 (kWh per wash cycle). Pet: e.g. 0.35 (kg of food per day). |
consumptionPer | select (per-100, per-1) | "per-100" | Consumption is per |
energyUnitPrice | number | 0 | Price per unit (litre, kWh or kg of food). E.g. price per litre of fuel, per kWh or per kg of pet food. |
usagePerYear | number | 0 | Usage per year. E.g. km per year, wash cycles per year, or 365 feeding days for a pet. |
recurring | table | — | Other recurring costs. Taxes, parking, subscriptions, pet supplies, grooming, fees… |
Example request
Compact car, financed, 6 years
curl -X POST https://truecostcalculator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"itemType":"car","itemName":"Compact car","currency":"EUR","purchasePrice":24000,"yearsOwned":6,"resaleValue":9000,"loanAmount":15000,"aprPercent":5.9,"loanTermMonths":48,"maintenancePerYear":600,"insurancePerYear":750,"energyConsumption":6,"consumptionPer":"per-100","energyUnitPrice":1.75,"usagePerYear":12000,"recurring":[{"name":"Vehicle tax","amount":120,"frequency":"yearly"},{"name":"Parking permit","amount":30,"frequency":"monthly"}]}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://truecostcalculator.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
true_cost_calculator - Local stdio connector:
node src/mcp-stdio.ts --tool=true-cost-calculator
{
"mcpServers": {
"true-cost-calculator": { "type": "http", "url": "https://truecostcalculator.usefulweb.site/mcp" }
}
}