API Reference

Call the RetireLab API directly — Monte Carlo simulations, historical backtests, and Coast FIRE projections.

Developer Quickstarts

Copy-paste examples to call the API directly. Replace YOUR_API_KEY with a key from your dashboard.

NO SIGNUP

Try it in 30 seconds

The public demo endpoint runs the same Monte Carlo engine as the paid API. No API key, no account, no setup. Rate-limited to 50 requests per hour per IP.

curl -X POST https://api.retirelab.dev/api/v1/plan/demo \
  -H "Content-Type: application/json" \
  -d '{
    "current_age": 35,
    "target_retirement_age": 55,
    "current_assets": 400000,
    "annual_contribution": 24000,
    "annual_withdrawal": 60000,
    "risk_tolerance": "MEDIUM"
  }'

Returns the same shape as /api/v1/plan/fire-scenarios. Once you have a working integration, get an API key for higher limits and access to Traditional, Coast FIRE, and PDF reports.

cURL

curl -X POST https://api.retirelab.dev/api/v1/plan/fire-scenarios \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "current_age": 35,
    "target_retirement_age": 65,
    "current_assets": 400000,
    "annual_contribution": 24000,
    "annual_withdrawal": 60000,
    "risk_tolerance": "MEDIUM"
  }'

Python

import requests

result = requests.post(
    "https://api.retirelab.dev/api/v1/plan/fire-scenarios",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "current_age": 35,
        "target_retirement_age": 65,
        "current_assets": 400_000,
        "annual_contribution": 24_000,
        "annual_withdrawal": 60_000,
        "risk_tolerance": "MEDIUM",
    },
).json()

print(f"Success probability: {result['base']['success_probability']:.0%}")
print(f"FI Number: ${result['fi_number']:,.0f}")

Node.js

const res = await fetch("https://api.retirelab.dev/api/v1/plan/fire-scenarios", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    current_age: 35,
    target_retirement_age: 65,
    current_assets: 400000,
    annual_contribution: 24000,
    annual_withdrawal: 60000,
    risk_tolerance: "MEDIUM",
  }),
});

const data = await res.json();
console.log(`Success: ${Math.round(data.base.success_probability * 100)}%`);
console.log(`FI Number: $${data.fi_number.toLocaleString()}`);

Response

{
  "lean": {
    "annual_withdrawal": 48000,
    "success_probability": 0.94,
    "retirement_assets_p50": 1520000,
    "planning_assets_p50": 440000
  },
  "base": {
    "annual_withdrawal": 60000,
    "success_probability": 0.82,
    "retirement_assets_p50": 1520000,
    "planning_assets_p50": 218000
  },
  "fat": {
    "annual_withdrawal": 72000,
    "success_probability": 0.67,
    "retirement_assets_p50": 1520000,
    "planning_assets_p50": -105000
  },
  "fi_number": 1500000,
  "disclaimer": "This analysis is for educational purposes only..."
}

Traditional retirement with Social Security & pension

Same fields as above, plus optional Social Security, pension, and pre-Medicare healthcare offsets. Net withdrawal is automatically adjusted.

result = requests.post(
    "https://api.retirelab.dev/api/v1/plan/traditional",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "current_age": 55,
        "target_retirement_age": 65,
        "current_assets": 800_000,
        "annual_contribution": 30_000,
        "annual_withdrawal": 80_000,
        "risk_tolerance": "MEDIUM",
        "ss_monthly": 2_200,      # expected Social Security benefit
        "ss_age": 67,             # age to claim (62–70)
        "pension_monthly": 500,   # optional pension income
        "healthcare_annual": 8_000,  # pre-Medicare bridge cost
    },
).json()

# response also includes an "adjustments" object showing the offset math
print(result["adjustments"]["net_annual_withdrawal_used"])

Sharing Results

Any simulation run on the RetireLab dashboard can be saved as a permanent public link and shared with anyone — no account required to view. Links work for FIRE, Traditional, and Coast FIRE plans.

