{"openapi":"3.1.0","info":{"title":"Finance Toolkit API","description":"Accurate personal-finance calculations as a clean JSON API: loan amortization, early-payoff scenarios, debt snowball vs. avalanche, compound savings growth, and budget allocation. No stored data, no auth on the free tier — send a request, get an answer.","version":"1.0.0"},"paths":{"/v1/loan/amortization":{"post":{"tags":["Loans"],"summary":"Loan Amortization","description":"Full amortization schedule plus payoff summary, with optional extra monthly principal.","operationId":"loan_amortization_v1_loan_amortization_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmortizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmortizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/debt/plan":{"post":{"tags":["Debt"],"summary":"Debt Plan","description":"Compare snowball (smallest balance first) vs. avalanche (highest APR first) payoff plans.","operationId":"debt_plan_v1_debt_plan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtPlanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebtPlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/savings/compound":{"post":{"tags":["Savings"],"summary":"Savings Compound","description":"Project savings growth with monthly compounding and optional yearly contribution increases.","operationId":"savings_compound_v1_savings_compound_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/budget/allocate":{"post":{"tags":["Budget"],"summary":"Budget Allocate","description":"Split net income by a standard budgeting rule, with weekly equivalents.","operationId":"budget_allocate_v1_budget_allocate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/claim":{"post":{"tags":["Meta"],"summary":"Claim Key","description":"Exchange a USDC payment transaction hash for a Pro API key.","operationId":"claim_key_v1_keys_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AmortizationRequest":{"properties":{"principal":{"type":"number","exclusiveMinimum":0.0,"title":"Principal","description":"Loan amount","examples":[250000]},"apr":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Apr","description":"Annual rate in percent","examples":[6.5]},"term_months":{"type":"integer","maximum":600.0,"exclusiveMinimum":0.0,"title":"Term Months","examples":[360]},"extra_monthly":{"type":"number","minimum":0.0,"title":"Extra Monthly","description":"Extra principal paid each month","default":0},"include_schedule":{"type":"boolean","title":"Include Schedule","description":"Return the full month-by-month schedule","default":true}},"type":"object","required":["principal","apr","term_months"],"title":"AmortizationRequest"},"AmortizationResponse":{"properties":{"monthly_payment":{"type":"number","title":"Monthly Payment"},"months_to_payoff":{"type":"integer","title":"Months To Payoff"},"total_paid":{"type":"number","title":"Total Paid"},"total_interest":{"type":"number","title":"Total Interest"},"interest_saved_vs_no_extra":{"type":"number","title":"Interest Saved Vs No Extra"},"months_saved_vs_no_extra":{"type":"integer","title":"Months Saved Vs No Extra"},"schedule":{"anyOf":[{"items":{"$ref":"#/components/schemas/ScheduleRow"},"type":"array"},{"type":"null"}],"title":"Schedule"}},"type":"object","required":["monthly_payment","months_to_payoff","total_paid","total_interest","interest_saved_vs_no_extra","months_saved_vs_no_extra"],"title":"AmortizationResponse"},"BudgetRequest":{"properties":{"monthly_net_income":{"type":"number","exclusiveMinimum":0.0,"title":"Monthly Net Income","examples":[5200]},"rule":{"type":"string","enum":["50/30/20","60/20/20","70/20/10"],"title":"Rule","default":"50/30/20"}},"type":"object","required":["monthly_net_income"],"title":"BudgetRequest"},"BudgetResponse":{"properties":{"rule":{"type":"string","title":"Rule"},"needs":{"type":"number","title":"Needs"},"wants":{"type":"number","title":"Wants"},"savings_debt":{"type":"number","title":"Savings Debt"},"weekly":{"additionalProperties":{"type":"number"},"type":"object","title":"Weekly"}},"type":"object","required":["rule","needs","wants","savings_debt","weekly"],"title":"BudgetResponse"},"ClaimRequest":{"properties":{"tx_hash":{"type":"string","title":"Tx Hash","description":"Transaction hash of your USDC payment on Base"},"email":{"type":"string","title":"Email","description":"Where to reach you about the key"}},"type":"object","required":["tx_hash","email"],"title":"ClaimRequest"},"Debt":{"properties":{"name":{"type":"string","title":"Name","examples":["Visa"]},"balance":{"type":"number","exclusiveMinimum":0.0,"title":"Balance","examples":[4200]},"apr":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Apr","examples":[24.99]},"min_payment":{"type":"number","exclusiveMinimum":0.0,"title":"Min Payment","examples":[85]}},"type":"object","required":["name","balance","apr","min_payment"],"title":"Debt"},"DebtPlanRequest":{"properties":{"debts":{"items":{"$ref":"#/components/schemas/Debt"},"type":"array","maxItems":50,"minItems":1,"title":"Debts"},"monthly_budget":{"type":"number","exclusiveMinimum":0.0,"title":"Monthly Budget","description":"Total you can put toward debts each month"}},"type":"object","required":["debts","monthly_budget"],"title":"DebtPlanRequest"},"DebtPlanResponse":{"properties":{"snowball":{"$ref":"#/components/schemas/DebtResult"},"avalanche":{"$ref":"#/components/schemas/DebtResult"},"recommendation":{"type":"string","title":"Recommendation"}},"type":"object","required":["snowball","avalanche","recommendation"],"title":"DebtPlanResponse"},"DebtResult":{"properties":{"strategy":{"type":"string","enum":["snowball","avalanche"],"title":"Strategy"},"months_to_debt_free":{"type":"integer","title":"Months To Debt Free"},"total_interest":{"type":"number","title":"Total Interest"},"payoff_order":{"items":{"type":"string"},"type":"array","title":"Payoff Order"}},"type":"object","required":["strategy","months_to_debt_free","total_interest","payoff_order"],"title":"DebtResult"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SavingsRequest":{"properties":{"initial":{"type":"number","minimum":0.0,"title":"Initial","examples":[10000]},"monthly_contribution":{"type":"number","minimum":0.0,"title":"Monthly Contribution","examples":[500]},"annual_return":{"type":"number","maximum":100.0,"minimum":-50.0,"title":"Annual Return","description":"Expected annual return, percent","examples":[7]},"years":{"type":"number","maximum":100.0,"exclusiveMinimum":0.0,"title":"Years","examples":[20]},"annual_contribution_increase":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Annual Contribution Increase","description":"Yearly raise applied to the contribution, percent","default":0}},"type":"object","required":["initial","monthly_contribution","annual_return","years"],"title":"SavingsRequest"},"SavingsResponse":{"properties":{"final_balance":{"type":"number","title":"Final Balance"},"total_contributed":{"type":"number","title":"Total Contributed"},"total_growth":{"type":"number","title":"Total Growth"},"by_year":{"items":{"$ref":"#/components/schemas/SavingsYearRow"},"type":"array","title":"By Year"}},"type":"object","required":["final_balance","total_contributed","total_growth","by_year"],"title":"SavingsResponse"},"SavingsYearRow":{"properties":{"year":{"type":"integer","title":"Year"},"contributed_to_date":{"type":"number","title":"Contributed To Date"},"balance":{"type":"number","title":"Balance"},"growth_to_date":{"type":"number","title":"Growth To Date"}},"type":"object","required":["year","contributed_to_date","balance","growth_to_date"],"title":"SavingsYearRow"},"ScheduleRow":{"properties":{"month":{"type":"integer","title":"Month"},"payment":{"type":"number","title":"Payment"},"principal":{"type":"number","title":"Principal"},"interest":{"type":"number","title":"Interest"},"balance":{"type":"number","title":"Balance"}},"type":"object","required":["month","payment","principal","interest","balance"],"title":"ScheduleRow"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"/financetoolkit"}]}