# Earned Value Management API
> Earned Value Management (EVM) maths as an API, computed locally and deterministically — the project cost-and-schedule controls used in PMP, PRINCE2 and government contracting. The metrics endpoint takes the budget at completion (BAC), planned value (PV), earned value (EV) and actual cost (AC) — or a percent-complete and planned-percent of BAC — and returns the cost variance (CV = EV−AC), schedule variance (SV = EV−PV), the cost and schedule performance indices (CPI = EV/AC, SPI = EV/PV), the percent complete and spent, and a plain-language over/under-budget and ahead/behind-schedule read. The forecast endpoint projects the finish: the estimate at completion by three standard methods (BAC/CPI when the cost trend continues, AC + remaining budget, and the cost-and-schedule AC + (BAC−EV)/(CPI·SPI)), the estimate to complete (ETC), the variance at completion (VAC) and the to-complete performance index (TCPI) to land on either the original budget or the EAC. A CPI of 0.875 on a 1000 budget forecasts a 1143 overrun. Everything is computed locally and deterministically, so it is instant and private. Ideal for project-management, PMO, construction, aerospace and contracting app developers, project dashboards and earned-value reporting tools, and PMP/PRINCE2 training. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 2 compute endpoints. This is earned-value project control; for loan or NPV cash-flow maths use a finance API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/earnedvalue-api/..."
```

## Pricing
- **Free** (Free) — 4,350 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 46,000 calls/Mo, 6 req/s
- **Pro** ($15/Mo) — 209,000 calls/Mo, 15 req/s
- **Mega** ($46/Mo) — 1,175,000 calls/Mo, 40 req/s

## Endpoints

### EarnedValue

#### `GET /v1/forecast` — EAC / ETC / VAC / TCPI

**Parameters:**
- `bac` (query, required, string) — Budget at completion Example: `1000`
- `ac` (query, required, string) — Actual cost Example: `400`
- `ev` (query, optional, string) — Earned value (or percent_complete) Example: `350`
- `pv` (query, optional, string) — Planned value (or planned_percent) Example: `400`
- `percent_complete` (query, optional, string) — % complete of BAC
- `planned_percent` (query, optional, string) — % planned of BAC

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earnedvalue-api/v1/forecast?bac=1000&ac=400&ev=350&pv=400"
```

**Response:**
```json
{
    "data": {
        "cpi": 0.875,
        "eac": 1142.8571,
        "etc": 742.8571,
        "spi": 0.875,
        "vac": -142.8571,
        "note": "EAC = BAC/CPI (cost trend continues); ETC = EAC−AC; VAC = BAC−EAC (negative = overrun). TCPI = (BAC−EV)/(BAC−AC) is the efficiency the remaining work must hit to land on budget.",
        "inputs": {
            "ac": 400,
            "ev": 350,
            "pv": 400,
            "bac": 1000
        },
        "eac_methods": {
            "cpi_based": 1142.8571,
            "budget_rate": 1050,
            "cost_and_schedule": 1248.9796
        },
        "tcpi_to_bac": 1.0833,
        "tcpi_to_eac": 0.875
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:48.535Z",
        "request_id": "0b4cc730-9657-498a-8df1-006ec268c360"
    },
    "status": "ok",
    "message": "EVM forecast",
    "success": true
}
```

#### `GET /v1/metrics` — EVM variances & indices

**Parameters:**
- `bac` (query, required, string) — Budget at completion Example: `1000`
- `ac` (query, required, string) — Actual cost Example: `400`
- `ev` (query, optional, string) — Earned value (or percent_complete) Example: `350`
- `pv` (query, optional, string) — Planned value (or planned_percent) Example: `400`
- `percent_complete` (query, optional, string) — % complete of BAC
- `planned_percent` (query, optional, string) — % planned of BAC

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earnedvalue-api/v1/metrics?bac=1000&ac=400&ev=350&pv=400"
```

**Response:**
```json
{
    "data": {
        "cpi": 0.875,
        "spi": 0.875,
        "note": "CV = EV−AC, SV = EV−PV; CPI = EV/AC, SPI = EV/PV. Index ≥ 1 is good; CPI 0.9 means 90 cents of value per dollar spent.",
        "inputs": {
            "ac": 400,
            "ev": 350,
            "pv": 400,
            "bac": 1000
        },
        "cost_status": "over budget",
        "cost_variance": -50,
        "percent_spent": 40,
        "schedule_status": "behind schedule",
        "percent_complete": 35,
        "schedule_variance": -50,
        "cost_variance_percent": -14.2857,
        "schedule_variance_percent": -12.5
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:48.633Z",
        "request_id": "c28ee8a3-1bac-4997-b40f-6f0a33a48c89"
    },
    "status": "ok",
    "message": "EVM metrics",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earnedvalue-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "PV/EV/AC in one consistent currency; EV and PV can be given directly or as percent_complete/planned_percent of BAC. For loan/NPV cash-flow maths use a finance API.",
        "service": "earnedvalue-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/metrics": "Variances, CPI/SPI and progress from BAC, PV, EV, AC (or percentages).",
            "GET /v1/forecast": "EAC (three methods), ETC, VAC and TCPI."
        },
        "description": "Earned Value Management (EVM): cost/schedule variances and indices (CV, SV, CPI, SPI) and at-completion forecasts (EAC, ETC, VAC, TCPI)."
    },
    "meta": {
        "timestamp": "2026-06-05T21:48:48.730Z",
        "request_id": "d37b25bc-a9e0-4441-8517-ebafe3fb17ab"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/earnedvalue-api
OpenAPI spec: https://www.oanor.com/api/earnedvalue-api/openapi.json