From the dashboard

  1. Run any simulation in the dashboard.
  2. Click Share results below the results table.
  3. A permanent link is generated and copied to your clipboard automatically.
  4. Share the link anywhere — Reddit, Twitter/X, Discord, or with a financial advisor.

Shared result URL format

https://retirelab.dev/results/550e8400-e29b-41d4-a716-446655440000

Create a shareable link via API

No API key required for POST or GET. Auth is optional — if you include a Bearer token the result is linked to your account.

Trailing slash required. Use /api/v1/shared-results/ (with the slash) for POST. Without it the server returns a 307 redirect, and most HTTP clients drop the POST body when following the redirect — your request will arrive empty and fail validation.
# Create a shareable link
curl -X POST https://api.retirelab.dev/api/v1/shared-results/ \
  -H "Content-Type: application/json" \
  -d '{
    "plan_type": "fire",
    "title": "FIRE plan — retire at 55",
    "inputs": {
      "current_age": 35,
      "target_retirement_age": 55,
      "current_assets": 400000,
      "annual_withdrawal": 60000,
      "risk_tolerance": "MEDIUM"
    },
    "results": {
      "fi_number": 1500000,
      "base": { "success_probability": 0.82, "annual_withdrawal": 60000,
                "retirement_assets_p50": 1520000, "planning_assets_p50": 218000 }
    }
  }'

# Response
{ "id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2026-03-06T12:00:00" }
# Retrieve a shared result (public — no auth)
curl https://api.retirelab.dev/api/v1/shared-results/550e8400-e29b-41d4-a716-446655440000

# Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "plan_type": "fire",
  "title": "FIRE plan — retire at 55",
  "inputs": { ... },
  "results": { ... },
  "created_at": "2026-03-06T12:00:00"
}

Embeddable Widget

Embed the RetireLab FIRE calculator on any website with a single <iframe>. No API key required — the embed uses the public demo endpoint (10 runs/hour per IP).

<iframe
  src="https://retirelab.dev/embed"
  width="380"
  height="420"
  frameborder="0"
  style="border-radius:12px;border:1px solid #e4e4e7"
></iframe>

Preview the widget at retirelab.dev/embed.

Errors

401

Missing or invalid API key. Ensure the X-API-Key header is present and correct.

422

Validation error. Inspect the errors array in the response body for field-level details.

429

Monthly quota exceeded. Check remaining quota with GET /api/v1/me/quota, or upgrade at retirelab.dev/pricing.

Rate limits

Simulations are counted across your API keys and dashboard usage combined, and reset on the first day of each month.

TierMonthly simulations
Free25
Pro500
Creator5,000

See pricing for full tier comparison.

Support

Found a bug, hit an undocumented edge case, or need help integrating? Email us — we read every message and reply within one business day. Pro and Creator tier customers get priority response.

support@retirelab.dev

Key endpoints

Common endpoints are listed below.

POST/api/v1/plan/fire-scenarios

Run lean / base / fat FIRE scenarios. Returns success probabilities and FI Number.

POST/api/v1/plan/traditional

Traditional retirement with Social Security + pension offsets.

POST/api/v1/plan/coast-firePro

Coast FIRE calculation — the portfolio size where you can stop contributing and still reach FI. Note: the dashboard Coast FIRE tab runs client-side and is quota-free; this API endpoint runs a server-side simulation and counts toward your monthly quota.

POST/api/v1/plan/reportCreator / Pro

Generate a PDF report from simulation results.

GET/api/v1/me/quota

Check your remaining monthly quota. Returns used, limit, resets_at, tier, and a breakdown of dashboard vs API usage.

GET/api/v1/plan/disclaimer

Returns the full educational disclaimer text. Public — no API key required.

POST/api/v1/shared-results/

Create a shareable result link. No API key required. Returns a UUID that maps to a public /results/{id} page.

GET/api/v1/shared-results/{id}

Retrieve a shared result by UUID. Public — no auth required.

GET/api/v1/me/usage-history

30-day simulation call history, grouped by date. Requires auth.

GET/health

Service health check.