Calculate FI Timeline
const url = 'https://indepai.app/api/v1/calculator';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"currentAge":32,"annualIncome":72000,"annualExpenses":36000,"currentSavings":150000,"targetWithdrawalRate":4,"expectedReturn":7,"inflationRate":2,"email":"user@example.com","saveResult":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://indepai.app/api/v1/calculator \ --header 'Content-Type: application/json' \ --data '{ "currentAge": 32, "annualIncome": 72000, "annualExpenses": 36000, "currentSavings": 150000, "targetWithdrawalRate": 4, "expectedReturn": 7, "inflationRate": 2, "email": "user@example.com", "saveResult": true }'Calculate your Financial Independence timeline based on income, expenses, and savings. This is a public endpoint that does not require authentication but has stricter rate limits.
Request Body
Section titled “Request Body”object
Current age in years
Example
32Annual gross income in base currency
Example
72000Annual expenses in base currency
Example
36000Current total savings/investments in base currency
Example
150000Safe withdrawal rate percentage (default: 4%)
Example
4Expected annual return percentage (default: 7%)
Example
7Expected annual inflation rate percentage (default: 2%)
Example
2Optional email to associate with the calculation result
Example
user@example.comWhether to save the result for analytics (default: true)
Example
trueResponses
Section titled “Responses”FI calculation successful
object
Indicates successful calculation
object
Target FI amount (annual expenses × FI multiplier)
Years until FI is reached
Projected date of reaching FI
Age at which FI will be reached
Monthly savings amount
Annual savings amount
Current savings rate percentage (0-100)
Current progress toward FI percentage (0-100)
Year-by-year wealth projections
object
Year number (0 = current year)
Age at this year
Projected net worth at end of year
Cumulative contributions
Cumulative investment gains
Percentage progress toward FI Number
Whether FI has been reached this year
Input parameters used for calculation
object
object
Response timestamp
API version
Example
{ "success": true, "data": { "fiNumber": 900000, "yearsToFI": 12, "fiDate": "2036-01-15T00:00:00Z", "fiAge": 44, "monthlySavings": 3000, "annualSavings": 36000, "savingsRate": 50, "currentProgress": 16.7, "yearlyProjections": [ { "year": 0, "age": 32, "netWorth": 150000, "totalContributions": 150000, "totalGains": 0, "progressPercent": 16.7, "fiReached": false } ] }, "meta": { "version": "1.0" }}Validation error
object
Always false for error responses
Error type
Machine-readable error code
Detailed validation errors
object
Path to the invalid field
Error message
Example
{ "success": false, "error": "Validation error", "code": "VALIDATION_ERROR", "details": [ { "path": "currentAge", "message": "Must be between 18 and 100" } ]}Rate limit exceeded
object
Always false for error responses
Error type
Machine-readable error code
Detailed validation errors
object
Path to the invalid field
Error message
Example
{ "success": false, "error": "Validation error", "code": "VALIDATION_ERROR", "details": [ { "path": "currentAge", "message": "Must be between 18 and 100" } ]}