{"openapi":"3.1.0","info":{"title":"Investment Calculator API","version":"1.0.0","description":"Investment and capital-budgeting maths as an API. The npv endpoint computes the net present value of a series of cash flows at a discount rate (the first flow is usually the negative initial investment). The irr endpoint finds the internal rate of return — the discount rate at which the net present value is zero — by a robust bracketed search. The annuity endpoint solves a level (ordinary) annuity: give the rate, the number of periods and any one of the payment, present value or future value, and it returns the other two. The depreciation endpoint builds a full year-by-year schedule by the straight-line, declining-balance (any factor, including double-declining) or sum-of-the-years'-digits method, never depreciating below the salvage value. Rates may be entered as a percentage or a fraction. Everything is computed locally and deterministically, so it is instant and private. Ideal for investment analysis and capital budgeting, accounting and corporate-finance tools, business planning, and finance education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 5 endpoints. This is investment and capital-budgeting maths; for loans, mortgages and compound interest use a financial-calculator API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/financecalc-api","description":"oanor gateway"}],"tags":[{"name":"Finance"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/annuity":{"get":{"operationId":"get_v1_annuity","tags":["Finance"],"summary":"Solve a level annuity","description":"","parameters":[{"name":"rate","in":"query","required":true,"description":"Per-period rate","schema":{"type":"string"},"example":"5"},{"name":"periods","in":"query","required":true,"description":"Number of periods","schema":{"type":"string"},"example":"10"},{"name":"payment","in":"query","required":false,"description":"Or present_value / future_value","schema":{"type":"string"},"example":"100"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"type":"ordinary annuity (payments at period end)","payment":100,"periods":10,"future_value":1257.79,"rate_percent":5,"present_value":772.17},"meta":{"timestamp":"2026-06-03T17:42:08.118Z","request_id":"37373a41-d88c-40c6-898a-7826849b78db"},"status":"ok","message":"Annuity","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/depreciation":{"get":{"operationId":"get_v1_depreciation","tags":["Finance"],"summary":"Depreciation schedule","description":"","parameters":[{"name":"cost","in":"query","required":true,"description":"Asset cost","schema":{"type":"string"},"example":"10000"},{"name":"salvage","in":"query","required":false,"description":"Salvage value","schema":{"type":"string"},"example":"1000"},{"name":"life","in":"query","required":true,"description":"Years","schema":{"type":"string"},"example":"5"},{"name":"method","in":"query","required":false,"description":"straight_line|declining_balance|sum_of_years","schema":{"type":"string"},"example":"straight_line"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"cost":10000,"life":5,"method":"straight_line","salvage":1000,"schedule":[{"year":1,"book_value":8200,"accumulated":1800,"depreciation":1800},{"year":2,"book_value":6400,"accumulated":3600,"depreciation":1800},{"year":3,"book_value":4600,"accumulated":5400,"depreciation":1800},{"year":4,"book_value":2800,"accumulated":7200,"depreciation":1800},{"year":5,"book_value":1000,"accumulated":9000,"depreciation":1800}],"total_depreciation":9000},"meta":{"timestamp":"2026-06-03T17:42:08.222Z","request_id":"62327f2d-b582-4dc2-8603-f41f0e84360a"},"status":"ok","message":"Depreciation","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/irr":{"get":{"operationId":"get_v1_irr","tags":["Finance"],"summary":"Internal rate of return","description":"","parameters":[{"name":"cashflows","in":"query","required":true,"description":"List of cash flows","schema":{"type":"string"},"example":"[-1000,500,500,500]"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"irr":0.23375193,"cashflows":[-1000,500,500,500],"npv_at_irr":0,"irr_percent":23.3752},"meta":{"timestamp":"2026-06-03T17:42:08.315Z","request_id":"10d911fd-c18a-4d4f-bda7-9740f76bc0ac"},"status":"ok","message":"IRR","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/npv":{"get":{"operationId":"get_v1_npv","tags":["Finance"],"summary":"Net present value","description":"","parameters":[{"name":"cashflows","in":"query","required":true,"description":"List of cash flows","schema":{"type":"string"},"example":"[-1000,500,500,500]"},{"name":"rate","in":"query","required":true,"description":"Discount rate (% or fraction)","schema":{"type":"string"},"example":"10"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"npv":243.43,"cashflows":[-1000,500,500,500],"rate_percent":10},"meta":{"timestamp":"2026-06-03T17:42:08.414Z","request_id":"c87da843-3e03-4a88-969a-c3cadc005b98"},"status":"ok","message":"NPV","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Investment Calculator API","notes":"Annuities are ordinary (payments at period end). Rates accept percent (10) or fraction (0.10). IRR uses a bracketed bisection; unconventional flows may have none or several. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/npv","params":{"rate":"discount rate (percent or fraction)","cashflows":"[-1000,500,500,500]"},"returns":"the net present value"},{"path":"/v1/irr","params":{"cashflows":"[-1000,500,500,500]"},"returns":"the internal rate of return"},{"path":"/v1/annuity","params":{"rate":"per-period rate","payment":"or present_value or future_value (give exactly one)","periods":"number of periods"},"returns":"payment, present value and future value"},{"path":"/v1/depreciation","params":{"cost":"asset cost","life":"years","factor":"for declining balance (default 2)","method":"straight_line|declining_balance|sum_of_years","salvage":"salvage value (default 0)"},"returns":"the depreciation schedule"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Investment and capital-budgeting maths as an API. The npv endpoint computes the net present value of a series of cash flows at a discount rate (the first flow is usually the negative initial investment). The irr endpoint finds the internal rate of return — the discount rate at which the net present value is zero — by a robust bracketed search. The annuity endpoint solves a level (ordinary) annuity: give the rate, the number of periods and any one of the payment, present value or future value, and it returns the other two. The depreciation endpoint builds a full year-by-year schedule by the straight-line, declining-balance (any factor, e.g. double-declining) or sum-of-the-years'-digits method, never depreciating below salvage value. Rates may be entered as a percentage or a fraction. Everything is computed locally and deterministically, so it is instant and private. Ideal for investment analysis and capital budgeting, accounting and finance tools, business planning, and finance education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 5 endpoints. This is investment maths; for loans, mortgages and compound interest use a financial-calculator API."},"meta":{"timestamp":"2026-06-03T17:42:08.503Z","request_id":"028fe41f-1afa-4224-bf3e-6d8974303be6"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":7535,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":905,"monthly_call_quota":17050,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2895,"monthly_call_quota":221500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6695,"monthly_call_quota":1150000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/financecalc-api"}