Compound interest calculator API with monthly contributions
No account. Pay by card from $1 and your key appears right after payment. Get a key by card
Compound interest on savings or an investment: starting amount, annual rate, years, compounding (yearly, quarterly, monthly or daily) and an optional contribution at the end of each month. Returns the future value, 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
$0.001 per call with prepaid credits: $1 by card pays for 1,000 calls, with no account and no subscription.
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://glyphtools.com/calc/compound-interest?principal=10000&rate=7&years=10"
Node.js
const r = await fetch("https://glyphtools.com/calc/compound-interest?principal=10000&rate=7&years=10", {
headers: { Authorization: "Bearer adt_…" },
});
const data = await r.json(); // 402 until the key is in the header
Python
import requests
r = requests.get("https://glyphtools.com/calc/compound-interest?principal=10000&rate=7&years=10", headers={"Authorization": "Bearer adt_…"}, timeout=60)
data = r.json()
Or one of your 3 free calls, no key — the same request with &trial=1 on the end:
curl "https://glyphtools.com/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 10 successful calls are free:
https://glyphtools.com/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 3 calls are free (10 through an MCP client). Then pay with card credits (from $1; the key goes in an Authorization header or, for clients that can only fetch a URL, as api_key= in the URL) or per call in USDC over x402 or MPP. No account is needed.