Compound interest calculator API with monthly contributions
Future value of savings or an investment with compound interest: starting amount, annual rate, years, compounding (yearly, quarterly, monthly or daily) and an optional contribution at the end of each month. Returns the final balance, total contributed, interest earned and the balance after each year. Use for savings goals and investment what-ifs; rates are assumed constant.
When to use it
- Project savings or an investment with yearly, quarterly, monthly or daily compounding
- Add a contribution at the end of every month
- Get the balance after each year for a chart
Inputs
| Name | Type | Description |
|---|---|---|
principal (required) | number | Starting amount (0 or more) |
rate (required) | number | Annual interest rate in percent, -50 to 100 |
years (required) | number | Years, up to 100 |
compound | string | yearly, quarterly, monthly (default) or daily |
monthly | number | Contribution at the end of each month (default 0) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/calc/compound-interest?principal=10000&rate=7&years=10"
Or one of your 25 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/calc/compound-interest?principal=10000&rate=7&years=10&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"futureValue": 54713.58,
"totalContributions": 34000,
"interestEarned": 20713.58,
"byYear": [
{
"year": 1,
"balance": 13201.42
}
]
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is calc_compound_interest, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp
Questions
Is the rate fixed?
Yes, the calculation assumes a constant annual rate.
What does it return?
The future value, total contributed, interest earned and the balance after each year.
How do I pay?
Each successful call costs $0.01; failed calls are not charged. The first 25 calls are free. Then pay with card credits (from $5) or per call in USDC over x402 or MPP. No account or API key is needed.