
# Getting started

The FinCalc API runs your institution's financial calculators from your own software. Each calculator
is one endpoint, `POST /v2/calculators/{slug}`; you send it the inputs as JSON, and it answers with the
result and whatever your institution adds to it.

## 1. Get a test key

Your institution's Administrators make keys in the FinCalc console, under **API keys**: an integration
for your software, then a key on it. Start with a **test key** (`fincalc_test_...`). It runs every
published calculator and is never billed, so you can build against it before your institution's API
license is in place. A key is shown once, when it is made, so store it as a secret straight away.

## 2. Find a calculator

```bash
curl https://api.fincalc.com/v2/calculators \
  -H "Authorization: Bearer $FINCALC_KEY"
```

Then ask one what it takes:

```bash
curl https://api.fincalc.com/v2/calculators/auto-loan-accelerated-payoff \
  -H "Authorization: Bearer $FINCALC_KEY"
```

## 3. Run it

```bash
curl https://api.fincalc.com/v2/calculators/auto-loan-accelerated-payoff \
  -H "Authorization: Bearer $FINCALC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"loanAmount": 25000, "termMonths": 60}'
```

```json
{
  "result": { "initialPayment": "...", "remainingPrincipal": "...", "...": "..." },
  "institution": {
    "disclaimer": "<p>This calculator is for illustration only.</p>",
    "ratesApplied": ["interestRate"]
  },
  "meta": { "calculator": "auto-loan-accelerated-payoff", "mode": "test", "locale": "en-US", "filled": {}, "excluded": [] }
}
```

`result` is the calculation, exactly as the [API reference](/api) documents for that calculator.
Inputs you leave out are filled as your institution's own page would open (its rates where it has
turned that on, its starting values, the calculator's defaults), and `meta.filled` names each one.
`institution` is what your institution adds; [Answers](/answers) explains each part.

## 4. Go live

When your institution licenses the API, its Administrators make a **live key**
(`fincalc_live_...`). Live keys run the calculators your institution licenses for the API, and each
completed calculation counts against its quota ([Limits and quotas](/limits)).
