Home Developers Quick start

CalculatorX Developers

Quick start

No API key. Base URL is https://www.calculatorx.com. Copy a request and pin a version when you need a freeze.

  1. Pick a REST id (amps-to-va) or a capability_id (electrical.apparent_power).
  2. POST JSON inputs.
  3. Read result_detail, formula, warnings, and verification. Pin calculation_version when you need a freeze.

Use capability_id when you need a stable semantic identity. REST tool_id is a human-friendly alias. The response engine is the resolved implementation — do not couple client logic to it.

REST

curl -X POST 'https://www.calculatorx.com/api/v1/calc/amps-to-va' \
  -H 'Content-Type: application/json' \
  -H 'CalculatorX-Spec-Version: 1.4.3' \
  -d '{"inputs":{"mode":"amps-va","primary":12,"volts":230,"phase":"single"}}'

Response

A typical calculator API returns a number. CalculatorX also returns formula, version, and verification.

{
  "result": 2760,
  "result_detail": {
    "value": 2760,
    "unit": "VA",
    "formatted": "2,760 VA"
  },
  "formula": {
    "expression": "S = V_RMS × I_RMS"
  },
  "calculation_version": "1.4.3",
  "verification": {
    "engine_tested": true,
    "expert_reviewed": false
  }
}

Trimmed success body for 12 A × 230 V → 2,760 VA. Full responses also include assumptions, warnings, evidence, and the resolved engine. verification.engine_tested is not expert review.

More engines and REST-only tools: REST API.

MCP

GET  https://www.calculatorx.com/mcp
POST https://www.calculatorx.com/mcp
MCP-Protocol-Version: 2026-07-28

Canonical 2026-07-28 request includes JSON _meta. Official MCP SDKs populate it automatically. CalculatorX still accepts header-only curl without _meta.

Protocol notes and rate limits: MCP.

Copy-paste client

There is no published SDK package yet. Drop one of these helpers into a script. Throw on status: "error" and pin CalculatorX-Spec-Version when the number must stay still. HTTP errors: Errors.

const CX = 'https://www.calculatorx.com';

export async function cxCalc(toolId, inputs, { version } = {}) {
  const headers = { 'Content-Type': 'application/json' };
  if (version) headers['CalculatorX-Spec-Version'] = version;
  const res = await fetch(`${CX}/api/v1/calc/${toolId}`, {
    method: 'POST',
    headers,
    body: JSON.stringify({ inputs }),
  });
  const data = await res.json();
  if (!res.ok || data.status === 'error') {
    const err = new Error(data.error || res.statusText);
    err.code = data.code;
    err.status = res.status;
    throw err;
  }
  return data;
}

const out = await cxCalc('amps-to-va', {"mode":"amps-va","primary":12,"volts":230,"phase":"single"}, { version: '1.4.3' });
console.log(out.result_detail, out.formula);