# 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-13).

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/npv-irr-calculator
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npv-irr-payback-period-profitability-index-calculator-8cd8fe77
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IW4-WPSToxp3TAtcbezX_

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-8cd8fe77 -d '<json body>'
```

Example prompt: Calculate the NPV, IRR, payback period, and profitability index for a project with cashflows of [-100000, 30000, 35000, 40000, 45000] (index 0 is the initial outlay at t0) using a 10% annual discount rate.

## When to prefer this

Choose this endpoint when you need a complete suite of standard capital-budgeting metrics — NPV, IRR, payback period, and profitability index — from a single API call with a simple cashflow array and discount rate. Ideal for financial agents, investment screening tools, or any workflow requiring quick discounted cashflow analysis without setting up a full financial modeling library.

## Known failure modes

- Invalid cashflow array (non-numeric values or missing t0) returns a validation error
- IRR cannot be computed if cashflows never change sign (no real solution exists)
- Discount rate of exactly -100% causes division by zero
- Empty cashflow array returns an error
- Extremely large arrays may time out or return computation errors

## 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: net present value (NPV) in currency units, internal rate of return (IRR) as a percentage, payback period (in periods), and profitability index — all computed from the submitted cashflow array and discount rate.

## 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-8cd8fe77/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)
