# NPV / IRR / Payback Period / Profitability Index Calculator

> NPV / IRR / Payback Period / Profitability Index Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Computes net present value (NPV), internal rate of return (IRR), payback period, and profitability index for a cashflow array at a specified discount rate.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/npv-irr-calculator
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npv-irr-payback-period-profitability-index-calculator-7fe878cf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rnMvF9Zo1JIfuRaLPQq7z

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability npv-irr-payback-period-profitability-index-calculator-7fe878cf -d '<json body>'
```

Example prompt: Calculate the NPV, IRR, payback period, and profitability index for a project with an initial outlay of -$50,000 at t0 and annual inflows of $15,000, $18,000, $22,000, $20,000, and $10,000 over the next 5 years, using a discount rate of 8%.

## When to prefer this

Use this endpoint when you need multiple capital budgeting metrics (NPV, IRR, payback period, profitability index) from a single API call rather than computing them separately. Ideal for AI agents performing investment screening, financial modeling, or project evaluation where all four standard DCF metrics are needed together. At $0.004 per call it is cost-effective for high-frequency analysis pipelines.

## Known failure modes

- Invalid or malformed cashflow array (non-numeric values, empty array)
- Discount rate not provided or outside valid range
- IRR cannot be computed if cashflows never change sign (no real solution exists)
- Payback period may be undefined if cumulative cashflows never turn positive
- Payment/authentication failure for x402 micropayment

## How this service works

Net present value and internal rate of return for a cashflow array (index 0 = t0) at a given discount rate; also payback period and profitability index.

## Output

Returns a JSON object containing: the net present value (NPV) of the cashflow series at the given discount rate, the internal rate of return (IRR) as a percentage, the payback period in periods, and the profitability index. All metrics are computed against the cashflow array where index 0 represents time zero (t0).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cashflows": {
   "type": "array"
  },
  "discount_rate": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "npv": 143.28,
  "irr_pct": 17.5,
  "payback_period": 2.6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npv-irr-payback-period-profitability-index-calculator-7fe878cf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
